mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 14:24:39 +00:00
c1bf14be30
By default, the Consul agent listens on the local interface at port 8500 for API requests. This change makes the API examples using `curl` copy-pasteable for this default configuration.
2.2 KiB
2.2 KiB
layout | page_title | sidebar_current | description |
---|---|---|---|
api | Status - HTTP API | api-status | 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.
Method | Path | Produces |
---|---|---|
GET |
/status/leader |
application/json |
The table below shows this endpoint's support for blocking queries, consistency modes, and required ACLs.
Blocking Queries | Consistency Modes | ACL Required |
---|---|---|
NO |
none |
none |
Sample Request
$ curl http://127.0.0.1:8500/v1/status/leader
Sample Response
"10.1.10.12:8300"
List Raft Peers
This endpoint retrieves the Raft peers for the datacenter in which the the agent is running. This list of peers is strongly consistent and can be useful in determining when a given server has successfully joined the cluster.
Method | Path | Produces |
---|---|---|
GET |
/status/peers |
application/json |
The table below shows this endpoint's support for blocking queries, consistency modes, and required ACLs.
Blocking Queries | Consistency Modes | ACL Required |
---|---|---|
NO |
none |
none |
Sample Request
$ curl http://127.0.0.1:8500/v1/status/peers
Sample Response
[
"10.1.10.12:8300",
"10.1.10.11:8300",
"10.1.10.10:8300"
]