Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›REST APIs ›Node lifecycle APIs

Get shutdown API

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

New API reference

For the most up-to-date API details, refer to Node lifecycle APIs.

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

Request

GET _nodes/shutdown

GET _nodes/<node-id>/shutdown

Prerequisites

  • If the Elasticsearch security features are enabled, you must have the manage cluster privilege to use this API.
  • If the operator privileges feature is enabled, you must be an operator to use this API.

Description

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 parameters

<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.

Examples

Prepare a node to be restarted:

resp = client.shutdown.put_node(
    node_id="USpTGYaBSIKbgSUJR2Z9lg",
    type="restart",
    reason="Demonstrating how the node shutdown API works",
    allocation_delay="10m",
)
print(resp)
response = client.shutdown.put_node(
  node_id: 'USpTGYaBSIKbgSUJR2Z9lg',
  body: {
    type: 'restart',
    reason: 'Demonstrating how the node shutdown API works',
    allocation_delay: '10m'
  }
)
puts response
const response = await client.shutdown.putNode({
  node_id: "USpTGYaBSIKbgSUJR2Z9lg",
  type: "restart",
  reason: "Demonstrating how the node shutdown API works",
  allocation_delay: "10m",
});
console.log(response);
PUT /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown
{
  "type": "restart",
  "reason": "Demonstrating how the node shutdown API works",
  "allocation_delay": "10m"
}

Get the status of the shutdown preparations:

resp = client.shutdown.get_node(
    node_id="USpTGYaBSIKbgSUJR2Z9lg",
)
print(resp)
response = client.shutdown.get_node(
  node_id: 'USpTGYaBSIKbgSUJR2Z9lg'
)
puts response
const response = await client.shutdown.getNode({
  node_id: "USpTGYaBSIKbgSUJR2Z9lg",
});
console.log(response);
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"
            }
        }
    ]
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-shutdown.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API