open-nomad/website/source/docs/http/jobs.html.md
2016-10-27 22:18:07 -04:00

1.8 KiB

layout page_title sidebar_current description
http HTTP API: /v1/jobs docs-http-jobs The '/1/jobs' endpoint is used list jobs and register new ones.

/v1/jobs

The jobs endpoint is used to query the status of existing jobs in Nomad and to register new jobs. By default, the agent's local region is used; another region can be specified using the ?region= query parameter.

GET

Description
Lists all the jobs registered with Nomad.
Method
GET
URL
`/v1/jobs`
Parameters
  • prefix optional Filter jobs based on an identifier prefix.
Blocking Queries
[Supported](/docs/http/index.html#blocking-queries)
Returns
```javascript
[
{
    "ID": "binstore-storagelocker",
    "Name": "binstore-storagelocker",
    "Type": "service",
    "Priority": 50,
    "Status": "",
    "StatusDescription": "",
    "CreateIndex": 14,
    "ModifyIndex": 14
},
...
]
```

PUT / POST

Description
Registers a new job.
Method
PUT or POST
URL
`/v1/jobs`
Parameters
  • Job required The JSON definition of the job. The general structure is given by the [job specification](/docs/http/json-jobs.html).
Returns
```javascript
{
"EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac",
"EvalCreateIndex": 35,
"JobModifyIndex": 34,
}
```