Get shutdown APIedit

This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

Retrieves the status of a node that’s being prepared for shutdown.

Requestedit

GET _nodes/shutdown

GET _nodes/<node-id>/shutdown

Prerequisitesedit

Descriptionedit

Indicates whether a node is ready to be shut down, or if shut down preparations are still in progress or have stalled. Returns status information for each part of the shut down process. Use to monitor the shut down process after calling put shutdown.

Path parametersedit

<node-id>
(Optional, string) The ID of a node that is being prepared for shutdown. If no ID is specified, returns the status of all nodes being prepared for shutdown.

Query parametersedit

master_timeout
(Optional, time units) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.
timeout
(Optional, time units) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.

Examplesedit

Prepare a node to be restarted:

PUT /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown
{
  "type": "restart",
  "reason": "Demonstrating how the node shutdown API works",
  "allocation_delay": "10m"
}

Get the status of the shutdown preparations:

GET /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown

The response shows information about the shutdown preparations, including the status of shard migration, task migration, and plugin cleanup:

{
    "nodes": [
        {
            "node_id": "USpTGYaBSIKbgSUJR2Z9lg",
            "type": "RESTART",
            "reason": "Demonstrating how the node shutdown API works",
            "shutdown_startedmillis": 1624406108685,
            "allocation_delay": "10m",
            "status": "COMPLETE",
            "shard_migration": {
                "status": "COMPLETE",
                "shard_migrations_remaining": 0,
                "explanation": "no shard relocation is necessary for a node restart"
            },
            "persistent_tasks": {
                "status": "COMPLETE"
            },
            "plugins": {
                "status": "COMPLETE"
            }
        }
    ]
}