Recommendation HTTP API
The /recommendation endpoints are used to query and interact with Dynamic
Application Sizing recommendations.
Enterprise
This feature requires Nomad Enterprise(opens in new tab).
List Recommendations
This endpoint lists all the currently available recommendations and provides optional filtering of that list.
| Method | Path | Produces |
|---|---|---|
GET | /v1/recommendations | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
| Blocking Queries | ACL Required |
|---|---|
YES | namespace:read-job or namespace:submit-recommendation or namespace:submit-job |
Parameters
group(string: "")- Specifies the task group name to filter within a job. If specified, thejobparameter must also be specified.job(string: "")- Specifies the job ID to filter the recommendations list by.namespace(string: "default")- Specifies the namespace to search. Specifying*would return all recommendations across all the authorized namespaces.task(string: "")- Specifies the task name to filter within a job and task group. If specified, thejobandgroupquery parameters must also be specified.
Sample Request
$ curl \
https://localhost:4646/v1/recommendations
$ curl \
https://localhost:4646/v1/recommendations?namespace=*
$ curl \
https://localhost:4646/v1/recommendations?namespace=*&job=example&group=cache&task=redis
Sample Response
[
{
"ID": "cb80a13d-20d8-fb05-db3f-4ea0fe667b1b",
"Region": "global",
"Namespace": "default",
"JobID": "example",
"JobVersion": 0,
"Group": "cache",
"Task": "redis",
"Resource": "MemoryMB",
"Value": 10,
"Current": 200,
"Meta": {
"nomad_autoscaler.count.capped": true,
"nomad_autoscaler.count.original": 6,
"nomad_autoscaler.reason_history": [],
"nomad_policy_id": "c355d0ec-7aa1-2604-449d-4ec79c813d2c",
"num_evaluated_windows": 1148,
"window_size": 300000000000
},
"Stats": {
"min": 2.6640625,
"p99": 6.51171875,
"max": 6.515625,
"mean": 4.816847859995009
},
"EnforceVersion": false,
"SubmitTime": 1603372587714807000,
"CreateIndex": 5193,
"ModifyIndex": 10437
},
{
"ID": "fdd2b5f1-e6ad-110e-75b9-8f9410e1d8ab",
"Region": "global",
"Namespace": "default",
"JobID": "example",
"JobVersion": 0,
"Group": "cache",
"Task": "redis",
"Resource": "CPU",
"Value": 57