Search or ask Docker

Update a swarm

POST /swarm/update — Docker Engine API 1.57.

View Markdown
POST/swarm/update

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

version query Required

The version number of the swarm object being updated. This is required to avoid conflicting writes.

Type: integer

All schema constraints and annotations
{
  "format": "int64",
  "type": "integer"
}

rotateWorkerToken query

Rotate the worker join token.

Type: boolean

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

rotateManagerToken query

Rotate the manager join token.

Type: boolean

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

rotateManagerUnlockKey query

Rotate the manager unlock key.

Type: boolean

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

Request and responses

Request

application/json

Schema: SwarmSpec

Request

text/plain

Schema: SwarmSpec

Response 200

no error

application/json

Response 200

no error

text/plain

Response 400

bad parameter

application/json

Schema: ErrorResponse

Schema example

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

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

#/components/schemas/SwarmSpec

Complete operation contract
{
  "operationId": "SwarmUpdate",
  "parameters": [
    {
      "description": "The version number of the swarm object being updated. This is\nrequired to avoid conflicting writes.\n",
      "in": "query",
      "name": "version",
      "required": true,
      "schema": {
        "format": "int64",
        "type": "integer"
      }
    },
    {
      "description": "Rotate the worker join token.",
      "in": "query",
      "name": "rotateWorkerToken",
      "schema": {
        "default": false,
        "type": "boolean"
      }
    },
    {
      "description": "Rotate the manager join token.",
      "in": "query",
      "name": "rotateManagerToken",
      "schema": {
        "default": false,
        "type": "boolean"
      }
    },
    {
      "description": "Rotate the manager unlock key.",
      "in": "query",
      "name": "rotateManagerUnlockKey",
      "schema": {
        "default": false,
        "type": "boolean"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SwarmSpec"
        }
      },
      "text/plain": {
        "schema": {
          "$ref": "#/components/schemas/SwarmSpec"
        }
      }
    },
    "required": true,
    "x-codegen-request-body-name": "body"
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {},
        "text/plain": {}
      },
      "description": "no error"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "bad parameter"
    },
    "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": "Update a swarm",
  "tags": [
    "Swarm"
  ]
}