stackify_docker_api/opts/
swarm.rs

1use crate::models::SwarmSpec;
2use containers_api::{impl_field, impl_opts_builder, impl_str_field, impl_vec_field};
3
4impl_opts_builder!(json => SwarmJoin);
5
6impl SwarmJoinOptsBuilder {
7    impl_str_field!(
8        /// Listen address used for inter-manager communication if the node gets promoted to manager,
9        /// as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP).
10        listen_addr => "ListenAddr"
11    );
12
13    impl_str_field!(
14        // Externally reachable address advertised to other nodes. This can either be an address/port
15        // combination in the form 192.168.1.1:4567, or an interface followed by a port number, like eth0:4567.
16        // If the port number is omitted, the port number from the listen address is used. If AdvertiseAddr is
17        // not specified, it will be automatically detected when possible.
18        advertise_addr => "AdvertiseAddr"
19    );
20
21    impl_str_field!(
22        /// Address or interface to use for data path traffic.
23        data_path_addr => "DataPathAddr"
24    );
25
26    impl_vec_field!(
27        /// Addresses of manager nodes already participating in the swarm.
28        remote_addrs => "RemoteAddrs"
29    );
30
31    impl_str_field!(
32        /// Secret token for joining this swarm.
33        join_token => "JoinToken"
34    );
35}
36
37impl_opts_builder!(json => SwarmInit);
38
39impl SwarmInitOptsBuilder {
40    impl_str_field!(
41        // Listen address used for inter-manager communication if the node gets promoted to manager,
42        // as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP).
43        listen_addr => "ListenAddr"
44    );
45
46    impl_str_field!(
47        // Externally reachable address advertised to other nodes. This can either be an address/port
48        // combination in the form 192.168.1.1:4567, or an interface followed by a port number, like eth0:4567.
49        // If the port number is omitted, the port number from the listen address is used. If AdvertiseAddr is
50        // not specified, it will be automatically detected when possible.
51        advertise_addr => "AdvertiseAddr"
52    );
53
54    impl_str_field!(
55        /// Address or interface to use for data path traffic.
56        data_path_addr => "DataPathAddr"
57    );
58
59    impl_field!(
60        // Specifies the data path port number for data traffic. Acceptable port range is 1024 to 49151.
61        // If no port is set or is set to 0, default port 4789 will be used.
62        data_path_port: u32 => "DataPathPort"
63    );
64
65    impl_vec_field!(
66        // Default Address Pool specifies default subnet pools for global scope networks.
67        default_addr_pool => "DefaultAddrPool"
68    );
69
70    impl_field!(
71        /// Force creation of a new swarm.
72        force_new_cluster: bool => "ForceNewCluster"
73    );
74
75    impl_field!(
76        // SubnetSize specifies the subnet size of the networks created from the default subnet pool.
77        subnet_size: u32 => "SubnetSize"
78    );
79
80    impl_field!(
81        /// User modifiable swarm configuration.
82        spec: SwarmSpec => "Spec"
83    );
84}