Swarm

Reference

DockerSwarm

class aiodocker.swarm.DockerSwarm(docker)[source]
coroutine init(self, *, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, swarm_spec=None)[source]

Initialize a new swarm.

Parameters
  • ListenAddr – listen address used for inter-manager communication

  • AdvertiseAddr – address advertised to other nodes.

  • ForceNewCluster – Force creation of a new swarm.

  • SwarmSpec – User modifiable swarm configuration.

Return type

str

Returns

id of the swarm node

coroutine inspect(self)[source]

Inspect a swarm.

Return type

Mapping

Returns

Info about the swarm

coroutine join(self, *, remote_addrs, listen_addr='0.0.0.0:2377', join_token, advertise_addr=None, data_path_addr=None)[source]

Join a swarm.

Parameters
  • listen_addr (str) – Used for inter-manager communication

  • advertise_addr (Optional[str]) – Externally reachable address advertised to other nodes.

  • data_path_addr (Optional[str]) – Address or interface to use for data path traffic.

  • remote_addrs (Iterable[str]) – Addresses of manager nodes already participating in the swarm.

  • join_token (str) – Secret token for joining this swarm.

Return type

bool

coroutine leave(self, *, force=False)[source]

Leave a swarm.

Parameters

force (bool) – force to leave the swarm even if the node is a master

Return type

bool