Join an existing swarm Run in API Explorer

POST /swarm/join
application/json

Body Required

  • ListenAddr string

    Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP).

  • AdvertiseAddr string

    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 port number, like eth0:4567. If the port number is omitted, the port number from the listen address is used. If AdvertiseAddr is not specified, it will be automatically detected when possible.

  • DataPathAddr string

    Address or interface to use for data path traffic (format: <ip|interface>), for example, 192.168.1.1, or an interface, like eth0. If DataPathAddr is unspecified, the same address as AdvertiseAddr is used.

    The DataPathAddr specifies the address that global scope network drivers will publish towards other nodes in order to reach the containers running on this node. Using this parameter it is possible to separate the container data traffic from the management traffic of the cluster.

  • RemoteAddrs array[string]

    Addresses of manager nodes already participating in the swarm.

  • JoinToken string

    Secret token for joining this swarm.

Responses

  • 200

    no error

  • 400 application/json

    bad parameter

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 503 application/json

    node is already part of a swarm

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

POST /swarm/join
curl \
 --request POST 'http://api.example.com/v1.49/swarm/join' \
 --header "Content-Type: application/json" \
 --data '{"JoinToken":"SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2","ListenAddr":"0.0.0.0:2377","RemoteAddrs":["node1:2377"],"DataPathAddr":"192.168.1.1","AdvertiseAddr":"192.168.1.1:2377"}'
Request examples
{
  "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2",
  "ListenAddr": "0.0.0.0:2377",
  "RemoteAddrs": [
    "node1:2377"
  ],
  "DataPathAddr": "192.168.1.1",
  "AdvertiseAddr": "192.168.1.1:2377"
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (503)
{
  "message": "Something went wrong."
}
Response examples (503)
{
  "message": "Something went wrong."
}