Merge pull request #4427 from hashicorp/connect-api-docs

Add /health/connect to docs and make consistent with /catalog/connect
This commit is contained in:
Paul Banks 2018-07-20 21:24:57 +01:00 committed by GitHub
commit f8d61976cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 62 deletions

View File

@ -500,67 +500,8 @@ so this endpoint may be used to filter only the Connect-capable endpoints.
| ------ | ---------------------------- | -------------------------- | | ------ | ---------------------------- | -------------------------- |
| `GET` | `/catalog/connect/:service` | `application/json` | | `GET` | `/catalog/connect/:service` | `application/json` |
The table below shows this endpoint's support for Parameters and response format are the same as
[blocking queries](/api/index.html#blocking-queries), [`/catalog/service/:service`](/api/catalog.html#list-nodes-for-service).
[consistency modes](/api/index.html#consistency-modes), and
[required ACLs](/api/index.html#acls).
| Blocking Queries | Consistency Modes | ACL Required |
| ---------------- | ----------------- | ------------------------ |
| `YES` | `all` | `node:read,service:read` |
### Parameters
- `service` `(string: <required>)` - Specifies the name of the service for which
to list nodes. This is specified as part of the URL.
- `dc` `(string: "")` - Specifies the datacenter to query. This will default to
the datacenter of the agent being queried. This is specified as part of the
URL as a query parameter.
### Sample Request
```text
$ curl \
https://consul.rocks/v1/catalog/connect/my-service
```
### Sample Response
```json
[
{
"ID": "40e4a748-2192-161a-0510-9bf59fe950b5",
"Node": "foobar",
"Address": "192.168.10.10",
"Datacenter": "dc1",
"TaggedAddresses": {
"lan": "192.168.10.10",
"wan": "10.0.10.10"
},
"NodeMeta": {
"somekey": "somevalue"
},
"CreateIndex": 51,
"ModifyIndex": 51,
"ServiceAddress": "172.17.0.3",
"ServiceEnableTagOverride": false,
"ServiceID": "32a2a47f7992:nodea:5000",
"ServiceName": "foobar",
"ServiceKind": "connect-proxy",
"ServiceProxyDestination": "my-service",
"ServicePort": 5000,
"ServiceMeta": {
"foobar_meta_value": "baz"
},
"ServiceTags": [
"tacos"
]
}
]
```
The fields are the same as listing nodes for a service.
## List Services for Node ## List Services for Node

View File

@ -249,6 +249,21 @@ $ curl \
] ]
``` ```
## List Nodes for Connect-capable Service
This endpoint returns the nodes providing a
[Connect-capable](/docs/connect/index.html) service in a given datacenter.
This will include both proxies and native integrations. A service may
register both Connect-capable and incapable services at the same time,
so this endpoint may be used to filter only the Connect-capable endpoints.
| Method | Path | Produces |
| ------ | ---------------------------- | -------------------------- |
| `GET` | `/health/connect/:service` | `application/json` |
Parameters and response format are the same as
[`/health/service/:service`](/api/health.html#list-nodes-for-service).
## List Checks in State ## List Checks in State
This endpoint returns the checks in the state provided on the path. This endpoint returns the checks in the state provided on the path.
@ -317,7 +332,7 @@ $ curl \
"Output": "", "Output": "",
"ServiceID": "redis", "ServiceID": "redis",
"ServiceName": "redis", "ServiceName": "redis",
"ServiceTags": ["primary"] "ServiceTags": ["primary"]
} }
] ]
``` ```