Search or ask Docker

Update a node

POST /nodes/{id}/update — Docker Engine API 1.57.

View Markdown
POST/nodes/{id}/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

id path Required

The ID of the node

Type: string

All schema constraints and annotations
{
  "type": "string"
}

version query Required

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

Type: integer

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

Request and responses

Request

application/json

Schema: NodeSpec

Schema example

{
  "Availability": "active",
  "Labels": {
    "foo": "bar"
  },
  "Name": "node-name",
  "Role": "manager"
}

Request

text/plain

Schema: NodeSpec

Schema example

{
  "Availability": "active",
  "Labels": {
    "foo": "bar"
  },
  "Name": "node-name",
  "Role": "manager"
}

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 404

no such node

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/NodeSpec

Complete operation contract
{
  "operationId": "NodeUpdate",
  "parameters": [
    {
      "description": "The ID of the node",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n",
      "in": "query",
      "name": "version",
      "required": true,
      "schema": {
        "format": "int64",
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/NodeSpec"
        }
      },
      "text/plain": {
        "schema": {
          "$ref": "#/components/schemas/NodeSpec"
        }
      }
    },
    "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"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "no such node"
    },
    "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 node",
  "tags": [
    "Node"
  ]
}