nazrin/nzr-api/src/args.rs

27 lines
675 B
Rust

use serde::{Deserialize, Serialize};
use crate::net::cidr::CidrV4;
use std::net::Ipv4Addr;
#[derive(Debug, Serialize, Deserialize)]
pub struct NewInstance {
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub subnet: String,
pub base_image: String,
pub cores: u8,
pub memory: u32,
pub disk_sizes: (u32, Option<u32>),
pub ci_userdata: Option<Vec<u8>>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct NewSubnet {
pub if_name: String,
pub network: CidrV4,
pub start_addr: Option<Ipv4Addr>,
pub end_addr: Option<Ipv4Addr>,
pub gateway: Option<Ipv4Addr>,
pub dns: Vec<Ipv4Addr>,
}