backport of commit 1e73a8a6991214fb57afa37de425dd7b0e765623 (#18089)

This pull request was automerged via backport-assistant
This commit is contained in:
hc-github-team-nomad-core 2023-07-28 02:49:50 -05:00 committed by GitHub
parent b8cb1e79a3
commit 77d1f188c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 0 deletions

View File

@ -912,4 +912,50 @@ $ curl \
]
```
## Allocation Checks
The endpoint is used to read all health checks registered within Nomad belonging
to the passed allocation ID.
| Method | Path | Produces |
| ------ | ------------------------------ | ------------------ |
| `GET` | `/allocation/:alloc_id/checks` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/nomad/api-docs#blocking-queries), [consistency modes](/nomad/api-docs#consistency-modes) and
[required ACLs](/nomad/api-docs#acls).
| Blocking Queries | ACL Required |
| ---------------- | --------------------- |
| `NO` | `namespace:read-job`` |
### Parameters
- `:alloc_id` `(string: <required>)` - Specifies the allocation ID. This is
specified as part of the path.
### Sample Request
```shell-session
$ curl \
https://localhost:4646/v1/allocation/177160af-26f6-619f-9c9f-5e46d1104395/checks
```
### Sample Response
```json
{
"a1ed96606694742bf201a640a607e306": {
"Check": "redis_probe",
"Group": "example.cache[0]",
"ID": "a1ed96606694742bf201a640a607e306",
"Mode": "healthiness",
"Output": "nomad: tcp ok",
"Service": "redis",
"Status": "success",
"Timestamp": 1690442203
}
}
```
[`shutdown_delay`]: /nomad/docs/job-specification/group#shutdown_delay