Evaluations HTTP API
The /evaluation
endpoints are used to query for and interact with evaluations.
List Evaluations
This endpoint lists all evaluations.
Method | Path | Produces |
---|---|---|
GET | /v1/evaluations | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | namespace:read-job |
Parameters
prefix
(string: "")
- Specifies a string to filter evaluations based on an ID prefix. Because the value is decoded to bytes, the prefix must have an even number of hexadecimal characters (0-9a-f). This is specified as a query string parameter and is used before anyfilter
expression is applied.next_token
(string: "")
- This endpoint supports paging. Thenext_token
parameter accepts a string which is theID
field of the next expected evaluation. This value can be obtained from theX-Nomad-NextToken
header from the previous response.per_page
(int: 0)
- Specifies a maximum number of evaluations to return for this request. If omitted, the response is not paginated. TheID
of the last evaluation in the response can be used as thelast_token
of the next request to fetch additional pages.filter
(string: "")
- Specifies the expression used to filter the results. Consider using pagination or a query parameter to reduce resource used to serve the request.job
(string: "")
- Filter the list of evaluations to a specific job ID.status
(string: "")
- Filter the list of evaluations to a specific evaluation status (one ofblocked
,pending
,complete
,failed
, orcanceled
).namespace
(string: "default")
- Specifies the target namespace. Specifying*
will return all evaluations across all authorized namespaces. This parameter is used before anyfilter
expression is applied.reverse
(bool: false)
- Specifies the list of returned evaluations should be sorted in the reverse order. By default evaluations are returned sorted in chronological order (older evaluations first), or in lexicographical order by their ID if theprefix
query parameter is used.
Sample Request
Sample Response
Read Evaluation
This endpoint reads information about a specific evaluation by ID.
Method | Path | Produces |
---|---|---|
GET | /v1/evaluation/:eval_id | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | namespace:read-job |
Parameters
:eval_id
(string: <required>)
- Specifies the UUID of the evaluation. This must be the full UUID, not the short 8-character one. This is specified as part of the path.related
(bool: false)
- Specifies if related evaluations should be returned. Related evaluations are the ones that can be reached by following the trail of IDs forNextEval
,PreviousEval
, andBlockedEval
. This is specified as a query parameter.
Sample Request
Sample Response
Delete Evaluations
This endpoint deletes evaluations. In order to utilise this endpoint the eval broker should be paused via the operator scheduler update configuration API endpoint.
This API endpoint should be used cautiously and only in outage situations where there is a large backlog of evaluations not being processed. During most normal and outage scenarios, Nomad's reconciliation and state management will handle evaluations as needed.
Method | Path | Produces |
---|---|---|
DELETE | /v1/evaluations | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | management |
Parameters
EvalIDs
(array<string>: <required>)
- An array of evaluation UUIDs to delete. This must be a full length UUID and not a prefix.
Sample Payload
Sample Request
List Allocations for Evaluation
This endpoint lists the allocations created or modified for the given evaluation.
Method | Path | Produces |
---|---|---|
GET | /v1/evaluation/:eval_id/allocations | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | namespace:read-job |
Parameters
:eval_id
(string: <required>)
- Specifies the UUID of the evaluation. This must be the full UUID, not the short 8-character one. This is specified as part of the path.
Sample Request
Sample Response
Count Evaluations
This endpoint counts evaluations. Note that Nomad's state store architecture
makes calculating this count unexpectedly expensive (similar in cost to the List
API), and this API was designed for use during recovery operations with the
nomad eval delete
command. It is not recommended to use this API for
monitoring. The nomad.nomad.broker.*
metrics are better for that use
case. See the metrics reference for details.
Method | Path | Produces |
---|---|---|
GET | /v1/evaluations/count | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | namespace:read-job |
Parameters
prefix
(string: "")
- Specifies a string to filter evaluations based on an ID prefix. Because the value is decoded to bytes, the prefix must have an even number of hexadecimal characters (0-9a-f). This is specified as a query string parameter and is used before anyfilter
expression is applied.filter
(string: "")
- Specifies the expression used to filter the results.namespace
(string: "default")
- Specifies the target namespace. Specifying*
will return all evaluations across all authorized namespaces. This parameter is used before anyfilter
expression is applied.
Sample Request
Sample Response