Search or ask Docker

Leave a swarm

POST /swarm/leave — Docker Engine API 1.57.

View Markdown
POST/swarm/leave

Connection and access

API connection and authentication guidance

/v1.57

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

Parameters

force query

Force leave swarm, even if this is the last manager or that it will break the cluster.

Type: boolean

All schema constraints and annotations
{
  "default": false,
  "type": "boolean"
}

Request and responses

Response 200

no error

application/json

Response 200

no error

text/plain

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 503

node is not part of a swarm

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ErrorResponse

Complete operation contract
{
  "operationId": "SwarmLeave",
  "parameters": [
    {
      "description": "Force leave swarm, even if this is the last manager or that it will\nbreak the cluster.\n",
      "in": "query",
      "name": "force",
      "schema": {
        "default": false,
        "type": "boolean"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {},
        "text/plain": {}
      },
      "description": "no error"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "node is not part of a swarm"
    }
  },
  "summary": "Leave a swarm",
  "tags": [
    "Swarm"
  ]
}