---
type: api
title: Get the shutdown status
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-shutdown-get-node
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-shutdown-get-node
products:
  - Elasticsearch
---

# Get the shutdown status


Availability: Generally available since 7.13

## Paths

- `GET` `/_nodes/{node_id}/shutdown`
- `GET` `/_nodes/shutdown`

#### Path parameters

- `node_id` (union string | string[]) — optional, leave it out to use `/_nodes/shutdown`
  Comma-separated list of nodes for which to retrieve the shutdown status

## Description

Get information about nodes that are ready to be shut down, have shut down preparations still in progress, or have stalled.
The API returns status information for each part of the shut down process.

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

If the operator privileges feature is enabled, you must be an operator to use this API.

## Required authorization

- Cluster privileges: `manage`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  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.

## Response

`application/json`

- `nodes` (object[])
  - `node_id` (string)
  - `type` (enum)
    Values: `remove`, `restart`
  - `reason` (string)
  - `shutdown_startedmillis` (number)
  - `status` (enum)
    Values: `not_started`, `in_progress`, `stalled`, `complete`
  - `shard_migration` (object)
    - `status` (enum)
      Values: `not_started`, `in_progress`, `stalled`, `complete`
  - `persistent_tasks` (object)
    - `status` (enum)
      Values: `not_started`, `in_progress`, `stalled`, `complete`
  - `plugins` (object)
    - `status` (enum)
      Values: `not_started`, `in_progress`, `stalled`, `complete`
## Code examples

#### Console

```console
GET /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown
```

#### JavaScript

```javascript
const response = await client.shutdown.getNode({
  node_id: "USpTGYaBSIKbgSUJR2Z9lg",
});
```

#### Python

```python
resp = client.shutdown.get_node(
    node_id="USpTGYaBSIKbgSUJR2Z9lg",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.shutdown().getNode(g -> g
    .nodeId("USpTGYaBSIKbgSUJR2Z9lg")
);
```

#### PHP

```php
$resp = $client->shutdown()->getNode([
    "node_id" => "USpTGYaBSIKbgSUJR2Z9lg",
]);
```

#### Ruby

```ruby
response = client.perform_request(
  "GET",
  "/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown",
  {},
)
```

## Response examples

#### Shutdown get node response example1

Get the status of shutdown preparations with `GET /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown`. The response shows information about the shutdown preparations, including the status of shard migration, task migration, and plugin cleanup

```json
{
    "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"
            }
        }
    ]
}
```

