Skip to main content

clientapi_pve/models/
cluster_sdn_add_node_request.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClusterSdnAddNodeRequest {
16
17    /// A list of IPs that are routable via this node in the WireGuard fabric.
18    #[serde(rename = "allowed_ips", skip_serializing_if = "Option::is_none")]
19    pub allowed_ips: Option<Vec<String>>,
20
21    /// Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications.
22    #[serde(rename = "digest", skip_serializing_if = "Option::is_none")]
23    pub digest: Option<String>,
24
25    /// The endpoint used for connecting to this node.
26    #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none")]
27    pub endpoint: Option<String>,
28
29    #[serde(rename = "interfaces")]
30    pub interfaces: Vec<serde_json::Value>,
31
32    /// IPv4 address for this node
33    #[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
34    pub ip: Option<String>,
35
36    /// IPv6 address for this node
37    #[serde(rename = "ip6", skip_serializing_if = "Option::is_none")]
38    pub ip6: Option<String>,
39
40    /// the token for unlocking the global SDN configuration
41    #[serde(rename = "lock-token", skip_serializing_if = "Option::is_none")]
42    pub lock_token: Option<String>,
43
44    /// Identifier for nodes in an SDN fabric
45    #[serde(rename = "node_id")]
46    pub node_id: String,
47
48    #[serde(rename = "peers", skip_serializing_if = "Option::is_none")]
49    pub peers: Option<Vec<models::ClusterSdnListAllResponseDataNodesInnerPeersInner>>,
50
51    /// Type of configuration entry in an SDN Fabric section config
52    #[serde(rename = "protocol")]
53    pub protocol: models::PveProtocolEnum,
54
55    /// The public key for the external node.
56    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
57    pub public_key: Option<String>,
58
59    /// The role of this node in the WireGuard fabric.
60    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
61    pub role: Option<models::PveRoleEnum>,
62
63
64}
65
66impl ClusterSdnAddNodeRequest {
67    pub fn new(interfaces: Vec<serde_json::Value>, node_id: String, protocol: models::PveProtocolEnum) -> ClusterSdnAddNodeRequest {
68        ClusterSdnAddNodeRequest {
69            
70            allowed_ips: None,
71            
72            digest: None,
73            
74            endpoint: None,
75            
76            interfaces,
77            
78            ip: None,
79            
80            ip6: None,
81            
82            lock_token: None,
83            
84            node_id,
85            
86            peers: None,
87            
88            protocol,
89            
90            public_key: None,
91            
92            role: None,
93            
94        }
95    }
96}
97
98