nazrin/nzr-api/src/args.rs

28 lines
675 B
Rust
Raw Normal View History

2022-12-30 06:06:14 +00:00
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>,
2023-01-17 04:42:01 +00:00
pub subnet: String,
2022-12-30 06:06:14 +00:00
pub base_image: String,
pub cores: u8,
pub memory: u32,
pub disk_sizes: (u32, Option<u32>),
2024-08-15 00:33:59 +00:00
pub ci_userdata: Option<Vec<u8>>,
2022-12-30 06:06:14 +00:00
}
#[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>,
}