github.com/huiliang/nomad@v0.2.1-0.20151124023127-7a8b664699ff/website/source/docs/http/jobs.html.md (about) 1 --- 2 layout: "http" 3 page_title: "HTTP API: /v1/jobs" 4 sidebar_current: "docs-http-jobs" 5 description: |- 6 The '/1/jobs' endpoint is used list jobs and register new ones. 7 --- 8 9 # /v1/jobs 10 11 The `jobs` endpoint is used to query the status of existing jobs in Nomad 12 and to to register new jobs. By default, the agent's local region is used; 13 another region can be specified using the `?region=` query parameter. 14 15 ## GET 16 17 <dl> 18 <dt>Description</dt> 19 <dd> 20 Lists all the jobs registered with Nomad. 21 </dd> 22 23 <dt>Method</dt> 24 <dd>GET</dd> 25 26 <dt>URL</dt> 27 <dd>`/v1/jobs`</dd> 28 29 <dt>Parameters</dt> 30 <dd> 31 None 32 </dd> 33 34 <dt>Blocking Queries</dt> 35 <dd> 36 [Supported](/docs/http/index.html#blocking-queries) 37 </dd> 38 39 <dt>Returns</dt> 40 <dd> 41 42 ```javascript 43 [ 44 { 45 "ID": "binstore-storagelocker", 46 "Name": "binstore-storagelocker", 47 "Type": "service", 48 "Priority": 50, 49 "Status": "", 50 "StatusDescription": "", 51 "CreateIndex": 14, 52 "ModifyIndex": 14 53 }, 54 ... 55 ] 56 ``` 57 58 </dd> 59 </dl> 60 61 ## PUT / POST 62 63 <dl> 64 <dt>Description</dt> 65 <dd> 66 Registers a new job. 67 </dd> 68 69 <dt>Method</dt> 70 <dd>PUT or POST</dd> 71 72 <dt>URL</dt> 73 <dd>`/v1/jobs`</dd> 74 75 <dt>Parameters</dt> 76 <dd> 77 <ul> 78 <li> 79 <span class="param">Job</span> 80 <span class="param-flags">required</span> 81 The JSON definition of the job. The general structure is given 82 by the [job specification](/docs/jobspec/index.html), and matches 83 the return response of [GET against `/v1/job/<ID>`](/docs/http/job.html). 84 </li> 85 </ul> 86 </dd> 87 88 <dt>Returns</dt> 89 <dd> 90 91 ```javascript 92 { 93 "EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac", 94 "EvalCreateIndex": 35, 95 "JobModifyIndex": 34, 96 } 97 ``` 98 99 </dd> 100 </dl>