2017-04-04 16:33:22 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: Status - HTTP API
|
|
|
|
description: |-
|
|
|
|
The /status endpoints return information about the status of the Consul
|
|
|
|
cluster. This information is generally very low level and not often useful for
|
|
|
|
clients.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Status HTTP API
|
|
|
|
|
|
|
|
The `/status` endpoints return information about the status of the Consul
|
|
|
|
cluster. This information is generally very low level and not often useful for
|
|
|
|
clients.
|
|
|
|
|
|
|
|
## Get Raft Leader
|
|
|
|
|
|
|
|
This endpoint returns the Raft leader for the datacenter in which the agent is
|
|
|
|
running.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| :----- | :--------------- | ------------------ |
|
|
|
|
| `GET` | `/status/leader` | `application/json` |
|
2017-04-04 16:33:22 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2023-01-25 16:52:43 +00:00
|
|
|
[blocking queries](/consul/api-docs/features/blocking),
|
|
|
|
[consistency modes](/consul/api-docs/features/consistency),
|
|
|
|
[agent caching](/consul/api-docs/features/caching), and
|
|
|
|
[required ACLs](/consul/api-docs/api-structure#authentication).
|
2017-04-04 16:33:22 +00:00
|
|
|
|
2018-09-06 10:34:28 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `NO` | `none` | `none` | `none` |
|
2017-04-04 16:33:22 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2019-07-25 18:26:22 +00:00
|
|
|
|
|
|
|
- `dc` `(string: "")` - Specifies the datacenter to query. This will default to
|
2022-05-10 15:51:11 +00:00
|
|
|
the datacenter of the agent being queried.
|
2019-07-25 18:26:22 +00:00
|
|
|
|
2017-04-04 16:33:22 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-08-28 16:07:15 +00:00
|
|
|
$ curl http://127.0.0.1:8500/v1/status/leader
|
2017-04-04 16:33:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
"10.1.10.12:8300"
|
|
|
|
```
|
|
|
|
|
|
|
|
## List Raft Peers
|
|
|
|
|
2023-07-31 17:56:09 +00:00
|
|
|
This endpoint retrieves the Raft peers for the datacenter in which the agent
|
2017-04-04 16:33:22 +00:00
|
|
|
is running. This list of peers is strongly consistent and can be useful in
|
|
|
|
determining when a given server has successfully joined the cluster.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| :----- | :-------------- | ------------------ |
|
|
|
|
| `GET` | `/status/peers` | `application/json` |
|
2017-04-04 16:33:22 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2023-01-25 16:52:43 +00:00
|
|
|
[blocking queries](/consul/api-docs/features/blocking),
|
|
|
|
[consistency modes](/consul/api-docs/features/consistency),
|
|
|
|
[agent caching](/consul/api-docs/features/caching), and
|
|
|
|
[required ACLs](/consul/api-docs/api-structure#authentication).
|
2017-04-04 16:33:22 +00:00
|
|
|
|
2018-09-06 10:34:28 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `NO` | `none` | `none` | `none` |
|
2017-04-04 16:33:22 +00:00
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul operator raft list-peers`](/consul/commands/operator/raft#list-peers).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2019-07-25 18:26:22 +00:00
|
|
|
|
|
|
|
- `dc` `(string: "")` - Specifies the datacenter to query. This will default to
|
2022-05-10 15:51:11 +00:00
|
|
|
the datacenter of the agent being queried.
|
2019-07-25 18:26:22 +00:00
|
|
|
|
2017-04-04 16:33:22 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-08-28 16:07:15 +00:00
|
|
|
$ curl http://127.0.0.1:8500/v1/status/peers
|
2017-04-04 16:33:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
2020-04-06 20:27:35 +00:00
|
|
|
["10.1.10.12:8300", "10.1.10.11:8300", "10.1.10.10:8300"]
|
2017-04-04 16:33:22 +00:00
|
|
|
```
|