github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/website/source/api/jobs.html.md (about)

     1  ---
     2  layout: api
     3  page_title: Jobs - HTTP API
     4  sidebar_current: api-jobs
     5  description: |-
     6    The /jobs endpoints are used to query for and interact with jobs.
     7  ---
     8  
     9  # Jobs HTTP API
    10  
    11  The `/jobs` endpoints are used to query for and interact with jobs.
    12  
    13  ## List Jobs
    14  
    15  This endpoint lists all known jobs in the system registered with Nomad.
    16  
    17  | Method | Path                      | Produces                   |
    18  | ------ | ------------------------- | -------------------------- |
    19  | `GET`  | `/v1/jobs`                | `application/json`         |
    20  
    21  The table below shows this endpoint's support for
    22  [blocking queries](/api/index.html#blocking-queries) and
    23  [required ACLs](/api/index.html#acls).
    24  
    25  | Blocking Queries | ACL Required                |
    26  | ---------------- | --------------------------- |
    27  | `YES`            | `namespace:list-jobs`       |
    28  
    29  ### Parameters
    30  
    31  - `prefix` `(string: "")` - Specifies a string to filter jobs on based on
    32    an index prefix. This is specified as a query string parameter.
    33  
    34  ### Sample Request
    35  
    36  ```text
    37  $ curl \
    38      https://localhost:4646/v1/jobs
    39  ```
    40  
    41  ```text
    42  $ curl \
    43      https://localhost:4646/v1/jobs?prefix=team
    44  ```
    45  
    46  ### Sample Response
    47  
    48  ```json
    49  [
    50    {
    51      "ID": "example",
    52      "ParentID": "",
    53      "Name": "example",
    54      "Type": "service",
    55      "Priority": 50,
    56      "Status": "pending",
    57      "StatusDescription": "",
    58      "JobSummary": {
    59        "JobID": "example",
    60        "Summary": {
    61          "cache": {
    62            "Queued": 1,
    63            "Complete": 1,
    64            "Failed": 0,
    65            "Running": 0,
    66            "Starting": 0,
    67            "Lost": 0
    68          }
    69        },
    70        "Children": {
    71          "Pending": 0,
    72          "Running": 0,
    73          "Dead": 0
    74        },
    75        "CreateIndex": 52,
    76        "ModifyIndex": 96
    77      },
    78      "CreateIndex": 52,
    79      "ModifyIndex": 93,
    80      "JobModifyIndex": 52
    81    }
    82  ]
    83  ```
    84  
    85  ## Create Job
    86  
    87  This endpoint creates (aka "registers") a new job in the system.
    88  
    89  | Method  | Path                      | Produces                   |
    90  | ------- | ------------------------- | -------------------------- |
    91  | `POST`  | `/v1/jobs`                | `application/json`         |
    92  
    93  The table below shows this endpoint's support for
    94  [blocking queries](/api/index.html#blocking-queries) and
    95  [required ACLs](/api/index.html#acls).
    96  
    97  | Blocking Queries | ACL Required |
    98  | ---------------- | ------------ |
    99  | `NO`             | `namespace:submit-job`<br>`namespace:sentinel-override` if `PolicyOverride` set |
   100  
   101  ### Parameters
   102  
   103  - `Job` `(Job: <required>)` - Specifies the JSON definition of the job.
   104  
   105  - `EnforceIndex` `(bool: false)` - If set, the job will only be registered if the
   106    passed `JobModifyIndex` matches the current job's index. If the index is zero,
   107    the register only occurs if the job is new. This paradigm allows check-and-set
   108    style job updating.
   109  
   110  - `JobModifyIndex` `(int: 0)` - Specifies the `JobModifyIndex` to enforce the
   111    current job is at.
   112  
   113  - `PolicyOverride` `(bool: false)` - If set, any soft mandatory Sentinel policies
   114    will be overridden. This allows a job to be registered when it would be denied
   115    by policy.
   116  
   117  ### Sample Payload
   118  
   119  ```json
   120  {
   121      "Job": {
   122          "ID": "example",
   123          "Name": "example",
   124          "Type": "service",
   125          "Priority": 50,
   126          "Datacenters": [
   127              "dc1"
   128          ],
   129          "TaskGroups": [{
   130              "Name": "cache",
   131              "Count": 1,
   132              "Tasks": [{
   133                  "Name": "redis",
   134                  "Driver": "docker",
   135                  "User": "",
   136                  "Config": {
   137                      "image": "redis:3.2",
   138                      "port_map": [{
   139                          "db": 6379
   140                      }]
   141                  },
   142                  "Services": [{
   143                      "Id": "",
   144                      "Name": "redis-cache",
   145                      "Tags": [
   146                          "global",
   147                          "cache"
   148                      ],
   149                      "PortLabel": "db",
   150                      "AddressMode": "",
   151                      "Checks": [{
   152                          "Id": "",
   153                          "Name": "alive",
   154                          "Type": "tcp",
   155                          "Command": "",
   156                          "Args": null,
   157                          "Path": "",
   158                          "Protocol": "",
   159                          "PortLabel": "",
   160                          "Interval": 10000000000,
   161                          "Timeout": 2000000000,
   162                          "InitialStatus": "",
   163                          "TLSSkipVerify": false
   164                      }]
   165                  }],
   166                  "Resources": {
   167                      "CPU": 500,
   168                      "MemoryMB": 256,
   169                      "Networks": [{
   170                          "Device": "",
   171                          "CIDR": "",
   172                          "IP": "",
   173                          "MBits": 10,
   174                          "DynamicPorts": [{
   175                              "Label": "db",
   176                              "Value": 0
   177                          }]
   178                      }]
   179                  },
   180                  "Leader": false
   181              }],
   182              "RestartPolicy": {
   183                  "Interval": 300000000000,
   184                  "Attempts": 10,
   185                  "Delay": 25000000000,
   186                  "Mode": "delay"
   187              },
   188              "ReschedulePolicy": {
   189                  "Attempts": 10,
   190                  "Delay": 30000000000,
   191                  "DelayFunction": "exponential",
   192                  "Interval": 36000000000000,
   193                  "MaxDelay": 3600000000000,
   194                  "Unlimited": false
   195              },
   196              "EphemeralDisk": {
   197                  "SizeMB": 300
   198              }
   199          }],
   200          "Update": {
   201              "MaxParallel": 1,
   202              "MinHealthyTime": 10000000000,
   203              "HealthyDeadline": 180000000000,
   204              "AutoRevert": false,
   205              "Canary": 0
   206          }
   207      }
   208  }
   209  ```
   210  
   211  ### Sample Request
   212  
   213  ```text
   214  $ curl \
   215      --request POST \
   216      --data @my-job.json \
   217      https://localhost:4646/v1/jobs
   218  ```
   219  
   220  ### Sample Response
   221  
   222  ```json
   223  {
   224    "EvalID": "",
   225    "EvalCreateIndex": 0,
   226    "JobModifyIndex": 109,
   227    "Warnings": "",
   228    "Index": 0,
   229    "LastContact": 0,
   230    "KnownLeader": false
   231  }
   232  ```
   233  
   234  ## Parse Job
   235  
   236  This endpoint will parse a HCL jobspec and produce the equivalent JSON encoded
   237  job.
   238  
   239  | Method | Path                      | Produces                   |
   240  | ------ | ------------------------- | -------------------------- |
   241  | `POST` | `/v1/jobs/parse`          | `application/json`         |
   242  
   243  The table below shows this endpoint's support for
   244  [blocking queries](/api/index.html#blocking-queries) and
   245  [required ACLs](/api/index.html#acls).
   246  
   247  | Blocking Queries | ACL Required |
   248  | ---------------- | ------------ |
   249  | `NO`             | `none`       |
   250  
   251  ### Parameters
   252  
   253  - `JobHCL` `(string: <required>)` - Specifies the HCL definition of the job
   254    encoded in a JSON string.
   255  - `Canonicalize` `(bool: false)` - Flag to enable setting any unset fields to
   256    their default values.
   257  
   258  ## Sample Payload
   259  
   260  ```json
   261  {
   262      "JobHCL":"job \"example\" { type = \"service\" group \"cache\" {} }",
   263      "Canonicalize": true
   264  }
   265  ```
   266  
   267  ### Sample Request
   268  
   269  ```text
   270  $ curl \
   271      --request POST \
   272      --data '{"Canonicalize": true, "JobHCL": "job \"my-job\" {}"}' \
   273      https://localhost:4646/v1/jobs/parse
   274  ```
   275  
   276  ### Sample Response
   277  
   278  ```json
   279  {
   280      "AllAtOnce": false,
   281      "Constraints": null,
   282      "Affinities":null,
   283      "CreateIndex": 0,
   284      "Datacenters": null,
   285      "ID": "my-job",
   286      "JobModifyIndex": 0,
   287      "Meta": null,
   288      "Migrate": null,
   289      "ModifyIndex": 0,
   290      "Name": "my-job",
   291      "Namespace": "default",
   292      "ParameterizedJob": null,
   293      "ParentID": "",
   294      "Payload": null,
   295      "Periodic": null,
   296      "Priority": 50,
   297      "Region": "global",
   298      "Reschedule": null,
   299      "Stable": false,
   300      "Status": "",
   301      "StatusDescription": "",
   302      "Stop": false,
   303      "SubmitTime": null,
   304      "TaskGroups": null,
   305      "Type": "service",
   306      "Update": null,
   307      "VaultToken": "",
   308      "Version": 0
   309  }
   310  ```
   311  
   312  ## Read Job
   313  
   314  This endpoint reads information about a single job for its specification and
   315  status.
   316  
   317  | Method | Path                      | Produces                   |
   318  | ------ | ------------------------- | -------------------------- |
   319  | `GET`  | `/v1/job/:job_id`         | `application/json`         |
   320  
   321  The table below shows this endpoint's support for
   322  [blocking queries](/api/index.html#blocking-queries) and
   323  [required ACLs](/api/index.html#acls).
   324  
   325  | Blocking Queries | ACL Required               |
   326  | ---------------- | -------------------------- |
   327  | `YES`            | `namespace:read-job`       |
   328  
   329  ### Parameters
   330  
   331  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
   332    the job file during submission). This is specified as part of the path.
   333  
   334  ### Sample Request
   335  
   336  ```text
   337  $ curl \
   338      https://localhost:4646/v1/job/my-job
   339  ```
   340  
   341  ### Sample Response
   342  
   343  ```json
   344  {
   345    "Region": "global",
   346    "ID": "example",
   347    "ParentID": "",
   348    "Name": "example",
   349    "Type": "batch",
   350    "Priority": 50,
   351    "AllAtOnce": false,
   352    "Datacenters": [
   353      "dc1"
   354    ],
   355    "Constraints": [
   356      {
   357        "LTarget": "${attr.kernel.name}",
   358        "RTarget": "linux",
   359        "Operand": "="
   360      }
   361    ],
   362    "TaskGroups": [
   363      {
   364        "Name": "cache",
   365        "Count": 1,
   366        "Constraints": [
   367          {
   368            "LTarget": "${attr.os.signals}",
   369            "RTarget": "SIGUSR1",
   370            "Operand": "set_contains"
   371          }
   372        ],
   373        "Affinities": [
   374           {
   375            "LTarget": "${meta.datacenter}",
   376            "RTarget": "dc1",
   377            "Operand": "=",
   378            "Weight": 50,
   379           }
   380         ],
   381        "RestartPolicy": {
   382          "Attempts": 10,
   383          "Interval": 300000000000,
   384          "Delay": 25000000000,
   385          "Mode": "delay"
   386        },
   387        "Tasks": [
   388          {
   389            "Name": "redis",
   390            "Driver": "docker",
   391            "User": "foo-user",
   392            "Config": {
   393              "image": "redis:latest",
   394              "port_map": [
   395                {
   396                  "db": 6379
   397                }
   398              ]
   399            },
   400            "Env": {
   401              "foo": "bar",
   402              "baz": "pipe"
   403            },
   404            "Services": [
   405              {
   406                "Name": "cache-redis",
   407                "PortLabel": "db",
   408                "Tags": [
   409                  "global",
   410                  "cache"
   411                ],
   412                "Checks": [
   413                  {
   414                    "Name": "alive",
   415                    "Type": "tcp",
   416                    "Command": "",
   417                    "Args": null,
   418                    "Path": "",
   419                    "Protocol": "",
   420                    "PortLabel": "",
   421                    "Interval": 10000000000,
   422                    "Timeout": 2000000000,
   423                    "InitialStatus": ""
   424                  }
   425                ]
   426              }
   427            ],
   428            "Vault": null,
   429            "Templates": [
   430              {
   431                "SourcePath": "local/config.conf.tpl",
   432                "DestPath": "local/config.conf",
   433                "EmbeddedTmpl": "",
   434                "ChangeMode": "signal",
   435                "ChangeSignal": "SIGUSR1",
   436                "Splay": 5000000000,
   437                "Perms": ""
   438              }
   439            ],
   440            "Constraints": null,
   441            "Affinities":null,
   442            "Resources": {
   443              "CPU": 500,
   444              "MemoryMB": 256,
   445              "DiskMB": 0,
   446              "Networks": [
   447                {
   448                  "Device": "",
   449                  "CIDR": "",
   450                  "IP": "",
   451                  "MBits": 10,
   452                  "ReservedPorts": [
   453                    {
   454                      "Label": "rpc",
   455                      "Value": 25566
   456                    }
   457                  ],
   458                  "DynamicPorts": [
   459                    {
   460                      "Label": "db",
   461                      "Value": 0
   462                    }
   463                  ]
   464                }
   465              ]
   466            },
   467            "DispatchPayload": {
   468              "File": "config.json"
   469            },
   470            "Meta": {
   471              "foo": "bar",
   472              "baz": "pipe"
   473            },
   474            "KillTimeout": 5000000000,
   475            "LogConfig": {
   476              "MaxFiles": 10,
   477              "MaxFileSizeMB": 10
   478            },
   479            "Artifacts": [
   480              {
   481                "GetterSource": "http://foo.com/artifact.tar.gz",
   482                "GetterOptions": {
   483                  "checksum": "md5:c4aa853ad2215426eb7d70a21922e794"
   484                },
   485                "RelativeDest": "local/"
   486              }
   487            ],
   488            "Leader": false
   489          }
   490        ],
   491        "EphemeralDisk": {
   492          "Sticky": false,
   493          "SizeMB": 300,
   494          "Migrate": false
   495        },
   496        "Meta": {
   497          "foo": "bar",
   498          "baz": "pipe"
   499        }
   500      }
   501    ],
   502    "Update": {
   503      "Stagger": 10000000000,
   504      "MaxParallel": 1
   505    },
   506    "Periodic": {
   507      "Enabled": true,
   508      "Spec": "* * * * *",
   509      "SpecType": "cron",
   510      "ProhibitOverlap": true
   511    },
   512    "ParameterizedJob": {
   513      "Payload": "required",
   514      "MetaRequired": [
   515        "foo"
   516      ],
   517      "MetaOptional": [
   518        "bar"
   519      ]
   520    },
   521    "Payload": null,
   522    "Meta": {
   523      "foo": "bar",
   524      "baz": "pipe"
   525    },
   526    "VaultToken": "",
   527    "Status": "running",
   528    "StatusDescription": "",
   529    "CreateIndex": 7,
   530    "ModifyIndex": 7,
   531    "JobModifyIndex": 7
   532  }
   533  ```
   534  
   535  ## List Job Versions
   536  
   537  This endpoint reads information about all versions of a job.
   538  
   539  | Method | Path                       | Produces                   |
   540  | ------ | -------------------------- | -------------------------- |
   541  | `GET`  | `/v1/job/:job_id/versions` | `application/json`         |
   542  
   543  The table below shows this endpoint's support for
   544  [blocking queries](/api/index.html#blocking-queries) and
   545  [required ACLs](/api/index.html#acls).
   546  
   547  | Blocking Queries | ACL Required               |
   548  | ---------------- | -------------------------- |
   549  | `YES`            | `namespace:read-job`       |
   550  
   551  ### Parameters
   552  
   553  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
   554    the job file during submission). This is specified as part of the path.
   555  
   556  ### Sample Request
   557  
   558  ```text
   559  $ curl \
   560      https://localhost:4646/v1/job/my-job/versions
   561  ```
   562  
   563  ### Sample Response
   564  
   565  ```json
   566  [
   567    {
   568      "Stop": false,
   569      "Region": "global",
   570      "ID": "example",
   571      "ParentID": "",
   572      "Name": "example",
   573      "Type": "service",
   574      "Priority": 50,
   575      "AllAtOnce": false,
   576      "Datacenters": [
   577        "dc1"
   578      ],
   579      "Constraints": null,
   580      "Affinities":null,
   581      "TaskGroups": [
   582        {
   583          "Name": "cache",
   584          "Count": 1,
   585          "Update": {
   586            "Stagger": 0,
   587            "MaxParallel": 1,
   588            "HealthCheck": "checks",
   589            "MinHealthyTime": 10000000000,
   590            "HealthyDeadline": 300000000000,
   591            "AutoRevert": false,
   592            "Canary": 0
   593          },
   594          "Constraints": null,
   595          "Affinities":null,
   596          "RestartPolicy": {
   597            "Attempts": 10,
   598            "Interval": 300000000000,
   599            "Delay": 25000000000,
   600            "Mode": "delay"
   601          },
   602          "Spreads": [
   603             {
   604             "Attribute": "${node.datacenter}",
   605             "SpreadTarget": null,
   606             "Weight": 100
   607             }
   608          ],
   609          "Tasks": [
   610            {
   611              "Name": "redis",
   612              "Driver": "docker",
   613              "User": "",
   614              "Config": {
   615                "image": "redis:3.2",
   616                "port_map": [
   617                  {
   618                    "db": 6379
   619                  }
   620                ]
   621              },
   622              "Env": null,
   623              "Services": [
   624                {
   625                  "Name": "redis-cache",
   626                  "PortLabel": "db",
   627                  "Tags": [
   628                    "global",
   629                    "cache"
   630                  ],
   631                  "Checks": [
   632                    {
   633                      "Name": "alive",
   634                      "Type": "tcp",
   635                      "Command": "",
   636                      "Args": null,
   637                      "Path": "",
   638                      "Protocol": "",
   639                      "PortLabel": "",
   640                      "Interval": 10000000000,
   641                      "Timeout": 2000000000,
   642                      "InitialStatus": "",
   643                      "TLSSkipVerify": false
   644                    }
   645                  ]
   646                }
   647              ],
   648              "Vault": null,
   649              "Templates": null,
   650              "Constraints": null,
   651              "Affinities":null,
   652              "Spreads":null,
   653              "Resources": {
   654                "CPU": 500,
   655                "MemoryMB": 256,
   656                "DiskMB": 0,
   657                "Networks": [
   658                  {
   659                    "Device": "",
   660                    "CIDR": "",
   661                    "IP": "",
   662                    "MBits": 10,
   663                    "ReservedPorts": null,
   664                    "DynamicPorts": [
   665                      {
   666                        "Label": "db",
   667                        "Value": 0
   668                      }
   669                    ]
   670                  }
   671                ]
   672              },
   673              "DispatchPayload": null,
   674              "Meta": null,
   675              "KillTimeout": 5000000000,
   676              "LogConfig": {
   677                "MaxFiles": 10,
   678                "MaxFileSizeMB": 10
   679              },
   680              "Artifacts": null,
   681              "Leader": false
   682            }
   683          ],
   684          "EphemeralDisk": {
   685            "Sticky": false,
   686            "SizeMB": 300,
   687            "Migrate": false
   688          },
   689          "Meta": null
   690        }
   691      ],
   692      "Update": {
   693        "Stagger": 10000000000,
   694        "MaxParallel": 1,
   695        "HealthCheck": "",
   696        "MinHealthyTime": 0,
   697        "HealthyDeadline": 0,
   698        "AutoRevert": false,
   699        "Canary": 0
   700      },
   701      "Periodic": null,
   702      "ParameterizedJob": null,
   703      "Payload": null,
   704      "Meta": null,
   705      "VaultToken": "",
   706      "Spreads": null,
   707      "Status": "pending",
   708      "StatusDescription": "",
   709      "Stable": false,
   710      "Version": 0,
   711      "CreateIndex": 7,
   712      "ModifyIndex": 7,
   713      "JobModifyIndex": 7
   714    }
   715  ]
   716  ```
   717  
   718  ## List Job Allocations
   719  
   720  This endpoint reads information about a single job's allocations.
   721  
   722  | Method | Path                          | Produces                   |
   723  | ------ | ----------------------------- | -------------------------- |
   724  | `GET`  | `/v1/job/:job_id/allocations` | `application/json`         |
   725  
   726  The table below shows this endpoint's support for
   727  [blocking queries](/api/index.html#blocking-queries) and
   728  [required ACLs](/api/index.html#acls).
   729  
   730  | Blocking Queries | ACL Required               |
   731  | ---------------- | -------------------------- |
   732  | `YES`            | `namespace:read-job`       |
   733  
   734  ### Parameters
   735  
   736  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
   737    the job file during submission). This is specified as part of the path.
   738  
   739  - `all` `(bool: false)` - Specifies whether the list of allocations should
   740    include allocations from a previously registered job with the same ID. This is
   741    possible if the job is deregistered and reregistered.
   742  
   743  ### Sample Request
   744  
   745  ```text
   746  $ curl \
   747      https://localhost:4646/v1/job/my-job/allocations
   748  ```
   749  
   750  ### Sample Response
   751  
   752  ```json
   753  [
   754    {
   755      "ID": "ed344e0a-7290-d117-41d3-a64f853ca3c2",
   756      "EvalID": "a9c5effc-2242-51b2-f1fe-054ee11ab189",
   757      "Name": "example.cache[0]",
   758      "NodeID": "cb1f6030-a220-4f92-57dc-7baaabdc3823",
   759      "PreviousAllocation": "516d2753-0513-cfc7-57ac-2d6fac18b9dc",
   760         "NextAllocation": "cd13d9b9-4f97-7184-c88b-7b451981616b",
   761         "RescheduleTracker": {
   762            "Events": [
   763               {
   764                 "PrevAllocID": "516d2753-0513-cfc7-57ac-2d6fac18b9dc",
   765                 "PrevNodeID": "9230cd3b-3bda-9a3f-82f9-b2ea8dedb20e",
   766                 "RescheduleTime": 1517434161192946200,
   767                 "Delay":5000000000,
   768                },
   769              ]
   770      },
   771      "JobID": "example",
   772      "TaskGroup": "cache",
   773      "DesiredStatus": "run",
   774      "DesiredDescription": "",
   775      "ClientStatus": "running",
   776      "ClientDescription": "",
   777      "TaskStates": {
   778        "redis": {
   779          "State": "running",
   780          "Failed": false,
   781          "StartedAt": "2017-05-25T23:41:23.240184101Z",
   782          "FinishedAt": "0001-01-01T00:00:00Z",
   783          "Events": [
   784            {
   785              "Type": "Received",
   786              "Time": 1495755675956923000,
   787              "FailsTask": false,
   788              "RestartReason": "",
   789              "SetupError": "",
   790              "DriverError": "",
   791              "ExitCode": 0,
   792              "Signal": 0,
   793              "Message": "",
   794              "KillTimeout": 0,
   795              "KillError": "",
   796              "KillReason": "",
   797              "StartDelay": 0,
   798              "DownloadError": "",
   799              "ValidationError": "",
   800              "DiskLimit": 0,
   801              "FailedSibling": "",
   802              "VaultError": "",
   803              "TaskSignalReason": "",
   804              "TaskSignal": "",
   805              "DriverMessage": ""
   806            },
   807            {
   808              "Type": "Task Setup",
   809              "Time": 1495755675957466400,
   810              "FailsTask": false,
   811              "RestartReason": "",
   812              "SetupError": "",
   813              "DriverError": "",
   814              "ExitCode": 0,
   815              "Signal": 0,
   816              "Message": "Building Task Directory",
   817              "KillTimeout": 0,
   818              "KillError": "",
   819              "KillReason": "",
   820              "StartDelay": 0,
   821              "DownloadError": "",
   822              "ValidationError": "",
   823              "DiskLimit": 0,
   824              "FailedSibling": "",
   825              "VaultError": "",
   826              "TaskSignalReason": "",
   827              "TaskSignal": "",
   828              "DriverMessage": ""
   829            },
   830            {
   831              "Type": "Driver",
   832              "Time": 1495755675970286800,
   833              "FailsTask": false,
   834              "RestartReason": "",
   835              "SetupError": "",
   836              "DriverError": "",
   837              "ExitCode": 0,
   838              "Signal": 0,
   839              "Message": "",
   840              "KillTimeout": 0,
   841              "KillError": "",
   842              "KillReason": "",
   843              "StartDelay": 0,
   844              "DownloadError": "",
   845              "ValidationError": "",
   846              "DiskLimit": 0,
   847              "FailedSibling": "",
   848              "VaultError": "",
   849              "TaskSignalReason": "",
   850              "TaskSignal": "",
   851              "DriverMessage": "Downloading image redis:3.2"
   852            },
   853            {
   854              "Type": "Started",
   855              "Time": 1495755683227522000,
   856              "FailsTask": false,
   857              "RestartReason": "",
   858              "SetupError": "",
   859              "DriverError": "",
   860              "ExitCode": 0,
   861              "Signal": 0,
   862              "Message": "",
   863              "KillTimeout": 0,
   864              "KillError": "",
   865              "KillReason": "",
   866              "StartDelay": 0,
   867              "DownloadError": "",
   868              "ValidationError": "",
   869              "DiskLimit": 0,
   870              "FailedSibling": "",
   871              "VaultError": "",
   872              "TaskSignalReason": "",
   873              "TaskSignal": "",
   874              "DriverMessage": ""
   875            }
   876          ]
   877        }
   878      },
   879      "CreateIndex": 9,
   880      "ModifyIndex": 13,
   881      "CreateTime": 1495755675944527600,
   882      "ModifyTime": 1495755675944527600
   883    }
   884  ]
   885  ```
   886  
   887  ## List Job Evaluations
   888  
   889  This endpoint reads information about a single job's evaluations
   890  
   891  | Method | Path                          | Produces                   |
   892  | ------ | ----------------------------- | -------------------------- |
   893  | `GET`  | `/v1/job/:job_id/evaluations` | `application/json`         |
   894  
   895  The table below shows this endpoint's support for
   896  [blocking queries](/api/index.html#blocking-queries) and
   897  [required ACLs](/api/index.html#acls).
   898  
   899  | Blocking Queries | ACL Required               |
   900  | ---------------- | -------------------------- |
   901  | `YES`            | `namespace:read-job`       |
   902  
   903  ### Parameters
   904  
   905  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
   906    the job file during submission). This is specified as part of the path.
   907  
   908  ### Sample Request
   909  
   910  ```text
   911  $ curl \
   912      https://localhost:4646/v1/job/my-job/evaluations
   913  ```
   914  
   915  ### Sample Response
   916  
   917  ```json
   918  [
   919    {
   920      "ID": "a9c5effc-2242-51b2-f1fe-054ee11ab189",
   921      "Priority": 50,
   922      "Type": "service",
   923      "TriggeredBy": "job-register",
   924      "JobID": "example",
   925      "JobModifyIndex": 7,
   926      "NodeID": "",
   927      "NodeModifyIndex": 0,
   928      "Status": "complete",
   929      "StatusDescription": "",
   930      "Wait": 0,
   931      "NextEval": "",
   932      "PreviousEval": "",
   933      "BlockedEval": "",
   934      "FailedTGAllocs": null,
   935      "ClassEligibility": null,
   936      "EscapedComputedClass": false,
   937      "AnnotatePlan": false,
   938      "QueuedAllocations": {
   939        "cache": 0
   940      },
   941      "SnapshotIndex": 8,
   942      "CreateIndex": 8,
   943      "ModifyIndex": 10
   944    }
   945  ]
   946  ```
   947  
   948  ## List Job Deployments
   949  
   950  This endpoint lists a single job's deployments
   951  
   952  | Method | Path                          | Produces                   |
   953  | ------ | ----------------------------- | -------------------------- |
   954  | `GET`  | `/v1/job/:job_id/deployments` | `application/json`         |
   955  
   956  The table below shows this endpoint's support for
   957  [blocking queries](/api/index.html#blocking-queries) and
   958  [required ACLs](/api/index.html#acls).
   959  
   960  | Blocking Queries | ACL Required               |
   961  | ---------------- | -------------------------- |
   962  | `YES`            | `namespace:read-job`       |
   963  
   964  ### Parameters
   965  
   966  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
   967    the job file during submission). This is specified as part of the path.
   968  
   969  - `all` `(bool: false)` - Specifies whether the list of deployments should
   970    include deployments from a previously registered job with the same ID. This is
   971    possible if the job is deregistered and reregistered.
   972  
   973  ### Sample Request
   974  
   975  ```text
   976  $ curl \
   977      https://localhost:4646/v1/job/my-job/deployments
   978  ```
   979  
   980  ### Sample Response
   981  
   982  ```json
   983  [
   984    {
   985      "ID": "85ee4a9a-339f-a921-a9ef-0550d20b2c61",
   986      "JobID": "my-job",
   987      "JobVersion": 1,
   988      "JobModifyIndex": 19,
   989      "JobCreateIndex": 7,
   990      "TaskGroups": {
   991        "cache": {
   992          "AutoRevert": true,
   993          "Promoted": false,
   994          "PlacedCanaries": [
   995            "d0ad0808-2765-abf6-1e15-79fb7fe5a416",
   996            "38c70cd8-81f2-1489-a328-87bb29ec0e0f"
   997          ],
   998          "DesiredCanaries": 2,
   999          "DesiredTotal": 3,
  1000          "PlacedAllocs": 2,
  1001          "HealthyAllocs": 2,
  1002          "UnhealthyAllocs": 0
  1003        }
  1004      },
  1005      "Status": "running",
  1006      "StatusDescription": "Deployment is running",
  1007      "CreateIndex": 21,
  1008      "ModifyIndex": 25
  1009    },
  1010    {
  1011      "ID": "fb6070fb-4a44-e255-4e6f-8213eba3871a",
  1012      "JobID": "my-job",
  1013      "JobVersion": 0,
  1014      "JobModifyIndex": 7,
  1015      "JobCreateIndex": 7,
  1016      "TaskGroups": {
  1017        "cache": {
  1018          "AutoRevert": true,
  1019          "Promoted": false,
  1020          "PlacedCanaries": null,
  1021          "DesiredCanaries": 0,
  1022          "DesiredTotal": 3,
  1023          "PlacedAllocs": 3,
  1024          "HealthyAllocs": 3,
  1025          "UnhealthyAllocs": 0
  1026        }
  1027      },
  1028      "Status": "successful",
  1029      "StatusDescription": "Deployment completed successfully",
  1030      "CreateIndex": 9,
  1031      "ModifyIndex": 17
  1032    }
  1033  ]
  1034  ```
  1035  
  1036  
  1037  ## Read Job's Most Recent Deployment
  1038  
  1039  This endpoint returns a single job's most recent deployment.
  1040  
  1041  | Method | Path                          | Produces                   |
  1042  | ------ | ----------------------------- | -------------------------- |
  1043  | `GET`  | `/v1/job/:job_id/deployment`  | `application/json`         |
  1044  
  1045  The table below shows this endpoint's support for
  1046  [blocking queries](/api/index.html#blocking-queries) and
  1047  [required ACLs](/api/index.html#acls).
  1048  
  1049  | Blocking Queries | ACL Required               |
  1050  | ---------------- | -------------------------- |
  1051  | `YES`            | `namespace:read-job`       |
  1052  
  1053  ### Parameters
  1054  
  1055  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1056    the job file during submission). This is specified as part of the path.
  1057  
  1058  ### Sample Request
  1059  
  1060  ```text
  1061  $ curl \
  1062      https://localhost:4646/v1/job/my-job/deployment
  1063  ```
  1064  
  1065  ### Sample Response
  1066  
  1067  ```json
  1068  {
  1069    "ID": "85ee4a9a-339f-a921-a9ef-0550d20b2c61",
  1070    "JobID": "my-job",
  1071    "JobVersion": 1,
  1072    "JobModifyIndex": 19,
  1073    "JobCreateIndex": 7,
  1074    "TaskGroups": {
  1075      "cache": {
  1076        "AutoRevert": true,
  1077        "Promoted": false,
  1078        "PlacedCanaries": [
  1079          "d0ad0808-2765-abf6-1e15-79fb7fe5a416",
  1080          "38c70cd8-81f2-1489-a328-87bb29ec0e0f"
  1081        ],
  1082        "DesiredCanaries": 2,
  1083        "DesiredTotal": 3,
  1084        "PlacedAllocs": 2,
  1085        "HealthyAllocs": 2,
  1086        "UnhealthyAllocs": 0
  1087      }
  1088    },
  1089    "Status": "running",
  1090    "StatusDescription": "Deployment is running",
  1091    "CreateIndex": 21,
  1092    "ModifyIndex": 25
  1093  }
  1094  ```
  1095  
  1096  
  1097  ## Read Job Summary
  1098  
  1099  This endpoint reads summary information about a job.
  1100  
  1101  | Method | Path                       | Produces                   |
  1102  | ------ | -------------------------- | -------------------------- |
  1103  | `GET`  | `/v1/job/:job_id/summary`  | `application/json`         |
  1104  
  1105  The table below shows this endpoint's support for
  1106  [blocking queries](/api/index.html#blocking-queries) and
  1107  [required ACLs](/api/index.html#acls).
  1108  
  1109  | Blocking Queries | ACL Required               |
  1110  | ---------------- | -------------------------- |
  1111  | `YES`            | `namespace:read-job`       |
  1112  
  1113  ### Parameters
  1114  
  1115  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1116    the job file during submission). This is specified as part of the path.
  1117  
  1118  ### Sample Request
  1119  
  1120  ```text
  1121  $ curl \
  1122      https://localhost:4646/v1/job/my-job/summary
  1123  ```
  1124  
  1125  ### Sample Response
  1126  
  1127  ```json
  1128  {
  1129    "JobID": "example",
  1130    "Summary": {
  1131      "cache": {
  1132        "Queued": 0,
  1133        "Complete": 0,
  1134        "Failed": 0,
  1135        "Running": 1,
  1136        "Starting": 0,
  1137        "Lost": 0
  1138      }
  1139    },
  1140    "Children": {
  1141      "Pending": 0,
  1142      "Running": 0,
  1143      "Dead": 0
  1144    },
  1145    "CreateIndex": 7,
  1146    "ModifyIndex": 13
  1147  }
  1148  ```
  1149  
  1150  ## Update Existing Job
  1151  
  1152  This endpoint registers a new job or updates an existing job.
  1153  
  1154  | Method  | Path                       | Produces                   |
  1155  | ------- | -------------------------- | -------------------------- |
  1156  | `POST`  | `/v1/job/:job_id`          | `application/json`         |
  1157  
  1158  The table below shows this endpoint's support for
  1159  [blocking queries](/api/index.html#blocking-queries) and
  1160  [required ACLs](/api/index.html#acls).
  1161  
  1162  | Blocking Queries | ACL Required |
  1163  | ---------------- | ------------ |
  1164  | `NO`             | `namespace:submit-job`<br>`namespace:sentinel-override` if `PolicyOverride` set |
  1165  
  1166  ### Parameters
  1167  
  1168  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1169    the job file during submission). This is specified as part of the path.
  1170  
  1171  - `Job` `(Job: <required>)` - Specifies the JSON definition of the job.
  1172  
  1173  - `EnforceIndex` `(bool: false)` - If set, the job will only be registered if the
  1174    passed `JobModifyIndex` matches the current job's index. If the index is zero,
  1175    the register only occurs if the job is new. This paradigm allows check-and-set
  1176    style job updating.
  1177  
  1178  - `JobModifyIndex` `(int: 0)` - Specifies the `JobModifyIndex` to enforce the
  1179    current job is at.
  1180  
  1181  - `PolicyOverride` `(bool: false)` - If set, any soft mandatory Sentinel policies
  1182    will be overridden. This allows a job to be registered when it would be denied
  1183    by policy.
  1184  
  1185  ### Sample Payload
  1186  
  1187  ```javascript
  1188  {
  1189    "Job": {
  1190      // ...
  1191    },
  1192    "EnforceIndex": true,
  1193    "JobModifyIndex": 4
  1194  }
  1195  ```
  1196  
  1197  ### Sample Request
  1198  
  1199  ```text
  1200  $ curl \
  1201      --request POST \
  1202      --data @payload.json \
  1203      https://localhost:4646/v1/job/my-job
  1204  ```
  1205  
  1206  ### Sample Response
  1207  
  1208  ```json
  1209  {
  1210    "EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac",
  1211    "EvalCreateIndex": 35,
  1212    "JobModifyIndex": 34,
  1213  }
  1214  ```
  1215  
  1216  ## Dispatch Job
  1217  
  1218  This endpoint dispatches a new instance of a parameterized job.
  1219  
  1220  | Method  | Path                       | Produces                   |
  1221  | ------- | -------------------------- | -------------------------- |
  1222  | `POST`  | `/v1/job/:job_id/dispatch` | `application/json`         |
  1223  
  1224  The table below shows this endpoint's support for
  1225  [blocking queries](/api/index.html#blocking-queries) and
  1226  [required ACLs](/api/index.html#acls).
  1227  
  1228  | Blocking Queries | ACL Required                   |
  1229  | ---------------- | ------------------------------ |
  1230  | `NO`             | `namespace:dispatch-job`       |
  1231  
  1232  ### Parameters
  1233  
  1234  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified
  1235    in the job file during submission). This is specified as part of the path.
  1236  
  1237  - `Payload` `(string: "")` - Specifies a base64 encoded string containing the
  1238    payload. This is limited to 15 KB.
  1239  
  1240  - `Meta` `(meta<string|string>: nil)` - Specifies arbitrary metadata to pass to
  1241    the job.
  1242  
  1243  ### Sample Payload
  1244  
  1245  ```json
  1246  {
  1247    "Payload": "A28C3==",
  1248    "Meta": {
  1249      "key": "Value"
  1250    }
  1251  }
  1252  ```
  1253  
  1254  ### Sample Request
  1255  
  1256  ```text
  1257  $ curl \
  1258      --request POST \
  1259      --payload @payload.json \
  1260      https://localhost:4646/v1/job/my-job/dispatch
  1261  ```
  1262  
  1263  ### Sample Response
  1264  
  1265  ```json
  1266  {
  1267    "Index": 13,
  1268    "JobCreateIndex": 12,
  1269    "EvalCreateIndex": 13,
  1270    "EvalID": "e5f55fac-bc69-119d-528a-1fc7ade5e02c",
  1271    "DispatchedJobID": "example/dispatch-1485408778-81644024"
  1272  }
  1273  ```
  1274  
  1275  ## Revert to older Job Version
  1276  
  1277  This endpoint reverts the job to an older version.
  1278  
  1279  | Method  | Path                       | Produces                   |
  1280  | ------- | -------------------------- | -------------------------- |
  1281  | `POST`  | `/v1/job/:job_id/revert` | `application/json`         |
  1282  
  1283  The table below shows this endpoint's support for
  1284  [blocking queries](/api/index.html#blocking-queries) and
  1285  [required ACLs](/api/index.html#acls).
  1286  
  1287  | Blocking Queries | ACL Required                 |
  1288  | ---------------- | ---------------------------- |
  1289  | `NO`             | `namespace:submit-job`       |
  1290  
  1291  ### Parameters
  1292  
  1293  - `JobID` `(string: <required>)` - Specifies the ID of the job (as specified
  1294    in the job file during submission). This is specified as part of the path.
  1295  
  1296  - `JobVersion` `(integer: 0)` - Specifies the job version to revert to.
  1297  
  1298  - `EnforcePriorVersion` `(integer: nil)` - Optional value specifying the current
  1299    job's version. This is checked and acts as a check-and-set value before
  1300    reverting to the specified job.
  1301  
  1302  - `VaultToken` `(string: "")` - Optional value specifying the [vault token](/docs/commands/job/revert.html)
  1303    used for Vault [policy authentication checking](/docs/configuration/vault.html#allow_unauthenticated).
  1304  
  1305  ### Sample Payload
  1306  
  1307  ```json
  1308  {
  1309    "JobID": "my-job",
  1310    "JobVersion": 2,
  1311  }
  1312  ```
  1313  
  1314  ### Sample Request
  1315  
  1316  ```text
  1317  $ curl \
  1318      --request POST \
  1319      --payload @payload.json \
  1320      https://localhost:4646/v1/job/my-job/revert
  1321  ```
  1322  
  1323  ### Sample Response
  1324  
  1325  ```json
  1326  {
  1327    "EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac",
  1328    "EvalCreateIndex": 35,
  1329    "JobModifyIndex": 34,
  1330  }
  1331  ```
  1332  
  1333  
  1334  ## Set Job Stability
  1335  
  1336  This endpoint sets the job's stability.
  1337  
  1338  | Method  | Path                       | Produces                   |
  1339  | ------- | -------------------------- | -------------------------- |
  1340  | `POST`  | `/v1/job/:job_id/stable`   | `application/json`         |
  1341  
  1342  The table below shows this endpoint's support for
  1343  [blocking queries](/api/index.html#blocking-queries) and
  1344  [required ACLs](/api/index.html#acls).
  1345  
  1346  | Blocking Queries | ACL Required                 |
  1347  | ---------------- | ---------------------------- |
  1348  | `NO`             | `namespace:submit-job`       |
  1349  
  1350  ### Parameters
  1351  
  1352  - `JobID` `(string: <required>)` - Specifies the ID of the job (as specified
  1353    in the job file during submission). This is specified as part of the path.
  1354  
  1355  - `JobVersion` `(integer: 0)` - Specifies the job version to set the stability on.
  1356  
  1357  - `Stable` `(bool: false)` - Specifies whether the job should be marked as
  1358    stable or not.
  1359  
  1360  ### Sample Payload
  1361  
  1362  ```json
  1363  {
  1364    "JobID": "my-job",
  1365    "JobVersion": 2,
  1366    "Stable": true
  1367  }
  1368  ```
  1369  
  1370  ### Sample Request
  1371  
  1372  ```text
  1373  $ curl \
  1374      --request POST \
  1375      --payload @payload.json \
  1376      https://localhost:4646/v1/job/my-job/stable
  1377  ```
  1378  
  1379  ### Sample Response
  1380  
  1381  ```json
  1382  {
  1383    "JobModifyIndex": 34,
  1384  }
  1385  ```
  1386  
  1387  
  1388  ## Create Job Evaluation
  1389  
  1390  This endpoint creates a new evaluation for the given job. This can be used to
  1391  force run the scheduling logic if necessary. Since Nomad 0.8.4, this endpoint
  1392  supports a JSON payload with additional options. Support for calling this end point
  1393  without a JSON payload will be removed in Nomad 0.9.
  1394  
  1395  | Method  | Path                       | Produces                   |
  1396  | ------- | -------------------------- | -------------------------- |
  1397  | `POST`  | `/v1/job/:job_id/evaluate` | `application/json`         |
  1398  
  1399  The table below shows this endpoint's support for
  1400  [blocking queries](/api/index.html#blocking-queries) and
  1401  [required ACLs](/api/index.html#acls).
  1402  
  1403  | Blocking Queries | ACL Required               |
  1404  | ---------------- | -------------------------- |
  1405  | `NO`             | `namespace:read-job`       |
  1406  
  1407  ### Parameters
  1408  
  1409  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1410    the job file during submission). This is specified as part of the path.
  1411  
  1412  - `JobID` `(string: <required>)` - Specify the ID of the job in the JSON payload
  1413  
  1414  - `EvalOptions` `(<optional>)` - Specify additional options to be used during the forced evaluation.
  1415      - `ForceReschedule` `(bool: false)` - If set, failed allocations of the job are rescheduled
  1416      immediately. This is useful for operators to force immediate placement even if the failed allocations are past
  1417      their reschedule limit, or are delayed by several hours because the allocation's reschedule policy has exponential delay.
  1418  
  1419  ### Sample Payload
  1420  
  1421  ```json
  1422  {
  1423    "JobID": "my-job",
  1424    "EvalOptions": {
  1425       "ForceReschedule":true
  1426    }
  1427  }
  1428  ```
  1429  
  1430  ### Sample Request
  1431  
  1432  ```text
  1433  $ curl \
  1434      --request POST \
  1435      -d @sample.json \
  1436      https://localhost:4646/v1/job/my-job/evaluate
  1437  ```
  1438  
  1439  ### Sample Response
  1440  
  1441  ```json
  1442  {
  1443    "EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac",
  1444    "EvalCreateIndex": 35,
  1445    "JobModifyIndex": 34,
  1446  }
  1447  ```
  1448  
  1449  ## Create Job Plan
  1450  
  1451  This endpoint invokes a dry-run of the scheduler for the job.
  1452  
  1453  | Method  | Path                       | Produces                   |
  1454  | ------- | -------------------------- | -------------------------- |
  1455  | `POST`  | `/v1/job/:job_id/plan`     | `application/json`         |
  1456  
  1457  The table below shows this endpoint's support for
  1458  [blocking queries](/api/index.html#blocking-queries) and
  1459  [required ACLs](/api/index.html#acls).
  1460  
  1461  | Blocking Queries | ACL Required |
  1462  | ---------------- | ------------ |
  1463  | `NO`             | `namespace:submit-job`<br>`namespace:sentinel-override` if `PolicyOverride` set |
  1464  
  1465  ### Parameters
  1466  
  1467  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1468  - the job file during submission). This is specified as part of the path.
  1469  
  1470  - `Job` `(string: <required>)` - Specifies the JSON definition of the job.
  1471  
  1472  - `Diff` `(bool: false)` - Specifies whether the diff structure between the
  1473    submitted and server side version of the job should be included in the
  1474    response.
  1475  
  1476  - `PolicyOverride` `(bool: false)` - If set, any soft mandatory Sentinel policies
  1477    will be overridden. This allows a job to be registered when it would be denied
  1478    by policy.
  1479  
  1480  ### Sample Payload
  1481  
  1482  ```json
  1483  {
  1484    "Job": "...",
  1485    "Diff": true,
  1486    "PolicyOverride": false
  1487  }
  1488  ```
  1489  
  1490  ### Sample Request
  1491  
  1492  ```text
  1493  $ curl \
  1494      --request POST \
  1495      --payload @payload.json \
  1496      https://localhost:4646/v1/job/my-job/plan
  1497  ```
  1498  
  1499  ### Sample Response
  1500  
  1501  ```json
  1502  {
  1503    "Index": 0,
  1504    "NextPeriodicLaunch": "0001-01-01T00:00:00Z",
  1505    "Warnings": "",
  1506    "Diff": {
  1507      "Type": "Added",
  1508      "TaskGroups": [
  1509        {
  1510          "Updates": {
  1511            "create": 1
  1512          },
  1513          "Type": "Added",
  1514          "Tasks": [
  1515            {
  1516              "Type": "Added",
  1517              "Objects": [
  1518                "..."
  1519              ],
  1520              "Name": "redis",
  1521              "Fields": [
  1522                {
  1523                  "Type": "Added",
  1524                  "Old": "",
  1525                  "New": "docker",
  1526                  "Name": "Driver",
  1527                  "Annotations": null
  1528                },
  1529                {
  1530                  "Type": "Added",
  1531                  "Old": "",
  1532                  "New": "5000000000",
  1533                  "Name": "KillTimeout",
  1534                  "Annotations": null
  1535                }
  1536              ],
  1537              "Annotations": [
  1538                "forces create"
  1539              ]
  1540            }
  1541          ],
  1542          "Objects": [
  1543            "..."
  1544          ],
  1545          "Name": "cache",
  1546          "Fields": [
  1547            "..."
  1548          ]
  1549        }
  1550      ],
  1551      "Objects": [
  1552        {
  1553          "Type": "Added",
  1554          "Objects": null,
  1555          "Name": "Datacenters",
  1556          "Fields": [
  1557            "..."
  1558          ]
  1559        },
  1560        {
  1561          "Type": "Added",
  1562          "Objects": null,
  1563          "Name": "Constraint",
  1564          "Fields": [
  1565            "..."
  1566          ]
  1567        },
  1568        {
  1569          "Type": "Added",
  1570          "Objects": null,
  1571          "Name": "Update",
  1572          "Fields": [
  1573            "..."
  1574          ]
  1575        }
  1576      ],
  1577      "ID": "example",
  1578      "Fields": [
  1579        "..."
  1580      ]
  1581    },
  1582    "CreatedEvals": [
  1583      {
  1584        "ModifyIndex": 0,
  1585        "CreateIndex": 0,
  1586        "SnapshotIndex": 0,
  1587        "AnnotatePlan": false,
  1588        "EscapedComputedClass": false,
  1589        "NodeModifyIndex": 0,
  1590        "NodeID": "",
  1591        "JobModifyIndex": 0,
  1592        "JobID": "example",
  1593        "TriggeredBy": "job-register",
  1594        "Type": "batch",
  1595        "Priority": 50,
  1596        "ID": "312e6a6d-8d01-0daf-9105-14919a66dba3",
  1597        "Status": "blocked",
  1598        "StatusDescription": "created to place remaining allocations",
  1599        "Wait": 0,
  1600        "NextEval": "",
  1601        "PreviousEval": "80318ae4-7eda-e570-e59d-bc11df134817",
  1602        "BlockedEval": "",
  1603        "FailedTGAllocs": null,
  1604        "ClassEligibility": {
  1605          "v1:7968290453076422024": true
  1606        }
  1607      }
  1608    ],
  1609    "JobModifyIndex": 0,
  1610    "FailedTGAllocs": {
  1611      "cache": {
  1612        "CoalescedFailures": 3,
  1613        "AllocationTime": 46415,
  1614        "Scores": null,
  1615        "NodesEvaluated": 1,
  1616        "NodesFiltered": 0,
  1617        "NodesAvailable": {
  1618          "dc1": 1
  1619        },
  1620        "ClassFiltered": null,
  1621        "ConstraintFiltered": null,
  1622        "NodesExhausted": 1,
  1623        "ClassExhausted": null,
  1624        "DimensionExhausted": {
  1625          "cpu": 1
  1626        }
  1627      }
  1628    },
  1629    "Annotations": {
  1630      "DesiredTGUpdates": {
  1631        "cache": {
  1632          "DestructiveUpdate": 0,
  1633          "InPlaceUpdate": 0,
  1634          "Stop": 0,
  1635          "Migrate": 0,
  1636          "Place": 11,
  1637          "Ignore": 0
  1638        }
  1639      }
  1640    }
  1641  }
  1642  ```
  1643  
  1644  #### Field Reference
  1645  
  1646  - `Diff` - A diff structure between the submitted job and the server side
  1647    version. The top-level object is a Job Diff which contains Task Group Diffs,
  1648    which in turn contain Task Diffs. Each of these objects then has Object and
  1649    Field Diff structures embedded.
  1650  
  1651  - `NextPeriodicLaunch` - If the job being planned is periodic, this field will
  1652    include the next launch time for the job.
  1653  
  1654  - `CreatedEvals` - A set of evaluations that were created as a result of the
  1655    dry-run. These evaluations can signify a follow-up rolling update evaluation
  1656    or a blocked evaluation.
  1657  
  1658  - `JobModifyIndex` - The `JobModifyIndex` of the server side version of this job.
  1659  
  1660  - `FailedTGAllocs` - A set of metrics to understand any allocation failures that
  1661    occurred for the Task Group.
  1662  
  1663  - `Annotations` - Annotations include the `DesiredTGUpdates`, which tracks what
  1664  - the scheduler would do given enough resources for each Task Group.
  1665  
  1666  
  1667  ## Force New Periodic Instance
  1668  
  1669  This endpoint forces a new instance of the periodic job. A new instance will be
  1670  created even if it violates the job's
  1671  [`prohibit_overlap`](/docs/job-specification/periodic.html#prohibit_overlap)
  1672  settings. As such, this should be only used to immediately run a periodic job.
  1673  
  1674  | Method  | Path                             | Produces                   |
  1675  | ------- | -------------------------------- | -------------------------- |
  1676  | `POST`  | `/v1/job/:job_id/periodic/force` | `application/json`         |
  1677  
  1678  The table below shows this endpoint's support for
  1679  [blocking queries](/api/index.html#blocking-queries) and
  1680  [required ACLs](/api/index.html#acls).
  1681  
  1682  | Blocking Queries | ACL Required           |
  1683  | ---------------- | ---------------------- |
  1684  | `NO`             | `namespace:submit-job` |
  1685  
  1686  ### Parameters
  1687  
  1688  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1689    the job file during submission). This is specified as part of the path.
  1690  
  1691  ### Sample Request
  1692  
  1693  ```text
  1694  $ curl \
  1695      --request POST \
  1696      https://localhost:4646/v1/job/my-job/periodic/force
  1697  ```
  1698  
  1699  ### Sample Response
  1700  
  1701  ```json
  1702  {
  1703    "EvalCreateIndex": 7,
  1704    "EvalID": "57983ddd-7fcf-3e3a-fd24-f699ccfb36f4"
  1705  }
  1706  ```
  1707  
  1708  ## Stop a Job
  1709  
  1710  This endpoint deregisters a job, and stops all allocations part of it.
  1711  
  1712  | Method   | Path                       | Produces                   |
  1713  | -------- | -------------------------- | -------------------------- |
  1714  | `DELETE` | `/v1/job/:job_id`          | `application/json`         |
  1715  
  1716  The table below shows this endpoint's support for
  1717  [blocking queries](/api/index.html#blocking-queries) and
  1718  [required ACLs](/api/index.html#acls).
  1719  
  1720  | Blocking Queries | ACL Required                 |
  1721  | ---------------- | ---------------------------- |
  1722  | `NO`             | `namespace:submit-job`       |
  1723  
  1724  ### Parameters
  1725  
  1726  - `:job_id` `(string: <required>)` - Specifies the ID of the job (as specified in
  1727    the job file during submission). This is specified as part of the path.
  1728  
  1729  - `Purge` `(bool: false)` - Specifies that the job should stopped and purged
  1730    immediately. This means the job will not be queryable after being stopped. If
  1731    not set, the job will be purged by the garbage collector.
  1732  
  1733  ### Sample Request
  1734  
  1735  ```text
  1736  $ curl \
  1737      --request DELETE \
  1738      https://localhost:4646/v1/job/my-job?purge=true
  1739  ```
  1740  
  1741  ### Sample Response
  1742  
  1743  ```json
  1744  {
  1745    "EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac",
  1746    "EvalCreateIndex": 35,
  1747    "JobModifyIndex": 34,
  1748  }
  1749  ```