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

# Get the shutdown status


Availability: 7.13+

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `node_id` (union NodeId | [] NodeId) — 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`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  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` ([] NodeShutdownStatus)
  - `node_id` (string)
  - `type` (enum ShutdownType)
    Values: `remove`, `restart`
  - `reason` (string)
  - `shutdown_startedmillis` (EpochTimeUnitMillis)
  - `status` (enum ShutdownStatus)
    Values: `not_started`, `in_progress`, `stalled`, `complete`
  - `shard_migration` ({} ShardMigrationStatus)
    - `status` (enum ShutdownStatus)
      Values: `not_started`, `in_progress`, `stalled`, `complete`
  - `persistent_tasks` ({} PersistentTaskStatus)
    - `status` (enum ShutdownStatus)
      Values: `not_started`, `in_progress`, `stalled`, `complete`
  - `plugins` ({} PluginsStatus)
    - `status` (enum ShutdownStatus)
      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"
            }
        }
    ]
}
```

