proxmox_api/generated/cluster/sdn/vnets/vnet/subnets/
subnet.rs1pub struct SubnetClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> SubnetClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str, subnet: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}/{}", parent_path, subnet),
13 }
14 }
15}
16impl<T> SubnetClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Delete sdn subnet object configuration."]
21 pub fn delete(&self) -> Result<(), T::Error> {
22 let path = self.path.to_string();
23 self.client.delete(&path, &())
24 }
25}
26impl<T> SubnetClient<T>
27where
28 T: crate::client::Client,
29{
30 #[doc = "Read sdn subnet configuration."]
31 pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
32 let path = self.path.to_string();
33 self.client.get(&path, ¶ms)
34 }
35}
36impl<T> SubnetClient<T>
37where
38 T: crate::client::Client,
39{
40 #[doc = "Update sdn subnet object configuration."]
41 pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
42 let path = self.path.to_string();
43 self.client.put(&path, ¶ms)
44 }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
47pub struct GetOutput {
48 #[serde(
49 flatten,
50 default,
51 skip_serializing_if = "::std::collections::HashMap::is_empty"
52 )]
53 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
54}
55#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
56pub struct GetParams {
57 #[serde(
58 serialize_with = "crate::types::serialize_bool_optional",
59 deserialize_with = "crate::types::deserialize_bool_optional"
60 )]
61 #[serde(skip_serializing_if = "Option::is_none", default)]
62 #[doc = "Display pending config."]
63 pub pending: Option<bool>,
64 #[serde(
65 serialize_with = "crate::types::serialize_bool_optional",
66 deserialize_with = "crate::types::deserialize_bool_optional"
67 )]
68 #[serde(skip_serializing_if = "Option::is_none", default)]
69 #[doc = "Display running config."]
70 pub running: Option<bool>,
71 #[serde(
72 flatten,
73 default,
74 skip_serializing_if = "::std::collections::HashMap::is_empty"
75 )]
76 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
77}
78#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
79pub struct PutParams {
80 #[serde(skip_serializing_if = "Option::is_none", default)]
81 #[doc = "A list of settings you want to delete."]
82 pub delete: Option<String>,
83 #[serde(rename = "dhcp-dns-server")]
84 #[serde(skip_serializing_if = "Option::is_none", default)]
85 #[doc = "IP address for the DNS server"]
86 pub dhcp_dns_server: Option<::std::net::IpAddr>,
87 #[serde(rename = "dhcp-range")]
88 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
89 #[doc = "A list of DHCP ranges for this subnet"]
90 pub dhcp_range: Vec<String>,
91 #[serde(skip_serializing_if = "Option::is_none", default)]
92 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
93 pub digest: Option<String>,
94 #[serde(skip_serializing_if = "Option::is_none", default)]
95 #[doc = "dns domain zone prefix ex: 'adm' -\\> \\<hostname\\>.adm.mydomain.com"]
96 pub dnszoneprefix: Option<String>,
97 #[serde(skip_serializing_if = "Option::is_none", default)]
98 #[doc = "Subnet Gateway: Will be assign on vnet for layer3 zones"]
99 pub gateway: Option<::std::net::IpAddr>,
100 #[serde(
101 serialize_with = "crate::types::serialize_bool_optional",
102 deserialize_with = "crate::types::deserialize_bool_optional"
103 )]
104 #[serde(skip_serializing_if = "Option::is_none", default)]
105 #[doc = "enable masquerade for this subnet if pve-firewall"]
106 pub snat: Option<bool>,
107 #[serde(
108 flatten,
109 default,
110 skip_serializing_if = "::std::collections::HashMap::is_empty"
111 )]
112 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
113}