Migrate status APIs

This commit is contained in:
Seth Vargo
2017-05-26 19:17:33 -04:00
parent 6d44b632d4
commit 10fbdc5203
2 changed files with 73 additions and 77 deletions

View File

@@ -0,0 +1,73 @@
---
layout: api
page_title: Status - HTTP API
sidebar_current: api-status
description: |-
The /status endpoints query the Nomad system status.
---
# Status HTTP API
The `/status` endpoints query the Nomad system status.
## Read Leader
This endpoint returns the address of the current leader in the region.
| Method | Path | Produces |
| ------ | ---------------------------- | -------------------------- |
| `GET` | `/status/leader` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/api/index.html#blocking-queries),
[consistency modes](/api/index.html#consistency-modes), and
[required ACLs](/api/index.html#acls).
| Blocking Queries | Consistency Modes | ACL Required |
| ---------------- | ----------------- | ------------ |
| `NO` | `all` | `none` |
### Sample Request
```text
$ curl \
https://nomad.rocks/v1/status/leader
```
### Sample Response
```json
"127.0.0.1:4647"
```
## List Peers
This endpoint returns the set of raft peers in the region.
| Method | Path | Produces |
| ------ | ---------------------------- | -------------------------- |
| `GET` | `/status/peers` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/api/index.html#blocking-queries),
[consistency modes](/api/index.html#consistency-modes), and
[required ACLs](/api/index.html#acls).
| Blocking Queries | Consistency Modes | ACL Required |
| ---------------- | ----------------- | ------------ |
| `NO` | `all` | `none` |
### Sample Request
```text
$ curl \
https://nomad.rocks/v1/status/peers
```
### Sample Response
```json
[
"127.0.0.1:4647"
]
```

View File

@@ -1,77 +0,0 @@
---
layout: "http"
page_title: "HTTP API: /v1/status/"
sidebar_current: "docs-http-status"
description: |-
The '/1/status/' endpoints are used to query the system status.
---
# /v1/status/leader
By default, the agent's local region is used; another region can
be specified using the `?region=` query parameter.
## GET
<dl>
<dt>Description</dt>
<dd>
Returns the address of the current leader in the region.
</dd>
<dt>Method</dt>
<dd>GET</dd>
<dt>URL</dt>
<dd>`/v1/status/leader`</dd>
<dt>Parameters</dt>
<dd>
None
</dd>
<dt>Returns</dt>
<dd>
```javascript
"127.0.0.1:4647"
```
</dd>
</dl>
# /v1/status/peers
## GET
<dl>
<dt>Description</dt>
<dd>
Returns the set of raft peers in the region.
</dd>
<dt>Method</dt>
<dd>GET</dd>
<dt>URL</dt>
<dd>`/v1/status/peers`</dd>
<dt>Parameters</dt>
<dd>
None
</dd>
<dt>Returns</dt>
<dd>
```javascript
[
"127.0.0.1:4647",
...
]
```
</dd>
</dl>