github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/api-docs/evaluations.mdx (about)

     1  ---
     2  layout: api
     3  page_title: Evaluations - HTTP API
     4  sidebar_title: Evaluations
     5  description: The /evaluation are used to query for and interact with evaluations.
     6  ---
     7  
     8  # Evaluations HTTP API
     9  
    10  The `/evaluation` endpoints are used to query for and interact with evaluations.
    11  
    12  ## List Evaluations
    13  
    14  This endpoint lists all evaluations.
    15  
    16  | Method | Path              | Produces           |
    17  | ------ | ----------------- | ------------------ |
    18  | `GET`  | `/v1/evaluations` | `application/json` |
    19  
    20  The table below shows this endpoint's support for
    21  [blocking queries](/api-docs#blocking-queries) and
    22  [required ACLs](/api-docs#acls).
    23  
    24  | Blocking Queries | ACL Required         |
    25  | ---------------- | -------------------- |
    26  | `YES`            | `namespace:read-job` |
    27  
    28  ### Parameters
    29  
    30  - `prefix` `(string: "")`- Specifies a string to filter evaluations based on an
    31    ID prefix. Because the value is decoded to bytes, the prefix must have an
    32    even number of hexadecimal characters (0-9a-f). This is specified as a query
    33    string parameter.
    34  
    35  ### Sample Request
    36  
    37  ```shell-session
    38  $ curl \
    39      https://localhost:4646/v1/evaluations
    40  ```
    41  
    42  ```shell-session
    43  $ curl \
    44      https://localhost:4646/v1/evaluations?prefix=25ba81
    45  ```
    46  
    47  ### Sample Response
    48  
    49  ```json
    50  [
    51    {
    52      "ID": "5456bd7a-9fc0-c0dd-6131-cbee77f57577",
    53      "Priority": 50,
    54      "Type": "service",
    55      "TriggeredBy": "job-register",
    56      "JobID": "example",
    57      "JobModifyIndex": 52,
    58      "NodeID": "",
    59      "NodeModifyIndex": 0,
    60      "Status": "complete",
    61      "StatusDescription": "",
    62      "Wait": 0,
    63      "NextEval": "",
    64      "PreviousEval": "",
    65      "BlockedEval": "",
    66      "FailedTGAllocs": null,
    67      "ClassEligibility": null,
    68      "EscapedComputedClass": false,
    69      "AnnotatePlan": false,
    70      "SnapshotIndex": 53,
    71      "QueuedAllocations": {
    72        "cache": 0
    73      },
    74      "CreateIndex": 53,
    75      "ModifyIndex": 55
    76    }
    77  ]
    78  ```
    79  
    80  ## Read Evaluation
    81  
    82  This endpoint reads information about a specific evaluation by ID.
    83  
    84  | Method | Path                      | Produces           |
    85  | ------ | ------------------------- | ------------------ |
    86  | `GET`  | `/v1/evaluation/:eval_id` | `application/json` |
    87  
    88  The table below shows this endpoint's support for
    89  [blocking queries](/api-docs#blocking-queries) and
    90  [required ACLs](/api-docs#acls).
    91  
    92  | Blocking Queries | ACL Required         |
    93  | ---------------- | -------------------- |
    94  | `YES`            | `namespace:read-job` |
    95  
    96  ### Parameters
    97  
    98  - `:eval_id` `(string: <required>)`- Specifies the UUID of the evaluation. This
    99    must be the full UUID, not the short 8-character one. This is specified as
   100    part of the path.
   101  
   102  ### Sample Request
   103  
   104  ```shell-session
   105  $ curl \
   106      https://localhost:4646/v1/evaluation/5456bd7a-9fc0-c0dd-6131-cbee77f57577
   107  ```
   108  
   109  ### Sample Response
   110  
   111  ```json
   112  {
   113    "ID": "5456bd7a-9fc0-c0dd-6131-cbee77f57577",
   114    "Priority": 50,
   115    "Type": "service",
   116    "TriggeredBy": "job-register",
   117    "JobID": "example",
   118    "JobModifyIndex": 52,
   119    "NodeID": "",
   120    "NodeModifyIndex": 0,
   121    "Status": "complete",
   122    "StatusDescription": "",
   123    "Wait": 0,
   124    "NextEval": "",
   125    "PreviousEval": "",
   126    "BlockedEval": "",
   127    "FailedTGAllocs": null,
   128    "ClassEligibility": null,
   129    "EscapedComputedClass": false,
   130    "AnnotatePlan": false,
   131    "SnapshotIndex": 53,
   132    "QueuedAllocations": {
   133      "cache": 0
   134    },
   135    "CreateIndex": 53,
   136    "ModifyIndex": 55
   137  }
   138  ```
   139  
   140  ## List Allocations for Evaluation
   141  
   142  This endpoint lists the allocations created or modified for the given
   143  evaluation.
   144  
   145  | Method | Path                                  | Produces           |
   146  | ------ | ------------------------------------- | ------------------ |
   147  | `GET`  | `/v1/evaluation/:eval_id/allocations` | `application/json` |
   148  
   149  The table below shows this endpoint's support for
   150  [blocking queries](/api-docs#blocking-queries) and
   151  [required ACLs](/api-docs#acls).
   152  
   153  | Blocking Queries | ACL Required         |
   154  | ---------------- | -------------------- |
   155  | `YES`            | `namespace:read-job` |
   156  
   157  ### Parameters
   158  
   159  - `:eval_id` `(string: <required>)`- Specifies the UUID of the evaluation. This
   160    must be the full UUID, not the short 8-character one. This is specified as
   161    part of the path.
   162  
   163  ### Sample Request
   164  
   165  ```shell-session
   166  $ curl \
   167      https://localhost:4646/v1/evaluation/5456bd7a-9fc0-c0dd-6131-cbee77f57577/allocations
   168  ```
   169  
   170  ### Sample Response
   171  
   172  ```json
   173  [
   174    {
   175      "ID": "a8198d79-cfdb-6593-a999-1e9adabcba2e",
   176      "EvalID": "5456bd7a-9fc0-c0dd-6131-cbee77f57577",
   177      "Name": "example.cache[0]",
   178      "NodeID": "fb2170a8-257d-3c64-b14d-bc06cc94e34c",
   179      "JobID": "example",
   180      "TaskGroup": "cache",
   181      "DesiredStatus": "run",
   182      "DesiredDescription": "",
   183      "ClientStatus": "running",
   184      "ClientDescription": "",
   185      "TaskStates": {
   186        "redis": {
   187          "State": "running",
   188          "Failed": false,
   189          "Events": [
   190            {
   191              "Type": "Received",
   192              "Time": 1495747371795703800,
   193              "FailsTask": false,
   194              "RestartReason": "",
   195              "SetupError": "",
   196              "DriverError": "",
   197              "ExitCode": 0,
   198              "Signal": 0,
   199              "Message": "",
   200              "KillTimeout": 0,
   201              "KillError": "",
   202              "KillReason": "",
   203              "StartDelay": 0,
   204              "DownloadError": "",
   205              "ValidationError": "",
   206              "DiskLimit": 0,
   207              "FailedSibling": "",
   208              "VaultError": "",
   209              "TaskSignalReason": "",
   210              "TaskSignal": "",
   211              "DriverMessage": ""
   212            },
   213            {
   214              "Type": "Driver",
   215              "Time": 1495747371798867200,
   216              "FailsTask": false,
   217              "RestartReason": "",
   218              "SetupError": "",
   219              "DriverError": "",
   220              "ExitCode": 0,
   221              "Signal": 0,
   222              "Message": "",
   223              "KillTimeout": 0,
   224              "KillError": "",
   225              "KillReason": "",
   226              "StartDelay": 0,
   227              "DownloadError": "",
   228              "ValidationError": "",
   229              "DiskLimit": 0,
   230              "FailedSibling": "",
   231              "VaultError": "",
   232              "TaskSignalReason": "",
   233              "TaskSignal": "",
   234              "DriverMessage": "Downloading image redis:3.2"
   235            },
   236            {
   237              "Type": "Started",
   238              "Time": 1495747379525667800,
   239              "FailsTask": false,
   240              "RestartReason": "",
   241              "SetupError": "",
   242              "DriverError": "",
   243              "ExitCode": 0,
   244              "Signal": 0,
   245              "Message": "",
   246              "KillTimeout": 0,
   247              "KillError": "",
   248              "KillReason": "",
   249              "StartDelay": 0,
   250              "DownloadError": "",
   251              "ValidationError": "",
   252              "DiskLimit": 0,
   253              "FailedSibling": "",
   254              "VaultError": "",
   255              "TaskSignalReason": "",
   256              "TaskSignal": "",
   257              "DriverMessage": ""
   258            }
   259          ]
   260        }
   261      },
   262      "CreateIndex": 54,
   263      "ModifyIndex": 57,
   264      "CreateTime": 1495747371794276400
   265    }
   266  ]
   267  ```