MCPcopy Index your code
hub / github.com/docker/docker-py / init

Method init

docker/models/swarm.py:37–134  ·  view source on GitHub ↗

Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to other nodes. This can either be an address/port combination in the form ``192.168.1.1:4567``, or an interface followed by a

(self, advertise_addr=None, listen_addr='0.0.0.0:2377',
             force_new_cluster=False, default_addr_pool=None,
             subnet_size=None, data_path_addr=None, data_path_port=None,
             **kwargs)

Source from the content-addressed store, hash-verified

35 get_unlock_key.__doc__ = APIClient.get_unlock_key.__doc__
36
37 def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377',
38 force_new_cluster=False, default_addr_pool=None,
39 subnet_size=None, data_path_addr=None, data_path_port=None,
40 **kwargs):
41 """
42 Initialize a new swarm on this Engine.
43
44 Args:
45 advertise_addr (str): Externally reachable address advertised to
46 other nodes. This can either be an address/port combination in
47 the form ``192.168.1.1:4567``, or an interface followed by a
48 port number, like ``eth0:4567``. If the port number is omitted,
49 the port number from the listen address is used.
50
51 If not specified, it will be automatically detected when
52 possible.
53 listen_addr (str): Listen address used for inter-manager
54 communication, as well as determining the networking interface
55 used for the VXLAN Tunnel Endpoint (VTEP). This can either be
56 an address/port combination in the form ``192.168.1.1:4567``,
57 or an interface followed by a port number, like ``eth0:4567``.
58 If the port number is omitted, the default swarm listening port
59 is used. Default: ``0.0.0.0:2377``
60 force_new_cluster (bool): Force creating a new Swarm, even if
61 already part of one. Default: False
62 default_addr_pool (list of str): Default Address Pool specifies
63 default subnet pools for global scope networks. Each pool
64 should be specified as a CIDR block, like '10.0.0.0/8'.
65 Default: None
66 subnet_size (int): SubnetSize specifies the subnet size of the
67 networks created from the default subnet pool. Default: None
68 data_path_addr (string): Address or interface to use for data path
69 traffic. For example, 192.168.1.1, or an interface, like eth0.
70 data_path_port (int): Port number to use for data path traffic.
71 Acceptable port range is 1024 to 49151. If set to ``None`` or
72 0, the default port 4789 will be used. Default: None
73 task_history_retention_limit (int): Maximum number of tasks
74 history stored.
75 snapshot_interval (int): Number of logs entries between snapshot.
76 keep_old_snapshots (int): Number of snapshots to keep beyond the
77 current snapshot.
78 log_entries_for_slow_followers (int): Number of log entries to
79 keep around to sync up slow followers after a snapshot is
80 created.
81 heartbeat_tick (int): Amount of ticks (in seconds) between each
82 heartbeat.
83 election_tick (int): Amount of ticks (in seconds) needed without a
84 leader to trigger a new election.
85 dispatcher_heartbeat_period (int): The delay for an agent to send
86 a heartbeat to the dispatcher.
87 node_cert_expiry (int): Automatic expiry for nodes certificates.
88 external_ca (dict): Configuration for forwarding signing requests
89 to an external certificate authority. Use
90 ``docker.types.SwarmExternalCA``.
91 name (string): Swarm's name
92 labels (dict): User-defined key/value metadata.
93 signing_ca_cert (str): The desired signing CA certificate for all
94 swarm node TLS leaf certificates, in PEM format.

Callers 4

test_list_get_updateMethod · 0.80
setUpClassMethod · 0.80

Calls 3

reloadMethod · 0.95
create_swarm_specMethod · 0.80
init_swarmMethod · 0.45

Tested by 4

test_list_get_updateMethod · 0.64
setUpClassMethod · 0.64