Update a node Run in API Explorer

POST /nodes/{id}/update

Path parameters

  • id string Required

    The ID of the node

Query parameters

  • version integer(int64) Required

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

application/json

Body

  • Name string

    Name for the node.

  • Labels object

    User-defined key/value metadata.

    Hide Labels attribute Show Labels attribute object
    • * string Additional properties
  • Role string

    Role of the node.

    Values are worker or manager.

  • Availability string

    Availability of the node.

    Values are active, pause, or drain.

Responses

  • 200

    no error

  • 400 application/json

    bad parameter

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 404 application/json

    no such node

    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 not part of a swarm

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

POST /nodes/{id}/update
curl \
 --request POST 'http://api.example.com/v1.49/nodes/{id}/update?version=42' \
 --header "Content-Type: application/json" \
 --data '{"Name":"node-name","Role":"manager","Labels":{"foo":"bar"},"Availability":"active"}'
Request examples
{
  "Name": "node-name",
  "Role": "manager",
  "Labels": {
    "foo": "bar"
  },
  "Availability": "active"
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "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."
}