/docs/en/api/rundeck-api.md

http://github.com/dtolabs/rundeck · Markdown · 5720 lines · 4069 code · 1651 blank · 0 comment · 0 complexity · f367c769729e26c02c31b21d105b3577 MD5 · raw file

  1. % API Reference | Version ${APIVERS}
  2. % Alex Honor; Greg Schueler
  3. % November 20, 2010
  4. Rundeck provides a Web API for use with your application.
  5. ## API Version Number
  6. The current API version is `${APIVERS}`.
  7. For API endpoints described in this document, the *minimum* API version required for their
  8. use is indicated by the URL used, e.g.:
  9. /api/2/system/info
  10. /api/1/projects
  11. This means you must use at least the API version indicated to access the
  12. endpoint, unless otherwise noted. Some features or functionality for the
  13. endpoint may only be supported in later versions.
  14. The API Version Number is required to be included in all API calls within the URL.
  15. If the version number is not included or if the requested version number is unsupported, then the API call will fail. The error response will include the code "api-version-unsupported" and have HTTP status code of `400 Bad Request`:
  16. `Content-Type: application/xml`:
  17. ~~~~~~~~~~~~~~~~~~~ {.xml}
  18. <result error="true" apiversion="2">
  19. <error code="api-version-unsupported">
  20. <message>
  21. Unsupported API Version "1". API Request: /rundeck/api/1/project/test/jobs. Reason: Minimum supported version: 2
  22. </message>
  23. </error>
  24. </result>
  25. ~~~~~~~~~~~~~~~~~~~
  26. `Content-Type: application/json`:
  27. ~~~~~~~~~~~~~~~~~~~ {.json}
  28. {
  29. "error": true,
  30. "apiversion": 14,
  31. "errorCode": "api.error.api-version.unsupported",
  32. "message": "Unsupported API Version \"1\". API Request: /api/1/project/test/resources. Reason: Minimum supported version: 2"
  33. }
  34. ~~~~~~~~~~~~~~~~~~~
  35. ## Index Links
  36. View the [Index](#index) listing API paths.
  37. ## Changes
  38. Changes introduced by API Version number:
  39. **Version 17**:
  40. * New Endpoints.
  41. - [`/api/17/scheduler/server/[UUID]/jobs`][/api/V/scheduler/server/[UUID]/jobs] - List scheduled jobs owned by the server with given UUID.
  42. - [`/api/17/scheduler/jobs`][/api/V/scheduler/jobs] - List scheduled jobs owned by the target server.
  43. - [`/api/17/system/logstorage`][/api/V/system/logstorage] - Get stats about the Log File storage system.
  44. - [`/api/17/system/logstorage/incomplete`][/api/V/system/logstorage/incomplete] - List all executions with incomplete logstorage.
  45. - [`/api/17/system/logstorage/incomplete/resume`][/api/V/system/logstorage/incomplete/resume] - Resume incomplete log storage processing.
  46. * Updated Endpoints.
  47. - [`/api/17/project/[PROJECT]/jobs`][/api/V/project/[PROJECT]/jobs]
  48. - Response now includes whether a job is enabled, scheduled, schedule is enabled, and in Cluster mode includes the cluster mode server UUID of the schedule owner, and whether that is the current server or not.
  49. - add `?scheduledFilter=true/false` returns scheduled/unscheduled jobs only
  50. - and `?serverNodeUUIDFilter=[uuid]` returns scheduled jobs owned by the given cluster member
  51. - [`/api/17/scheduler/takeover`][/api/V/scheduler/takeover]
  52. - Response now includes previous scheduler owner UUID for jobs.
  53. - [`/api/17/scheduler/takeover`][/api/V/scheduler/takeover] - Can specify a single job ID to takeover.
  54. **Version 16**:
  55. * New Endpoints.
  56. - [`/api/16/jobs/execution/enable`][/api/V/jobs/execution/enable] - Enable execution for multiple jobs
  57. - [`/api/16/jobs/execution/disable`][/api/V/jobs/execution/disable] - Disable execution for multiple jobs
  58. - [`/api/16/jobs/schedule/enable`][/api/V/jobs/schedule/enable] - Enable schedule for multiple jobs
  59. - [`/api/16/jobs/schedule/disable`][/api/V/jobs/schedule/disable] - Disable schedule for multiple jobs
  60. **Version 15**:
  61. * New Endpoints.
  62. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/plugins`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugins] - List SCM plugins for a project.
  63. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/input`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/input] - Get SCM plugin setup input fields.
  64. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/setup`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/setup] - Setup SCM for a project.
  65. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/enable`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/enable] - Enable SCM for a project.
  66. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/disable`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/disable] - Disable SCM for a project.
  67. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/status`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/status] - Get SCM status for a project.
  68. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/config`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/config] - Get SCM config for a project.
  69. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]/input`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]/input] - Get Project SCM Action Input Fields.
  70. - [`/api/15/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]`][/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]] - Perform SCM action for a project.
  71. - [`/api/15/job/[ID]/scm/[INTEGRATION]/status`][/api/V/job/[ID]/scm/[INTEGRATION]/status] - Get SCM status for a Job.
  72. - [`/api/15/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]`][/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]] - Perform SCM action for a Job.
  73. - [`/api/15/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]/input`][/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]/input] - Get Job SCM Action Input Fields
  74. **Version 14**:
  75. **Note**: this document now has an [Index](#index) listing API paths.
  76. * Deprecated Endpoints. These endpoints are deprecated, and new versions are added which include the Project name in the URL path
  77. - `/api/14/executions/running` replacement: [`/api/14/project/[PROJECT*]/executions/running`][/api/V/project/[PROJECT*]/executions/running]
  78. - `/api/14/executions` replacement: [`/api/14/project/[PROJECT]/executions`][/api/V/project/[PROJECT]/executions]
  79. - `/api/14/history` replacement: [`/api/14/project/[PROJECT]/history`][/api/V/project/[PROJECT]/history]
  80. - `/api/14/jobs/export` replacement: [`/api/14/project/[PROJECT]/jobs/export`][/api/V/project/[PROJECT]/jobs/export]
  81. - `/api/14/jobs/import` replacement: [`/api/14/project/[PROJECT]/jobs/import`][/api/V/project/[PROJECT]/jobs/import]
  82. - `/api/14/jobs` replacement: [`/api/14/project/[PROJECT]/jobs`][/api/V/project/[PROJECT]/jobs]
  83. - `/api/14/resource/[NAME]` replacement: [`/api/14/project/[PROJECT]/resource/[NAME]`][/api/V/project/[PROJECT]/resource/[NAME]]
  84. - `/api/14/resources(/*)` replacement: [`/api/14/project/[PROJECT]/resources`][/api/V/project/[PROJECT]/resources]
  85. - `/api/14/run/command` replacement: [`/api/14/project/[PROJECT]/run/command`][/api/V/project/[PROJECT]/run/command]
  86. - `/api/14/run/script` replacement: [`/api/14/project/[PROJECT]/run/script`][/api/V/project/[PROJECT]/run/script]
  87. - `/api/14/run/url` replacement: [`/api/14/project/[PROJECT]/run/url`][/api/V/project/[PROJECT]/run/url]
  88. * Deprecated Endpoints with no replacement
  89. - `/api/2/project/[PROJECT]/resources/refresh`
  90. * New Endpoints
  91. - [`/api/14/system/executions/enable`][/api/V/system/executions/enable] - Enable executions (ACTIVE mode)
  92. - [`/api/14/system/executions/disable`][/api/V/system/executions/disable] - Disable executions (PASSIVE mode)
  93. - [`/api/14/system/acl/*`][/api/V/system/acl/*] - Manage system ACLs
  94. - [`/api/14/project/[PROJECT]/acl/*`][/api/V/project/[PROJECT]/acl/*] - Manage project ACLs
  95. - [`/api/14/job/[ID]/execution/enable`][/api/V/job/[ID]/execution/enable] - Enable executions for a job
  96. - [`/api/14/job/[ID]/execution/disable`][/api/V/job/[ID]/execution/disable] - Disable executions for a job
  97. - [`/api/14/job/[ID]/schedule/enable`][/api/V/job/[ID]/schedule/enable] - Enable scheduling for a job
  98. - [`/api/14/job/[ID]/schedule/disable`][/api/V/job/[ID]/schedule/disable] - Disable scheduling for a job
  99. * New Endpoints, replacing deprecated versions:
  100. - [`/api/14/project/[PROJECT*]/executions/running`][/api/V/project/[PROJECT*]/executions/running]
  101. - [`/api/14/project/[PROJECT]/executions`][/api/V/project/[PROJECT]/executions]
  102. - [`/api/14/project/[PROJECT]/history`][/api/V/project/[PROJECT]/history]
  103. - [`/api/14/project/[PROJECT]/jobs/export`][/api/V/project/[PROJECT]/jobs/export]
  104. - [`/api/14/project/[PROJECT]/jobs/import`][/api/V/project/[PROJECT]/jobs/import]
  105. - [`/api/14/project/[PROJECT]/resource/[NAME]`][/api/V/project/[PROJECT]/resource/[NAME]]
  106. - `/api/14/project/[PROJECT]/resources(/*)`
  107. - [`/api/14/project/[PROJECT]/run/command`][/api/V/project/[PROJECT]/run/command]
  108. - [`/api/14/project/[PROJECT]/run/script`][/api/V/project/[PROJECT]/run/script]
  109. - [`/api/14/project/[PROJECT]/run/url`][/api/V/project/[PROJECT]/run/url]
  110. * Added JSON support for endpoints, when using API v14:
  111. - [`/api/14/execution/[ID]/abort`][/api/V/execution/[ID]/abort]
  112. - [`/api/14/execution/[ID]`][/api/V/execution/[ID]]
  113. - [`/api/14/job/[ID]/executions`][/api/V/job/[ID]/executions]
  114. - [`/api/14/job/[ID]/run`][/api/V/job/[ID]/run] and [`POST /api/14/job/[ID]/executions`][POST /api/V/job/[ID]/executions]
  115. - [`/api/14/jobs/delete`][/api/V/jobs/delete]
  116. - [`/api/14/project/[PROJECT*]/executions/running`][/api/V/project/[PROJECT*]/executions/running]
  117. - [`/api/14/project/[PROJECT]/executions`][/api/V/project/[PROJECT]/executions]
  118. - [`/api/14/project/[PROJECT]/history`][/api/V/project/[PROJECT]/history]
  119. - [`/api/14/project/[PROJECT]/jobs/import`][/api/V/project/[PROJECT]/jobs/import]
  120. - [`/api/14/project/[PROJECT]/jobs`][/api/V/project/[PROJECT]/jobs]
  121. - [`/api/14/project/[PROJECT]/resource/[NAME]`][/api/V/project/[PROJECT]/resource/[NAME]]
  122. - [`/api/14/project/[PROJECT]/resources`][/api/V/project/[PROJECT]/resources]
  123. - [`/api/14/project/[PROJECT]/run/command`][/api/V/project/[PROJECT]/run/command]
  124. - [`/api/14/project/[PROJECT]/run/script`][/api/V/project/[PROJECT]/run/script]
  125. - [`/api/14/project/[PROJECT]/run/url`][/api/V/project/[PROJECT]/run/url]
  126. - [`/api/14/system/info`][/api/V/system/info]
  127. * TODO json support:
  128. - [`/api/14/project/[PROJECT]/jobs/export`][/api/V/project/[PROJECT]/jobs/export]
  129. * Updated endpoints:
  130. - [`/api/14/job/[ID]/run`][/api/V/job/[ID]/run] action `GET` is no longer allowed (v14+), `POST` is required. For POST, this endpoint is now equivalent to `/api/14/job/[ID]/executions`. JSON request content is now supported.
  131. - [`/api/14/project/[PROJECT]/jobs/import`][/api/V/project/[PROJECT]/jobs/import]
  132. * Both XML and YAML job definitions can now be posted directly using the appropriate MIME type
  133. * Add API `href` and GUI `permalink` values into XML response
  134. * JSON response support
  135. - [`/api/14/project/[PROJECT]/jobs`][/api/V/project/[PROJECT]/jobs] - added API/GUI href/permalink to XML responses.
  136. - [`/api/14/execution/[ID]/abort`][/api/V/execution/[ID]/abort] - added API/GUI href/permalink to XML responses.
  137. - [`/api/14/project/[PROJECT]/history`][/api/V/project/[PROJECT]/history] - added API/GUI href/permalink to XML responses.
  138. - `/api/14/project/[PROJECT]/run/*` - added API/GUI href/permalink to XML responses for adhoc command/script/url.
  139. - [`/api/14/system/info`][/api/V/system/info] - added information about Rundeck Execution Mode
  140. - [`/api/14/project/[PROJECT]/import`][/api/V/project/[PROJECT]/import] - Added parameters for importing Configuration and ACL Policies from the archive.
  141. * Endpoints promoted out of "incubator" status:
  142. - [`/api/14/scheduler/takeover`][/api/V/scheduler/takeover] - Can specify `all` servers, or jobs within a specific `project`. Added API/GUI href/permalink to XML responses for adhoc command/script/url. Note: `href` was modified as mentioned below.
  143. * Modified `href` meaning for XML responses:
  144. * Some endpoints that included a `href` value in XML responses used the link that was appropriate
  145. for an end user to use in a web browser,
  146. essentially the permalink to the GUI view for the linked object.
  147. When using API v14, these URLs now point to the API,
  148. and a new attribute `permalink` will be included to link to the GUI view for the object.
  149. * Using an API version 13 or earlier will retain the old behavior of `href` in XML responses.
  150. Corrections:
  151. * The response for [DELETE /api/V/job/[ID]][] incorrectly stated it would return XML response, when the actual response is `204 No Content`.
  152. **Version 13**:
  153. * New endpoints
  154. - `/api/13/project/[PROJECT]/readme.md` and `/api/13/project/[PROJECT]/motd.md`
  155. - [Project Readme File](#project-readme-file) (`GET`, `PUT`, `DELETE`)
  156. **Version 12**:
  157. * New endpoints
  158. - `POST /api/12/executions/delete`
  159. - [Bulk delete executions](#bulk-delete-executions)
  160. * Updated endpoints
  161. - `DELETE /api/12/execution/[ID]`
  162. - [Delete an execution](#delete-an-execution)
  163. - `DELETE /api/12/job/[ID]/executions`
  164. - [Delete all executions for a job](#delete-all-executions-for-a-job)
  165. - `POST /api/12/job/[ID]/executions`
  166. - [Run a Job](#running-a-job)
  167. **Version 11**:
  168. **Update**: The URL path for Token access was corrected.
  169. In this version, all new and updated endpoints support XML or JSON request and response content where appropriate.
  170. **Modified XML Response format**:
  171. - For endpoints requiring API version 11 *only*, the default for XML responses is to *no longer* include a `<result>` element around the data.
  172. - For API clients that expect to see the `<result>` element, a request header of `X-Rundeck-API-XML-Response-Wrapper: true` will restore it.
  173. - For endpoint requests for API version 10 and earlier, the `<result>` element will be sent as it has been (described in [Response Format][])
  174. [Response Format]: #response-format
  175. **Version 11**:
  176. * New endpoints
  177. - `/api/11/project/[PROJECT]/config`
  178. - PUT and GET for [Project Configuration](#project-configuration)
  179. - `/api/11/project/[PROJECT]/config/[KEY]`
  180. + PUT, GET, DELETE for [Project Configuration Keys](#project-configuration-keys)
  181. - `/api/11/project/[PROJECT]/export`
  182. + GET to retrieve archive of a project - [Project Archive Export](#project-archive-export)
  183. - `/api/11/project/[PROJECT]/import`
  184. + PUT to import an archive to a project - [Project Archive Import](#project-archive-import)
  185. - `/api/11/storage/keys/[PATH]`
  186. + GET, POST, PUT, DELETE: manage stored keys - [Key Storage](#key-storage)
  187. - `/api/11/tokens`
  188. + GET: List all auth tokens - [List Tokens](#list-tokens)
  189. + POST: Generate a token for a user - [Create a Token](#create-a-token)
  190. - `/api/11/tokens/[user]`
  191. + GET: List auth tokens defined for a user - [List Tokens](#list-tokens)
  192. + POST: Generate a token for a user - [Create a Token](#create-a-token)
  193. - `/api/11/token/[tokenID]`
  194. + GET: get a token - [Get a token](#get-a-tokens)
  195. + DELETE: delete a token - [Delete a Token](#delete-a-token)
  196. * Updated endpoints
  197. - `/api/11/project/[PROJECT]`
  198. + DELETE method can delete a project - [Project Deletion](#project-deletion)
  199. + GET method response updated - [Getting Project Info](#getting-project-info)
  200. - `/api/11/projects`
  201. + POST method can be used to create a new project - [Project creation](#project-creation)
  202. **Version 10**:
  203. * New endpoints
  204. - `/api/10/execution/[ID]/state` - [Execution State](#execution-state)
  205. + Retrieve workflow step and node state information
  206. - `/api/10/execution/[ID]/output/state` - [Execution Output with State](#execution-output-with-state)
  207. + Retrieve log output with state change information
  208. - `/api/10/execution/[ID]/output/node/[NODENAME]` and `/api/10/execution/[ID]/output/step/[STEPCTX]` - [Execution Output](#execution-output)
  209. + Retrieve log output for a particular node or step
  210. + Can combine both node and step context
  211. * Updated endpoints
  212. - `/api/10/execution/[ID]` - [Execution Info](#execution-info)
  213. + added `successfulNodes` and `failedNodes` detail.
  214. + added `job/options` data
  215. **Version 9**:
  216. * Updated endpoints
  217. * `/api/9/executions/running` - [Listing Running Executions](#listing-running-executions)
  218. * Allow `project=*` to list running executions across all projects
  219. * Result data now includes `project` attribute for each `<execution>`.
  220. * `/api/9/jobs/import` - [Importing Jobs](#importing-jobs)
  221. * Add `uuidOption` parameter to allow removing imported UUIDs to avoid creation conflicts.
  222. **Version 8**:
  223. * Updated endpoints
  224. * `/api/8/run/script` and `/api/8/run/url` - [Running Adhoc Scripts](#running-adhoc-scripts) and [Running Adhoc Script URLs](#running-adhoc-script-urls)
  225. * Added two optional parameters for `scriptInterpreter` and `interpreterArgsQuoted`
  226. * `/api/8/jobs/import` - [Importing Jobs](#importing-jobs)
  227. * Added an optional parameter `project` which will override any project defined in the Job definition contexts. If used, the job definitions do not need a `project` value in them.
  228. * Removed endpoints
  229. * `/api/1/report/create`
  230. * Removed due to History no longer supporting arbitrary event reports.
  231. **Version 7**:
  232. * Add **Incubator** endpoint
  233. * PUT `/api/7/incubator/jobs/takeoverSchedule` - [Takeover Schedule in Cluster Mode](#takeover-schedule-in-cluster-mode)
  234. * incubating feature for cluster mode schedule takeover
  235. **Version 6**:
  236. * Updated endpoints
  237. * `/api/6/execution/[ID]/output` - [Execution Output](#execution-output)
  238. * XML format has changed for API v6: entry log content is now specified as a `log` attribute value
  239. * The old XML format will still be used for queries using `/api/5`
  240. * Fixed invalid XML when no format was specified and XML was used by default
  241. * **documentation typo fixed**: the JSON format incorrectly specified the log text key as 'mesg', corrected to 'log'
  242. **Version 5**:
  243. Added in Rundeck 1.4.6, 1.5.1:
  244. * New feature for some endpoints:
  245. * new `asUser` parameter can record an action (run or abort) as having been performed by another user
  246. * Affected endpoints
  247. * [Running a Job](#running-a-job)
  248. * [Running Adhoc Commands](#running-adhoc-commands)
  249. * [Running Adhoc Scripts](#running-adhoc-scripts)
  250. * [Running Adhoc Script URLs](#running-adhoc-script-urls)
  251. * [Aborting Executions](#aborting-executions)
  252. * New endpoint
  253. * `/api/5/jobs/delete` - [Bulk Job Delete](#bulk-job-delete)
  254. * New endpoint
  255. * `/api/5/execution/[ID]/output` - [Execution Output](#execution-output)
  256. * New endpoint
  257. * `/api/5/executions` - [Execution Query](#execution-query)
  258. * Updated endpoints
  259. * `/api/1/history` - [Listing History](#listing-history)
  260. * new filter parameters added for including or excluding reports for exact job group/name values: `jobListFilter` and `excludeJobListFilter`
  261. **Version 4**:
  262. * New endpoint
  263. * `/api/4/run/url` - [Running Adhoc Script URLs](#running-adhoc-script-urls)
  264. **Version 3**:
  265. * Updated endpoints
  266. * `/api/1/resources` - [Listing Resources](#listing-resources)
  267. * `format` parameter can now use any supported Resource Format Parser format name.
  268. * `/api/2/project/[PROJECT]/resources` - [Updating and Listing Resources for a Project](#updating-and-listing-resources-for-a-project)
  269. * `POST` request Content-Type can be any MIME type supported by a Resource Format Parser plugin.
  270. **Version 2**:
  271. * New endpoints
  272. * `/api/2/project/[PROJECT]/jobs` - [Listing Jobs for a Project](#listing-jobs-for-a-project)
  273. * `/api/2/project/[PROJECT]/resources` - [Updating and Listing Resources for a Project](#updating-and-listing-resources-for-a-project)
  274. * `/api/2/project/[PROJECT]/resources/refresh` - [Refreshing Resources for a Project](#refreshing-resources-for-a-project)
  275. * Updated endpoints
  276. * `/api/1/jobs` - [Listing Jobs](#listing-jobs)
  277. * Additional parameters added
  278. ## URLs
  279. The Rundeck server has a "Base URL", where you access the server. Your Rundeck Server URL may look like: `http://myserver:4440`.
  280. The root URL path for all calls to the API in this version is:
  281. $RUNDECK_SERVER_URL/api/2
  282. ## XML and JSON
  283. The API supports both XML and JSON. Some import/export features support YAML or `text/plain` formatted documents, but XML and JSON are used for all API-level information.
  284. As of API version 14, all endpoints support JSON format, with content type `application/json`, with one exception ([/api/V/project/[PROJECT]/jobs/export][]).
  285. JSON results can be retrieved by sending the HTTP "Accept" header with a `application/json` value. JSON request content is supported when the HTTP "Content-Type" header specifies `application/json`.
  286. If an "Accept" header is not specified, then the response will be either the same format as the request content (for POST, or PUT requests), or XML by default.
  287. Some endpoints also support using a `format` query parameter to specify the expected output format.
  288. ## Authentication
  289. Authentication can be done in two different ways, either with Token based authentication,
  290. or with a username and password.
  291. Note that in either case, **it is recommended that you enable SSL Support for the Rundeck server** so that communication is encrypted at all times. For more information about using SSL, see [Administration - Configuring Rundeck for SSL](../administration/configuring-ssl.html).
  292. ### Token Authentication
  293. Token Authentication consists of including a string known as an "API Token" with every
  294. request to the Rundeck API.
  295. To obtain an API Token, you must first log in to the Rundeck GUI using a user account
  296. that has "admin" credentials. Click on your username in the header of the page, and you will be shown your User Profile page. From this page you can manage your API Tokens. Click "Generate API Token" to create a new one. The unique string that is shown is the API Token.
  297. Alternately you can define tokens in static file, by setting the `rundeck.tokens.file` in [framework.properties](../administration/configuration-file-reference.html#framework.properties).
  298. You must include one of the following with every HTTP request to the API:
  299. * HTTP Header `X-Rundeck-Auth-Token` set to the API Token string
  300. OR
  301. * HTTP URL Parameter `authtoken` set to the API Token string
  302. With that in place, you can make calls to the API as described in the rest of this
  303. document, and you don't need to maintain any cookies between requests.
  304. Examples:
  305. Using the URL parameter to request the project list:
  306. GET /api/1/projects?authtoken=E4rNvVRV378knO9dp3d73O0cs1kd0kCd HTTP/1.1
  307. ...
  308. Using the HTTP Header:
  309. GET /api/1/projects HTTP/1.1
  310. X-Rundeck-Auth-Token: E4rNvVRV378knO9dp3d73O0cs1kd0kCd
  311. ...
  312. ### Password Authentication
  313. If using Password Authentication, you must perform the authentication steps prior to accessing the API.
  314. This means that you must submit authentication parameters (username, password) to the "Authentication URL" and retain a Session Cookie.
  315. The Session Cookie must be sent with all calls to the API to maintain the authenticated connection.
  316. To submit authentication, submit a `POST` request to the URL:
  317. $RUNDECK_SERVER_URL/j_security_check
  318. With these parameters:
  319. * `j_username`: rundeck username
  320. * `j_password`: password
  321. If the response includes a redirect chain which includes or results in `$RUNDECK_SERVER_URL/user/login` or `$RUNDECK_SERVER_URL/user/error`, then the authentication request failed.
  322. Otherwise, if the response is a redirect chain which results in `200 successful` response, then the authentication was successful.
  323. The response should set a cookie named `JSESSIONID`.
  324. ## XML Response Format
  325. For version 11 and later API requests, XML responses will have only the content indicated in the appropriate endpoint documentation.
  326. For version 10 and earlier API requests, XML responses will have this document structure:
  327. ~~~~~~~~~~~~ {.xml}
  328. <result success/error="true" apiversion="X">
  329. <!-- error included if error="true" -->
  330. <error>
  331. <message><!-- error message text --></message>
  332. <!-- ... multiple message elements -->
  333. </error>
  334. <!-- optional success element if declared for the endpoint -->
  335. <success>
  336. <message><!-- success message --></message>
  337. </success>
  338. <!--
  339. Specific API results..
  340. -->
  341. </result>
  342. ~~~~~~~~~~~~
  343. If an error occurred, then the `error` attribute of the `<result>` element will be "true". Otherwise a `success` attribute will have the value "true".
  344. Some `<error>` responses will include a `code` attribute giving a specific type
  345. of error code, in addition to the message.
  346. The `apiversion` attribute will be set to the latest version of the API
  347. supported by the server.
  348. ### Error codes ###
  349. Defined error codes that may be returned as `<error code="...">`
  350. `api-version-unsupported`
  351. : The specified API version is not supported for the requested resource
  352. `unauthorized`
  353. : The requested action is not authorized and/or the connection is not authenticated.
  354. ### Item Lists ###
  355. Many API requests will return an item list as a result. These are typically in the form:
  356. <[items] count="x">
  357. <[item] ...>
  358. <[item] ...>
  359. </[items]>
  360. Where the list of specific items are wrapped in a pluralized element name which contains a `count` attribute.
  361. When an API path declares its results as an "Item List" this is the format that will be returned.
  362. # API Contents
  363. ## Authentication Tokens ###
  364. Authentication tokens can be managed via the API itself.
  365. ### List Tokens ####
  366. List all tokens or all tokens for a specific user.
  367. **Request:**
  368. GET /api/11/tokens
  369. GET /api/11/tokens/[USER]
  370. **Response:**
  371. `application/xml`:
  372. All users:
  373. ~~~~ {.xml}
  374. <tokens count='3' allusers='true'>
  375. <token id='DRUVEuCdENoPkUpDkcDcdd6PeKkPdurc' user='alice' />
  376. <token id='VprOpDeDP3KcK2dp37p5DoD6o53cc82D' user='bob' />
  377. <token id='EveKe1KSRORnUN28D09eERDN3OvO4S6N' user='frank' />
  378. </tokens>
  379. ~~~~
  380. For a specific user:
  381. ~~~~ {.xml}
  382. <tokens count='1' user='alice'>
  383. <token id='DRUVEuCdENoPkUpDkcDcdd6PeKkPdurc' user='alice' />
  384. </tokens>
  385. ~~~~
  386. `application/json`:
  387. ~~~~ {.json}
  388. [
  389. {
  390. "user": "alice",
  391. "id": "DRUVEuCdENoPkUpDkcDcdd6PeKkPdurc"
  392. },
  393. {
  394. "user": "bob",
  395. "id": "VprOpDeDP3KcK2dp37p5DoD6o53cc82D"
  396. },
  397. {
  398. "user": "frank",
  399. "id": "EveKe1KSRORnUN28D09eERDN3OvO4S6N"
  400. }
  401. ]
  402. ~~~~
  403. ### Get a token ####
  404. Get a specified auth token.
  405. **Request:**
  406. GET /api/11/token/[ID]
  407. Response:
  408. `application/xml`
  409. ~~~~ {.xml}
  410. <token id='DuV0UoDUDkoR38Evd786cdRsed6uSNdP' user='alice' />
  411. ~~~~
  412. `application/json`
  413. ~~~~ {.json}
  414. {
  415. "user": "alice",
  416. "id": "DuV0UoDUDkoR38Evd786cdRsed6uSNdP"
  417. }
  418. ~~~~
  419. ### Create a Token ####
  420. Create a new token for a specific user.
  421. **Request:**
  422. POST /api/11/tokens
  423. POST /api/11/tokens/[USER]
  424. The user specified must either be part of the URL, or be part of the request content. If used in the URL, then the request content is ignored and can be empty.
  425. `Content-type: application/xml`
  426. ~~~~ {.xml}
  427. <user user="alice"/>
  428. ~~~~
  429. `Content-type: application/json`
  430. ~~~~ {.json}
  431. { "user" : "alice" }
  432. ~~~~
  433. Response:
  434. `application/xml`
  435. ~~~~ {.xml}
  436. <token id='DuV0UoDUDkoR38Evd786cdRsed6uSNdP' user='alice' />
  437. ~~~~
  438. `application/json`
  439. ~~~~ {.json}
  440. {
  441. "user": "alice",
  442. "id": "DuV0UoDUDkoR38Evd786cdRsed6uSNdP"
  443. }
  444. ~~~~
  445. ### Delete a token ####
  446. Delete a specified auth token.
  447. **Request:**
  448. DELETE /api/11/token/[ID]
  449. Response:
  450. 204 No Content
  451. ## System Info ###
  452. Get Rundeck server information and stats.
  453. **Request:**
  454. GET /api/14/system/info
  455. Parameters: none
  456. **Response:**
  457. Success response, with included system info and stats in this format:
  458. `Content-Type: application/xml`:
  459. ~~~~~~~~~~~~~ {.xml}
  460. <system>
  461. <timestamp epoch="1305909785806" unit="ms">
  462. <datetime>2011-05-20T16:43:05Z</datetime>
  463. </timestamp>
  464. <rundeck>
  465. <version>1.2.1</version>
  466. <apiversion>2</apiversion>
  467. <build>1.2.1-0-beta</build>
  468. <node>Venkman.local</node>
  469. <base>/Users/greg/rundeck121</base>
  470. <serverUUID>3E43E30D-F3D7-45AA-942A-04D5BAFED8CA</serverUUID>
  471. </rundeck>
  472. <executions active="true" executionMode="active" />
  473. <os>
  474. <arch>x86_64</arch>
  475. <name>Mac OS X</name>
  476. <version>10.6.7</version>
  477. </os>
  478. <jvm>
  479. <name>Java HotSpot(TM) 64-Bit Server VM</name>
  480. <vendor>Apple Inc.</vendor>
  481. <version>19.1-b02-334</version>
  482. </jvm>
  483. <stats>
  484. <uptime duration="300584" unit="ms">
  485. <since epoch="1305909485222" unit="ms">
  486. <datetime>2011-05-20T16:38:05Z</datetime>
  487. </since>
  488. </uptime>
  489. <cpu>
  490. <loadAverage unit="percent">0.40234375</loadAverage>
  491. <processors>4</processors>
  492. </cpu>
  493. <memory unit="byte">
  494. <max>477233152</max>
  495. <free>76626216</free>
  496. <total>257163264</total>
  497. </memory>
  498. <scheduler>
  499. <running>0</running>
  500. <threadPoolSize>10</threadPoolSize>
  501. </scheduler>
  502. <threads>
  503. <active>24</active>
  504. </threads>
  505. </stats>
  506. <metrics href='http://dignan:4440/metrics/metrics?pretty=true' contentType='text/json' />
  507. <threadDump href='http://dignan:4440/metrics/threads' contentType='text/plain' />
  508. </system>
  509. ~~~~~~~~~~~~~~~
  510. `Content-Type: application/json`:
  511. ~~~~~~~~~~~~~ {.json}
  512. {
  513. "system": {
  514. "timestamp": {
  515. "epoch": 1431975278220,
  516. "unit": "ms",
  517. "datetime": "2015-05-18T18:54:38Z"
  518. },
  519. "rundeck": {
  520. "version": "2.5.2-SNAPSHOT",
  521. "build": "2.5.2-0-SNAPSHOT",
  522. "node": "madmartigan.local",
  523. "base": "/Users/greg/rundeck25",
  524. "apiversion": 14,
  525. "serverUUID": null
  526. },
  527. "executions":{
  528. "active":true,
  529. "executionMode":"active"
  530. },
  531. "os": {
  532. "arch": "x86_64",
  533. "name": "Mac OS X",
  534. "version": "10.10.3"
  535. },
  536. "jvm": {
  537. "name": "Java HotSpot(TM) 64-Bit Server VM",
  538. "vendor": "Oracle Corporation",
  539. "version": "1.7.0_71",
  540. "implementationVersion": "24.71-b01"
  541. },
  542. "stats": {
  543. "uptime": {
  544. "duration": 546776,
  545. "unit": "ms",
  546. "since": {
  547. "epoch": 1431974731444,
  548. "unit": "ms",
  549. "datetime": "2015-05-18T18:45:31Z"
  550. }
  551. },
  552. "cpu": {
  553. "loadAverage": {
  554. "unit": "percent",
  555. "average": 2.689453125
  556. },
  557. "processors": 8
  558. },
  559. "memory": {
  560. "unit": "byte",
  561. "max": 716177408,
  562. "free": 138606040,
  563. "total": 527958016
  564. },
  565. "scheduler": {
  566. "running": 0,
  567. "threadPoolSize": 10
  568. },
  569. "threads": {
  570. "active": 35
  571. }
  572. },
  573. "metrics": {
  574. "href": "http://madmartigan.local:4440/metrics/metrics?pretty=true",
  575. "contentType": "text/json"
  576. },
  577. "threadDump": {
  578. "href": "http://madmartigan.local:4440/metrics/threads",
  579. "contentType": "text/plain"
  580. }
  581. }
  582. }
  583. ~~~~~~~~~~~~~
  584. Description of included elements:
  585. `timestamp` describes the current system time known to the server. The `@epoch`
  586. attribute includes the milliseconds since the unix epoch.
  587. `datetime`
  588. : The W3C date and time
  589. `rundeck` includes information about the Rundeck application.
  590. `rundeck/version`
  591. : Rundeck version
  592. `rundeck/apiversion`
  593. : Rundeck API version
  594. `rundeck/build`
  595. : Rundeck build stamp
  596. `rundeck/node`
  597. : Server node name
  598. `rundeck/base`
  599. : Server base directory
  600. `rundeck/serverUUID`
  601. : Server UUID (present if cluster mode is enabled)
  602. `os/arch`
  603. : Operating System architecture
  604. `os/name`
  605. : Operating System Name
  606. `os/version`
  607. : Operating System Version
  608. `jvm/name`
  609. : JVM name
  610. `jvm/vendor`
  611. : JVM vendor
  612. `jvm/version`
  613. : JVM version
  614. `stats` section includes some system statistics:
  615. `uptime` describes the JVM uptime as duration in ms, and includes absolute
  616. startup time:
  617. `uptime/since`
  618. : JVM startup time as time since the unix epoch
  619. `uptime/since/datetime`
  620. : JVM startup time as W3C date time.
  621. `cpu/loadAverage`
  622. : JVM load average percentage for the system for the previous minute (see [getSystemLoadAverage](http://download.oracle.com/javase/6/docs/api/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()))
  623. `cpu/processors`
  624. : Number of available system processors. note that loadAverage might be
  625. calculated based on the total number of available processors
  626. The `memory` section describes memory usage in bytes:
  627. `max`
  628. : Maximum JVM memory that can be allocated
  629. `free`
  630. : Free memory of the allocated memory
  631. `total`
  632. : Total allocated memory for the JVM
  633. `scheduler/running`
  634. : Number of running jobs in the scheduler
  635. `scheduler/threadPoolSize`
  636. : Size of the scheduler threadPool: maximum number of concurrent Rundeck executions
  637. `threads/active`
  638. : Number of active Threads in the JVM
  639. ## Log Storage
  640. ### Log Storage Info
  641. Get Log Storage information and stats.
  642. **Request:**
  643. GET /api/17/system/logstorage
  644. **Response:**
  645. Success response, with log storage info and stats in this format:
  646. `Content-Type: application/xml`:
  647. ~~~ {.xml}
  648. <logStorage enabled="true" pluginName="NAME">
  649. <succeededCount>349</succeededCount>
  650. <failedCount>0</failedCount>
  651. <queuedCount>0</queuedCount>
  652. <totalCount>349</totalCount>
  653. <incompleteCount>0</incompleteCount>
  654. <missingCount>0</missingCount>
  655. </logStorage>
  656. ~~~
  657. `Content-Type: application/json`:
  658. ~~~ {.json}
  659. {
  660. "enabled": true,
  661. "pluginName": "NAME",
  662. "succeededCount": 369,
  663. "failedCount": 0,
  664. "queuedCount": 0,
  665. "totalCount": 369,
  666. "incompleteCount": 0,
  667. "missingCount": 0
  668. }
  669. ~~~
  670. `enabled`
  671. : True if a plugin is configured
  672. `pluginName`
  673. : Name of the configured plugin
  674. `succeededCount`
  675. : Number of successful storage requests
  676. `failedCount`
  677. : Number of failed storage requests
  678. `queuedCount`
  679. : Number of queued storage requests
  680. `totalCount`
  681. : Total number of storage requests (currently queued plus previously processed)
  682. `incompleteCount`
  683. : Number of storage requests which have not completed successfully
  684. `missingCount`
  685. : Number of executions for this cluster node which have no associated storage requests
  686. ### List Executions with Incomplete Log Storage
  687. List all executions with incomplete log storage.
  688. **Request:**
  689. GET /api/17/system/logstorage/incomplete
  690. **Response:**
  691. `Content-Type: application/xml`:
  692. ```xml
  693. <logstorage>
  694. <incompleteExecutions total="[#]" max="20" offset="0">
  695. <execution id="[EXECID]" project="[PROJECT]" href="[API HREF]" permalink="[GUI HREF]">
  696. <storage incompleteFiletypes="[TYPES]" queued="true/false" failed="true/false" date="[DATE]" localFilesPresent="true/false">
  697. <errors>
  698. <message>[error message]</message>
  699. <message>[error message...]</message>
  700. </errors>
  701. </storage>
  702. </execution>
  703. ...
  704. </logstorage>
  705. ```
  706. `Content-Type: application/json`:
  707. ```json
  708. {
  709. "total": #,
  710. "max": 20,
  711. "offset": 0,
  712. "executions": [
  713. {
  714. "id": [EXECID],
  715. "project": "[PROJECT]",
  716. "href": "[API HREF]",
  717. "permalink": "[GUI HREF]",
  718. "storage": {
  719. "localFilesPresent": true/false,
  720. "incompleteFiletypes": "[TYPES]",
  721. "queued": true/false,
  722. "failed": true/false,
  723. "date": "[DATE]"
  724. },
  725. "errors": ["message","message..."]
  726. },
  727. ...
  728. ]
  729. }
  730. ```
  731. `total`, `max`, `offset` (paging information)
  732. : Total number of executions with incomplete log data storage, maximum returned in the response, offset of first result.
  733. `id`
  734. : Execution ID
  735. `project`
  736. : Project Name
  737. `href`
  738. : API URL for Execution
  739. `permalink`
  740. : GUI URL for Execution
  741. `incompleteFiletypes`
  742. : Comma-separated list of filetypes which have not be uploaded, e.g. `rdlog,state.json`. Types are `rdlog` (log output), `state.json` (workflow state data), `execution.xml` (execution definition)
  743. `queued`
  744. : True if the log data storage is queued to be processed.
  745. `failed`
  746. : True if the log data storage was processed but failed without completion.
  747. `date`
  748. : Date when log data storage was first processed. (W3C date format.)
  749. `localFilesPresent`
  750. : True if all local files (`rdlog` and `state.json`) are available for upload. False if one of them is not proesent on disk.
  751. ### Resume Incomplete Log Storage
  752. Resume processing incomplete Log Storage uploads.
  753. **Request:**
  754. POST /api/17/system/logstorage/incomplete/resume
  755. **Response:**
  756. `Content-Type: application/xml`:
  757. ```xml
  758. <logStorage resumed='true' />
  759. ```
  760. `Content-Type: application/json`:
  761. ~~~ {.json}
  762. {
  763. "resumed": true
  764. }
  765. ~~~
  766. ## Execution Mode ##
  767. Change the server execution mode to ACTIVE or PASSIVE. The state of the current
  768. execution mode can be viewed via the [`/api/14/system/info`][/api/V/system/info]
  769. endpoint.
  770. ### Set Active Mode ###
  771. Enables executions, allowing adhoc and manual and scheduled jobs to be run.
  772. **Request:**
  773. POST /api/14/system/executions/enable
  774. **Response**
  775. `Content-Type: application/xml`:
  776. ~~~ {.xml}
  777. <executions executionMode="active"/>
  778. ~~~
  779. `Content-Type: application/json`:
  780. ~~~ {.json}
  781. {
  782. "executionMode":"active"
  783. }
  784. ~~~
  785. ### Set Passive Mode ###
  786. Disables executions, preventing adhoc and manual and scheduled jobs from running.
  787. **Request:**
  788. POST /api/14/system/executions/disable
  789. **Response**
  790. `Content-Type: application/xml`:
  791. ~~~ {.xml}
  792. <executions executionMode="passive"/>
  793. ~~~
  794. `Content-Type: application/json`:
  795. ~~~ {.json}
  796. {
  797. "executionMode":"passive"
  798. }
  799. ~~~
  800. ## Cluster Mode
  801. ### Takeover Schedule in Cluster Mode
  802. Tell a Rundeck server in cluster mode to claim all scheduled jobs from another
  803. cluster server.
  804. This endpoint can take over the schedule of certain jobs based on the input:
  805. * specify a server `uuid`: take over all jobs from that server
  806. * specify server `all` value of `true`: take over all jobs regardless of server UUID
  807. Additionally, you can specify a `project` name to take over only jobs matching
  808. the given project name, in combination with the server options.
  809. Alternately, specify a job ID to takeover only a single Job's schedule.
  810. **Request**
  811. PUT /api/14/scheduler/takeover
  812. Either XML or JSON request.
  813. `Content-Type: application/xml`:
  814. XML Document containing:
  815. * `<takeoverSchedule>` top level element
  816. * optional `<server>` element, with one of required attributes:
  817. * `uuid` server UUID to take over from
  818. * `all` value of `true` to take over from all servers
  819. * optional `<project>` element, required attribute: `name`
  820. * optional `<job`> element, with attribute:
  821. * `id` Job UUID to take over.
  822. Example for a single server UUID:
  823. ~~~ {.xml}
  824. <takeoverSchedule>
  825. <server uuid="[UUID]" />
  826. </takeoverSchedule>
  827. ~~~
  828. Example for all servers:
  829. ~~~ {.xml}
  830. <takeoverSchedule>
  831. <server all="true"/>
  832. </takeoverSchedule>
  833. ~~~
  834. Example for all servers and a specific project:
  835. ~~~ {.xml}
  836. <takeoverSchedule>
  837. <server all="true"/>
  838. <project name="[PROJECT]"/>
  839. </takeoverSchedule>
  840. ~~~
  841. Example for a single Job:
  842. ~~~ {.xml}
  843. <takeoverSchedule>
  844. <job id="[UUID]"/>
  845. </takeoverSchedule>
  846. ~~~
  847. **Note**: The `<server>` element can be the root of the document request for backwards compatibility.
  848. `Content-Type: application/json`:
  849. A JSON object.
  850. * optional `server` entry, with one of these required entries:
  851. * `uuid` server UUID to take over from
  852. * `all` value of `true` to take over from all servers
  853. * optional `project` entry, specifying a project name
  854. * optional `job` entry, with required entry:
  855. * `id` Job UUID
  856. ~~~ {.json}
  857. {
  858. "server": {
  859. "uuid": "[UUID]",
  860. "all": true
  861. },
  862. "project": "[PROJECT]"
  863. }
  864. ~~~
  865. Specify a job id:
  866. ~~~ {.json}
  867. {
  868. "job": {
  869. "id": "[UUID]"
  870. }
  871. }
  872. ~~~
  873. **Response:**
  874. If request was XML, then Standard API response containing the following additional elements:
  875. * `takeoverSchedule`
  876. * `self`
  877. * `server`
  878. * `@uuid` - this cluster server's UUID
  879. * `server`
  880. * `@uuid` - requested server UUID to take over, if specifed in the request
  881. * `@all` - `true` if requested
  882. * `project` - name of project, if specified in request
  883. * `job`
  884. * `@id` - requested job UUID to take over, if specifed in the request
  885. * `jobs` - set of successful and failed jobs taken over
  886. * `successful`/`failed` - job set
  887. * `@count` number of jobs in the set
  888. * `job` - one element for each job
  889. * `@id` Job ID
  890. * `@href` Job API HREF
  891. * `@permalink` Job GUI HREF
  892. * `@previous-owner` UUID of the cluster server that was the previous schedule owner
  893. Example XML Response, when `uuid` was specified:
  894. ~~~~~~~~~~ {.xml}
  895. <takeoverSchedule>
  896. <self>
  897. <server uuid='C677C663-F902-4B97-B8AC-4AA57B58DDD6' />
  898. </self>
  899. <server uuid='8F3D5976-2232-4529-847B-8E45764608E3' />
  900. <jobs total='2'>
  901. <successful count='2'>
  902. <job id='a1aa53ac-73a6-4ead-bbe4-34afbff8e057'
  903. href='http://localhost:9090/api/14/job/a1aa53ac-73a6-4ead-bbe4-34afbff8e057'
  904. permalink='http://localhost:9090/rundeck/job/show/a1aa53ac-73a6-4ead-bbe4-34afbff8e057'
  905. previous-owner="8F3D5976-2232-4529-847B-8E45764608E3" />
  906. <job id='116e2025-7895-444a-88f7-d96b4f19fdb3'
  907. href='http://localhost:9090/api/14/job/116e2025-7895-444a-88f7-d96b4f19fdb3'
  908. permalink='http://localhost:9090/rundeck/job/show/116e2025-7895-444a-88f7-d96b4f19fdb3'
  909. previous-owner="8F3D5976-2232-4529-847B-8E45764608E3" />
  910. </successful>
  911. <failed count='0'></failed>
  912. </jobs>
  913. </takeoverSchedule>
  914. ~~~~~~~~~~
  915. Example XML Response, when `all` was specified:
  916. ~~~~~~~~~~ {.xml}
  917. <takeoverSchedule>
  918. <self>
  919. <server uuid='C677C663-F902-4B97-B8AC-4AA57B58DDD6' />
  920. </self>
  921. <server all='true' />
  922. <jobs total='2'>
  923. ...
  924. </jobs>
  925. </takeoverSchedule>
  926. ~~~~~~~~~~
  927. Example XML Response, when `project` was specified:
  928. ~~~~~~~~~~ {.xml}
  929. <takeoverSchedule>
  930. <self>
  931. <server uuid='C677C663-F902-4B97-B8AC-4AA57B58DDD6' />
  932. </self>
  933. <project name='My Project' />
  934. <jobs total='2'>
  935. ...
  936. </jobs>
  937. </takeoverSchedule>
  938. ~~~~~~~~~~
  939. JSON response for `uuid` specified:
  940. ~~~~~~~~~~ {.json}
  941. {
  942. "takeoverSchedule": {
  943. "jobs": {
  944. "failed": [],
  945. "successful": [
  946. {
  947. "href": "http://dignan:4440/api/14/job/a1aa53ac-73a6-4ead-bbe4-34afbff8e057",
  948. "permalink": "http://dignan:4440/job/show/a1aa53ac-73a6-4ead-bbe4-34afbff8e057",
  949. "id": "a1aa53ac-73a6-4ead-bbe4-34afbff8e057",
  950. "previous-owner": "8F3D5976-2232-4529-847B-8E45764608E3"
  951. },
  952. {
  953. "href": "http://dignan:4440/api/14/job/116e2025-7895-444a-88f7-d96b4f19fdb3",
  954. "permalink": "http://dignan:4440/job/show/116e2025-7895-444a-88f7-d96b4f19fdb3",
  955. "id": "116e2025-7895-444a-88f7-d96b4f19fdb3",
  956. "previous-owner": "8F3D5976-2232-4529-847B-8E45764608E3"
  957. }
  958. ],
  959. "total": 2
  960. },
  961. "server": {
  962. "uuid": "8F3D5976-2232-4529-847B-8E45764608E3"
  963. }
  964. },
  965. "self": {
  966. "server": {
  967. "uuid": "C677C663-F902-4B97-B8AC-4AA57B58DDD6"
  968. }
  969. },
  970. "message": "Schedule Takeover successful for 2/2 Jobs.",
  971. "apiversion": 14,
  972. "success": true
  973. }
  974. ~~~~~~~~~~
  975. JSON response for `all` specified:
  976. ~~~~~~~~~~ {.json}
  977. {
  978. "takeoverSchedule": {
  979. "jobs": {
  980. ...
  981. "total": 2
  982. },
  983. "server": {
  984. "all": true
  985. }
  986. },
  987. "self": {
  988. "server": {
  989. "uuid": "C677C663-F902-4B97-B8AC-4AA57B58DDD6"
  990. }
  991. },
  992. "message": "Schedule Takeover successful for 2/2 Jobs.",
  993. "apiversion": 14,
  994. "success": true
  995. }
  996. ~~~~~~~~~~
  997. JSON response for `project` specified:
  998. ~~~~~~~~~~ {.json}
  999. {
  1000. "takeoverSchedule": {
  1001. "jobs": {
  1002. ...
  1003. "total": 2
  1004. },
  1005. "project": "My Project"
  1006. },
  1007. "self": {
  1008. "server": {
  1009. "uuid": "C677C663-F902-4B97-B8AC-4AA57B58DDD6"
  1010. }
  1011. },
  1012. "message": "Schedule Takeover successful for 2/2 Jobs.",
  1013. "apiversion": 14,
  1014. "success": true
  1015. }
  1016. ~~~~~~~~~~
  1017. ### List Scheduled Jobs For a Cluster Server
  1018. List the scheduled Jobs with their schedule owned by the cluster server with the specified UUID.
  1019. **Request**
  1020. GET /api/17/scheduler/server/[UUID]/jobs
  1021. **Response**
  1022. The same format as [Listing Jobs](#listing-jobs).
  1023. ### List Scheduled Jobs For this Cluster Server
  1024. List the scheduled Jobs with their schedule owned by the target cluster server.
  1025. **Request**
  1026. GET /api/17/scheduler/jobs
  1027. **Response**
  1028. The same format as [Listing Jobs](#listing-jobs).
  1029. ## ACLs
  1030. Manage the system system ACL policy files stored in the database.
  1031. The files managed via the API **do not** include the files located on disk, however these policy files will be merged with
  1032. any policy files in the normal filesystem locations (e.g. `$RDECK_BASE/etc`).
  1033. **Note:** For Project-specific ACLs see [Project ACLs](#project-acls).
  1034. For more information about ACL Policies see:
  1035. * [ACLPOLICY format][ACLPOLICY]
  1036. * [Access Control Policy](../administration/access-control-policy.html)
  1037. ### List System ACL Policies
  1038. **Request:**
  1039. GET /api/14/system/acl/
  1040. **Response:**
  1041. `Content-Type: application/xml`: A `<resource>` containing more resources within a `<contents>` element:
  1042. ~~~~~~~~~~ {.xml}
  1043. <resource path="" type="directory" href="http://server/api/14/system/acl/">
  1044. <contents>
  1045. <resource path="name.aclpolicy" type="file" href="http://server/api/14/system/acl/name.aclpolicy" name="name.aclpolicy"/>
  1046. </contents>
  1047. </resource>
  1048. ~~~~~~~~~~~~
  1049. `Content-Type: application/json`
  1050. `resources` contains a list of entries for each policy
  1051. ~~~~~~~~~~ {.json}
  1052. {
  1053. "path": "",
  1054. "type": "directory",
  1055. "href": "http://server/api/14/system/acl/",
  1056. "resources": [
  1057. {
  1058. "path": "name.aclpolicy",
  1059. "type": "file",
  1060. "name": "name.aclpolicy",
  1061. "href": "http://server/api/14/system/acl/name.aclpolicy"
  1062. },
  1063. ...
  1064. ]
  1065. }
  1066. ~~~~~~~~~~
  1067. ### Get an ACL Policy
  1068. Retrieve the YAML text of the ACL Policy file. If YAML or text content is requested, the contents will be returned directly.
  1069. Otherwise if XML or JSON is requested, the YAML text will be wrapped within that format.
  1070. **Request:**
  1071. GET /api/14/system/acl/name.aclpolicy
  1072. **Response:**
  1073. `Content-Type: application/yaml` or `Content-Type: text/plain`:
  1074. ~~~~~ {.yaml}
  1075. description: "my policy"
  1076. context:
  1077. application: rundeck
  1078. for:
  1079. project:
  1080. - allow: read
  1081. by:
  1082. group: build
  1083. ~~~~~
  1084. `Content-Type: application/json`:
  1085. ~~~~ {.json}
  1086. {
  1087. "contents": "description: \"my policy\"\ncontext:\n application: rundeck\nfor:\n project:\n - allow: read\nby:\n group: build"
  1088. }
  1089. ~~~~
  1090. `Content-Type: application/xml`: The content is wrapped in a `CDATA` section to preserve whitespace formatting.
  1091. ~~~~ {.xml}
  1092. <contents><![CDATA[description: "my policy"
  1093. context:
  1094. application: rundeck
  1095. for:
  1096. project:
  1097. - allow: read
  1098. by:
  1099. group: build]]></contents>
  1100. ~~~~
  1101. ### Create an ACL Policy
  1102. Use `POST` to create a policy.
  1103. **Request:**
  1104. POST /api/14/system/acl/name.aclpolicy
  1105. If the `Content-Type` is `application/yaml` or `text/plain`, then the request body is the ACL policy contents directly.
  1106. Otherwise, you can use XML or JSON in the same format as returned by [Get an ACL Policy](#get-an-acl-policy):
  1107. `Content-Type: application/json`
  1108. ~~~~ {.json}
  1109. {
  1110. "contents": "description: \"my policy\"\ncontext:\n application: rundeck\nfor:\n project:\n - allow: read\nby:\n group: build"
  1111. }
  1112. ~~~~
  1113. `Content-Type: application/xml`
  1114. ~~~~ {.xml}
  1115. <contents><![CDATA[description: "my policy"
  1116. context:
  1117. application: rundeck
  1118. for:
  1119. project:
  1120. - allow: read
  1121. by:
  1122. group: build]]></contents>
  1123. ~~~~
  1124. **Response:**
  1125. *Successful*
  1126. 201 Created
  1127. The format the response is based on the `Accept:` header, the same format as returned by [Get an ACL Policy](#get-an-acl-policy).
  1128. *Already Exists*
  1129. 409 Conflict
  1130. *Validation Failure*
  1131. 400 Bad Request
  1132. If Validation fails, the response will be `400 Bad Request`, and the body will contain a list of validation errors.
  1133. Because each [ACLPOLICY][] document can contain multiple Yaml documents, each will be listed as a separate policy.
  1134. `Content-Type: application/json`
  1135. ~~~~ {.json}
  1136. {
  1137. "valid": false,
  1138. "policies": [
  1139. {
  1140. "policy": "file1.aclpolicy[1]",
  1141. "errors": [
  1142. "reason...",
  1143. "reason2..."
  1144. ]
  1145. },
  1146. {
  1147. "policy": "file1.aclpolicy[2]",
  1148. "errors": [
  1149. "reason...",
  1150. "reason2..."
  1151. ]
  1152. }
  1153. ]
  1154. }
  1155. ~~~~
  1156. `Content-Type: application/xml`
  1157. ~~~~ {.xml}
  1158. <validation valid="false">
  1159. <policy id="file1.aclpolicy[1]">
  1160. <error>reason text...</error>
  1161. <error>reason2 text...</error>
  1162. </policy>
  1163. <policy id="file1.aclpolicy[2]">
  1164. <error>reason text...</error>
  1165. </policy>
  1166. </validation>
  1167. ~~~~
  1168. ### Update an ACL Policy
  1169. Use `PUT` to update a policy.
  1170. **Request:**
  1171. PUT /api/14/system/acl/name.aclpolicy
  1172. You can use Yaml, XML or JSON in the same request format as used by [Create an ACL Policy](#create-an-acl-policy).
  1173. **Response:**
  1174. *Successful*
  1175. 200 OK
  1176. The same response format as used by [Create an ACL Policy](#create-an-acl-policy).
  1177. *Not Found*
  1178. 404 Not Found
  1179. If the policy does not exist, then a `404 Not Found` response is returned.
  1180. ### Delete an ACL Policy
  1181. Delete an ACL policy file.
  1182. **Request:**
  1183. DELETE /api/14/system/acl/name.aclpolicy
  1184. **Response:**
  1185. *Successful*
  1186. 204 No Content
  1187. *Not Found*
  1188. 404 Not Found
  1189. ## Jobs
  1190. ### Listing Jobs ###
  1191. List the jobs that exist for a project.
  1192. **Request:**
  1193. GET /api/14/project/[PROJECT]/jobs
  1194. (**Deprecated URL**: `/api/14/jobs` with required parameter: `project`.)
  1195. The following parameters can also be used to narrow down the result set.
  1196. * `idlist`: specify a comma-separated list of Job IDs to include
  1197. * `groupPath`: specify a group or partial group path to include all jobs within that group path. (Default value: "*", all groups). Set to the special value "-" to match the top level jobs only
  1198. * `jobFilter`: specify a filter for the job Name. Matches any job name that contains this value.
  1199. * `jobExactFilter`: specify an exact job name to match.
  1200. * `groupPathExact`: specify an exact group path to match. Set to the special value "-" to match the top level jobs only
  1201. * `scheduledFilter`: `true/false` specify whether to return only scheduled or only not scheduled jobs.
  1202. * `serverNodeUUIDFilter`: Value: a UUID. In cluster mode, use to select scheduled jobs assigned to the server with given UUID.
  1203. Note: If neither `groupPath` nor `groupPathExact` are specified, then the default `groupPath` value of "*" will be used (matching jobs in all groups). `groupPathExact` cannot be combined with `groupPath`. You can set either one to "-" to match only the top-level jobs which are not within a group.
  1204. **Response**
  1205. `Content-Type: application/xml`: An Item List of `jobs`. Each `job` is of the form:
  1206. ~~~~~~~~~~ {.xml}
  1207. <job id="ID" href="[API url]" permalink="[GUI URL]" scheduled="true/false" scheduleEnabled="true/false"
  1208. enabled="true/false"
  1209. >
  1210. <name>Job Name</name>
  1211. <group>Job Name</group>
  1212. <project>Project Name</project>
  1213. <description>...</description>
  1214. </job>
  1215. ~~~~~~~~~~~~
  1216. `Content-Type: application/json`
  1217. ~~~~~~~~~~ {.json}
  1218. [
  1219. {
  1220. "id": "[UUID]",
  1221. "name": "[name]",
  1222. "group": "[group]",
  1223. "project": "[project]",
  1224. "description": "...",
  1225. "href": "[API url]",
  1226. "permalink": "[GUI url]",
  1227. "scheduled": true/false,
  1228. "scheduleEnabled": true/false,
  1229. "enabled": true/false
  1230. }
  1231. ]
  1232. ~~~~~~~~~~~~
  1233. **Since v17**:
  1234. * `scheduled` indicates whether the job has a schedule
  1235. * `scheduleEnabled` indicates whether the job's schedule is enabled or not
  1236. * `enabled` indicates whether executions are enabled or not
  1237. In Cluster mode, additional information about what server UUID is the schedule owner will be included:
  1238. * `serverNodeUUID` UUID of the schedule owner server for this job
  1239. * `serverOwner` boolean value whether the target server is the owner, `true/false`.
  1240. `Content-Type: application/xml`:
  1241. ~~~~~~~~~~ {.xml}
  1242. <job id="ID" href="[API url]" permalink="[GUI URL]" scheduled="true/false" scheduleEnabled="true/false"
  1243. enabled="true/false"
  1244. serverNodeUUID="[UUID]"
  1245. serverOwner="true/false"
  1246. >
  1247. <name>Job Name</name>
  1248. <group>Job Name</group>
  1249. <project>Project Name</project>
  1250. <description>...</description>
  1251. </job>
  1252. ~~~~~~~~~~~~
  1253. `Content-Type: application/json`
  1254. ~~~~~~~~~~ {.json}
  1255. [
  1256. {
  1257. "id": "[UUID]",
  1258. "name": "[name]",
  1259. "group": "[group]",
  1260. "project": "[project]",
  1261. "description": "...",
  1262. "href": "[API url]",
  1263. "permalink": "[GUI url]",
  1264. "scheduled": true/false,
  1265. "scheduleEnabled": true/false,
  1266. "enabled": true/false,
  1267. "serverNodeUUID": "[UUID]",
  1268. "serverOwner": true/false
  1269. }
  1270. ]
  1271. ~~~~~~~~~~~~
  1272. ### Running a Job
  1273. Run a job specified by ID.
  1274. **Request:**
  1275. POST /api/1/job/[ID]/run
  1276. POST /api/12/job/[ID]/executions
  1277. Optional parameters:
  1278. * `argString`: argument string to pass to the job, of the form: `-opt value -opt2 value ...`.
  1279. * `loglevel`: argument specifying the loglevel to use, one of: 'DEBUG','VERBOSE','INFO','WARN','ERROR'
  1280. * `asUser` : specifies a username identifying the user who ran the job. Requires `runAs` permission.
  1281. * Node filter parameters as described under [Using Node Filters](#using-node-filters)
  1282. * `filter` can be a node filter string.
  1283. (**API v14**) If the request has `Content-Type: application/json`, then the parameters will be ignored,
  1284. and this format is expected in the content:
  1285. ~~~~~ {.json}
  1286. {
  1287. "argString":"...",
  1288. "loglevel":"...",
  1289. "asUser":"...",
  1290. "filter":"..."
  1291. }
  1292. ~~~~~
  1293. **Response**:
  1294. See [Listing Running Executions](#listing-running-executions).
  1295. ### Exporting Jobs
  1296. Export the job definitions for in XML or YAML formats.
  1297. **Request:**
  1298. GET /api/14/project/[PROJECT]/jobs/export
  1299. (**Deprecated URL**: `/api/14/jobs/export` with required parameter: `project`.)
  1300. Optional parameters:
  1301. * `format` : can be "xml" or "yaml" to specify the output format. Default is "xml"
  1302. The following parameters can also be used to narrow down the result set.
  1303. * `idlist`: specify a comma-separated list of Job IDs to export
  1304. * `groupPath`: specify a group or partial group path to include all jobs within that group path.
  1305. * `jobFilter`: specify a filter for the job Name
  1306. **Response:**
  1307. If you specify `format=xml`, then the output will be in [job-xml](../man5/job-xml.html) format.
  1308. If you specify `format=yaml`, then the output will be in [job-yaml](../man5/job-yaml.html) format.
  1309. If an error occurs, then the output will be in XML format, using the common `result` element described in the [Response Format](#response-format) section.
  1310. ### Importing Jobs ###
  1311. Import job definitions in XML or YAML formats.
  1312. **Request:**
  1313. POST /api/1/project/[PROJECT]/jobs/import
  1314. (**Deprecated URL**: `/api/14/jobs/import` with optional parameter: `project`.)
  1315. Request Content:
  1316. One of the following:
  1317. * `Content-Type: x-www-form-urlencoded`, with a `xmlBatch` request parameter containing the input content
  1318. * `Content-Type: multipart/form-data` multipart MIME request part named `xmlBatch` containing the content.
  1319. * `Content-Type: application/xml`, request body is the Jobs XML formatted job definition (**since API v14**)
  1320. * `Content-Type: application/yaml`, request body is the Jobs YAML formatted job definition (**since API v14**)
  1321. Optional parameters:
  1322. * `fileformat` : can be "xml" or "yaml" to specify the input format, if multipart of form input is sent. Default is "xml"
  1323. * (deprecated: `format` can be used as well, but this will also force the response format to be XML.)
  1324. * `dupeOption`: A value to indicate the behavior when importing jobs which already exist. Value can be "skip", "create", or "update". Default is "create".
  1325. * `uuidOption`: Whether to preserve or remove UUIDs from the imported jobs. Allowed values (**since V9**):
  1326. * `preserve`: Preserve the UUIDs in imported jobs. This may cause the import to fail if the UUID is already used. (Default value).
  1327. * `remove`: Remove the UUIDs from imported jobs. Allows update/create to succeed without conflict on UUID.
  1328. **Response:**
  1329. A set of status results. Each imported job definition will be either "succeeded", "failed" or "skipped". These status sections contain a `count` attribute declaring how many jobs they contain. Within each one there will be 0 or more `job` elements.
  1330. `Content-Type: application/xml`:
  1331. ~~~~~~~~~~ {.xml}
  1332. <succeeded count="x">
  1333. <!-- job elements -->
  1334. </succeeded>
  1335. <failed count="x">
  1336. <!-- job elements -->
  1337. </failed>
  1338. <skipped count="x">
  1339. <!-- job elements -->
  1340. </skipped>
  1341. ~~~~~~~~~~
  1342. Each Job element will be of the form:
  1343. ~~~~~~~~~~ {.xml}
  1344. <job index="x" href="[API url]">
  1345. <!-- ID, href, and permalink may not be present if the job was not created yet -->
  1346. <id>ID</id>
  1347. <permalink>[GUI url]</permalink>
  1348. <name>job name</name>
  1349. <group>job group</group>
  1350. <project>job project</project>
  1351. <!--if within the failed section, then an error section will be included -->
  1352. <error>Error message</error>
  1353. </job>
  1354. ~~~~~~~~~~~~~~
  1355. `Content-Type: application/json`:
  1356. ~~~~~~ {.json}
  1357. {
  1358. "succeeded": [...],
  1359. "failed": [...],
  1360. "skipped": [...]
  1361. }
  1362. ~~~~~~
  1363. Each array may contain a job data object:
  1364. ~~~~~~ {.json}
  1365. {
  1366. "index": 1,
  1367. "href": "http://madmartigan.local:4440/api/14/job/3b6c19f6-41ee-475f-8fd0-8f1a26f27a9a",
  1368. "id": "3b6c19f6-41ee-475f-8fd0-8f1a26f27a9a",
  1369. "name": "restart",
  1370. "group": "app2/dev",
  1371. "project": "test",
  1372. "permalink": "http://madmartigan.local:4440/job/show/3b6c19f6-41ee-475f-8fd0-8f1a26f27a9a"
  1373. }
  1374. ~~~~~~
  1375. * `index`: index in the input content of the job definition.
  1376. * `id`: If the job exists, or was successfully created, its UUID
  1377. * `href`: If the job exists, or was successfully created, its API href
  1378. * `permalink`: If the job exists, or was successfully created, its GUI URL.
  1379. ### Getting a Job Definition ###
  1380. Export a single job definition in XML or YAML formats.
  1381. **Request:**
  1382. GET /api/1/job/[ID]
  1383. Optional parameters:
  1384. * `format` : can be "xml" or "yaml" to specify the output format. Default is "xml"
  1385. **Response:**
  1386. If you specify `format=xml`, then the output will be in [job-xml](../man5/job-xml.html) format.
  1387. If you specify `format=yaml`, then the output will be in [job-yaml](../man5/job-yaml.html) format.
  1388. If an error occurs, then the output will be in XML format, using the common `result` element described in the [Response Format](#response-format) section.
  1389. ### Deleting a Job Definition ###
  1390. Delete a single job definition.
  1391. **Request:**
  1392. DELETE /api/1/job/[ID]
  1393. **Response:**
  1394. 204 No Content
  1395. ### Bulk Job Delete ###
  1396. Delete multiple job definitions at once.
  1397. **Request:**
  1398. DELETE /api/5/jobs/delete
  1399. POST /api/5/jobs/delete
  1400. Either Query parameters:
  1401. * `ids`: The Job IDs to delete, can be specified multiple times
  1402. * `idlist`: The Job IDs to delete as a single comma-separated string.
  1403. Or JSON/XML content:
  1404. `Content-Type: application/json`
  1405. ~~~~~ {.json}
  1406. {
  1407. "ids": [
  1408. "fefa50e1-2265-47af-b101-d4bbaa3ba21c",
  1409. "f07e2311-4dae-40ca-bdfa-412bd223f863"
  1410. ],
  1411. "idlist":"49336998-21a3-42c7-8da3-a855587982e0,a387f77f-a623-45dc-967f-746a2e3f6686"
  1412. }
  1413. ~~~~~
  1414. Note: you can combine `ids` with `idlist`
  1415. `application/xml` response:
  1416. The common `result` element described in the [Response Format](#response-format) section, indicating success or failure and any messages.
  1417. If successful, then the `result` will contain a `deleteJobs` element with two sections of results, `succeeded` and `failed`:
  1418. ~~~~~~~~~~ {.xml}
  1419. <deleteJobs requestCount="#" allsuccessful="true/false">
  1420. <succeeded count="1">
  1421. <deleteJobRequest id="[job ID]">
  1422. <message>[message]</message>
  1423. </deleteJobRequest>
  1424. </succeeded>
  1425. <failed count="1">
  1426. <deleteJobRequest id="[job ID]" errorCode="[code]">
  1427. <error>[message]</error>
  1428. </deleteJobRequest>
  1429. </failed>
  1430. </deleteJobs>
  1431. ~~~~~~~~~~
  1432. `deleteJobs` will have two attributes:
  1433. * `requestCount`: the number of job IDs that were in the delete request
  1434. * `allsuccessful`: true/false: true if all job deletes were successful, false otherwise.
  1435. The response may contain only one of `succeeded` or `failed`, depending on the result.
  1436. The `succeeded` and `failed` sections contain multiple `deleteJobRequest` elements.
  1437. Each `deleteJobRequest` under the `succeeded` section will contain:
  1438. * `id` attribute - the Job ID
  1439. * `message` sub-element - result message for the delete request
  1440. Each `deleteJobRequest` under the `failed` section will contain:
  1441. * `id` attribute - the Job ID
  1442. * `error` sub-element - result error message for the delete request
  1443. * `errorCode` attribute - a code indicating the type of failure, currently one of `failed`, `unauthorized` or `notfound`.
  1444. `application/json` response:
  1445. ~~~~~~ {.json}
  1446. {
  1447. "requestCount": #integer#,
  1448. "allsuccessful": true/false,
  1449. "succeeded": [...],
  1450. "failed":[...]
  1451. }
  1452. ~~~~~~
  1453. The list of succeeded/failed will contain objects of this form:
  1454. ~~~~~~ {.json}
  1455. {
  1456. "id": "[UUID]",
  1457. "errorCode": "(error code, see above)",
  1458. "message": "(success or failure message)"
  1459. }
  1460. ~~~~~~
  1461. ### Enable Executions for a Job
  1462. Enable executions for a job. (ACL requires `toggle_execution` action for a job.)
  1463. **Request:**
  1464. POST /api/14/job/[ID]/execution/enable
  1465. **Response:**
  1466. `application/xml`
  1467. ~~~{.xml}
  1468. <success>true</success>
  1469. ~~~
  1470. `application/json`
  1471. ~~~{.json}
  1472. {"success":true}
  1473. ~~~
  1474. ### Disable Executions for a Job
  1475. Disable all executions for a job (scheduled or manual). (ACL requires `toggle_execution` action for a job.)
  1476. **Request:**
  1477. POST /api/14/job/[ID]/execution/disable
  1478. **Response:**
  1479. (See [Enable Executions for a Job](#enable-executions-for-a-job).)
  1480. ### Enable Scheduling for a Job
  1481. Enable the schedule for a job. (ACL requires `toggle_schedule` action for a job.)
  1482. **Request:**
  1483. POST /api/14/job/[ID]/schedule/enable
  1484. **Response:**
  1485. (See [Enable Executions for a Job](#enable-executions-for-a-job).)
  1486. ### Disable Scheduling for a Job
  1487. Disable the schedule for a job. (ACL requires `toggle_schedule` action for a job.)
  1488. **Request:**
  1489. POST /api/14/job/[ID]/schedule/disable
  1490. **Response:**
  1491. (See [Enable Executions for a Job](#enable-executions-for-a-job).)
  1492. ### Bulk Toggle Job Execution
  1493. Toggle whether executions are enabled for a set of jobs. (ACL requires `toggle_execution` action for each job.)
  1494. Executions will be enabled or disabled, depending on the URL used:
  1495. **Request:**
  1496. POST /api/14/jobs/execution/enable
  1497. POST /api/14/jobs/execution/disable
  1498. Query parameters:
  1499. * `ids`: The Job IDs to delete, can be specified multiple times
  1500. * `idlist`: The Job IDs to delete as a single comma-separated string.
  1501. Or JSON/XML content:
  1502. `Content-Type: application/json`
  1503. ~~~~~ {.json}
  1504. {
  1505. "ids": [
  1506. "fefa50e1-2265-47af-b101-d4bbaa3ba21c",
  1507. "f07e2311-4dae-40ca-bdfa-412bd223f863"
  1508. ],
  1509. "idlist":"49336998-21a3-42c7-8da3-a855587982e0,a387f77f-a623-45dc-967f-746a2e3f6686"
  1510. }
  1511. ~~~~~
  1512. Note: you can combine `ids` with `idlist`.
  1513. **Response:**
  1514. If successful, then the `result` will contain a `toggleExecution` element with two sections of results, `succeeded` and `failed`:
  1515. ~~~~~~~~~~ {.xml}
  1516. <toggleExecution enabled="true" requestCount="#" allsuccessful="true/false">
  1517. <succeeded count="1">
  1518. <toggleExecutionResult id="[job ID]">
  1519. <message>[message]</message>
  1520. </toggleExecutionResult>
  1521. </succeeded>
  1522. <failed count="1">
  1523. <toggleExecutionResult id="[job ID]" errorCode="[code]">
  1524. <error>[message]</error>
  1525. </toggleExecutionResult>
  1526. </failed>
  1527. </toggleExecution>
  1528. ~~~~~~~~~~
  1529. `toggleExecution` has these attributes:
  1530. * `enabled`: `true` or `false`, depending on whether `enable` or `disable` was requested.
  1531. * `requestCount`: the number of job IDs that were in the request
  1532. * `allsuccessful`: true/false: true if all modifications were successful, false otherwise.
  1533. The response may contain only one of `succeeded` or `failed`, depending on the result.
  1534. The `succeeded` and `failed` sections contain multiple `toggleExecutionResult` elements.
  1535. Each `toggleExecutionResult` under the `succeeded` section will contain:
  1536. * `id` attribute - the Job ID
  1537. * `message` sub-element - result message for the request
  1538. Each `toggleExecutionResult` under the `failed` section will contain:
  1539. * `id` attribute - the Job ID
  1540. * `error` sub-element - result error message for the request
  1541. * `errorCode` attribute - a code indicating the type of failure, currently one of `failed`, `unauthorized` or `notfound`.
  1542. `application/json` response:
  1543. ~~~~~~ {.json}
  1544. {
  1545. "requestCount": #integer#,
  1546. "enabled": true/false,
  1547. "allsuccessful": true/false,
  1548. "succeeded": [...],
  1549. "failed":[...]
  1550. }
  1551. ~~~~~~
  1552. The list of succeeded/failed will contain objects of this form:
  1553. ~~~~~~ {.json}
  1554. {
  1555. "id": "[UUID]",
  1556. "errorCode": "(error code, see above)",
  1557. "message": "(success or failure message)"
  1558. }
  1559. ~~~~~~
  1560. ### Bulk Toggle Job Schedules
  1561. Toggle whether schedules are enabled for a set of jobs. (ACL requires `toggle_schedule` action for each job.)
  1562. Schedules will be enabled or disabled, depending on the URL used:
  1563. **Request:**
  1564. POST /api/14/jobs/schedule/enable
  1565. POST /api/14/jobs/schedule/disable
  1566. Query parameters:
  1567. * `ids`: The Job IDs to delete, can be specified multiple times
  1568. * `idlist`: The Job IDs to delete as a single comma-separated string.
  1569. Or JSON/XML content:
  1570. `Content-Type: application/json`
  1571. ~~~~~ {.json}
  1572. {
  1573. "ids": [
  1574. "fefa50e1-2265-47af-b101-d4bbaa3ba21c",
  1575. "f07e2311-4dae-40ca-bdfa-412bd223f863"
  1576. ],
  1577. "idlist":"49336998-21a3-42c7-8da3-a855587982e0,a387f77f-a623-45dc-967f-746a2e3f6686"
  1578. }
  1579. ~~~~~
  1580. Note: you can combine `ids` with `idlist`.
  1581. **Response:**
  1582. If successful, then the `result` will contain a `toggleSchedule` element with two sections of results, `succeeded` and `failed`:
  1583. ~~~~~~~~~~ {.xml}
  1584. <toggleSchedule enabled="true" requestCount="#" allsuccessful="true/false">
  1585. <succeeded count="1">
  1586. <toggleScheduleResult id="[job ID]">
  1587. <message>[message]</message>
  1588. </toggleScheduleResult>
  1589. </succeeded>
  1590. <failed count="1">
  1591. <toggleScheduleResult id="[job ID]" errorCode="[code]">
  1592. <error>[message]</error>
  1593. </toggleScheduleResult>
  1594. </failed>
  1595. </toggleSchedule>
  1596. ~~~~~~~~~~
  1597. `toggleSchedule` has these attributes:
  1598. * `enabled`: `true` or `false`, depending on whether `enable` or `disable` was requested.
  1599. * `requestCount`: the number of job IDs that were in the request
  1600. * `allsuccessful`: true/false: true if all modifications were successful, false otherwise.
  1601. The response may contain only one of `succeeded` or `failed`, depending on the result.
  1602. The `succeeded` and `failed` sections contain multiple `toggleScheduleResult` elements.
  1603. Each `toggleScheduleResult` under the `succeeded` section will contain:
  1604. * `id` attribute - the Job ID
  1605. * `message` sub-element - result message for the request
  1606. Each `toggleScheduleResult` under the `failed` section will contain:
  1607. * `id` attribute - the Job ID
  1608. * `error` sub-element - result error message for the request
  1609. * `errorCode` attribute - a code indicating the type of failure, currently one of `failed`, `unauthorized` or `notfound`.
  1610. `application/json` response:
  1611. ~~~~~~ {.json}
  1612. {
  1613. "requestCount": #integer#,
  1614. "enabled": true/false,
  1615. "allsuccessful": true/false,
  1616. "succeeded": [...],
  1617. "failed":[...]
  1618. }
  1619. ~~~~~~
  1620. The list of succeeded/failed will contain objects of this form:
  1621. ~~~~~~ {.json}
  1622. {
  1623. "id": "[UUID]",
  1624. "errorCode": "(error code, see above)",
  1625. "message": "(success or failure message)"
  1626. }
  1627. ~~~~~~
  1628. ## Executions
  1629. ### Getting Executions for a Job
  1630. Get the list of executions for a Job.
  1631. **Request:**
  1632. GET /api/1/job/[ID]/executions
  1633. Optional Query Parameters:
  1634. * `status`: the status of executions you want to be returned. Must be one of "succeeded", "failed", "aborted", or "running". If this parameter is blank or unset, include all executions.
  1635. * Paging parameters:
  1636. * `max`: indicate the maximum number of results to return. If unspecified, all results will be returned.
  1637. * `offset`: indicate the 0-indexed offset for the first result to return.
  1638. **Response:**
  1639. An Item List of `executions`. See [Listing Running Executions](#listing-running-executions).
  1640. ### Delete all Executions for a Job
  1641. Delete all executions for a Job.
  1642. **Request:**
  1643. DELETE /api/12/job/[ID]/executions
  1644. **Response:**
  1645. The same format as [Bulk Delete Executions](#bulk-delete-executions).
  1646. ### Listing Running Executions
  1647. List the currently running executions for a project
  1648. **Request:**
  1649. GET /api/14/project/[PROJECT]/executions/running
  1650. (**Deprecated URL**: `/api/14/executions/running`, required URL parameter `project`.)
  1651. Note: `PROJECT` is the project name, or '*' for all projects.
  1652. Response with `Content-Type: application/xml`: An `<executions>` element containing multiple `<execution>` elements.
  1653. ~~~~ {.xml}
  1654. <executions count="[count]" offset="[offset]" max="[max]" total="[total]">
  1655. <execution...>...</execution>
  1656. <execution...>...</execution>
  1657. </executions>
  1658. ~~~~
  1659. The `executions` element will have paging attributes:
  1660. * `max`: maximum number of results per page
  1661. * `offset`: offset from first of all results
  1662. * `total`: total number of results
  1663. * `count`: number of results in the response
  1664. Each `execution` of the form:
  1665. ~~~~~~~~~~ {.xml}
  1666. <execution id="[ID]" href="[url]" permalink="[url]" status="[status]" project="[project]">
  1667. <user>[user]</user>
  1668. <date-started unixtime="[unixtime]">[datetime]</date-started>
  1669. <!-- optional job context if the execution is associated with a job -->
  1670. <job id="jobID" averageDuration="[milliseconds]" href="[API url]" permalink="[GUI url]">
  1671. <name>..</name>
  1672. <group>..</group>
  1673. <description>..</description>
  1674. <!-- optional if arguments are passed to the job since v10 -->
  1675. <options>
  1676. <option name="optname" value="optvalue"/>...
  1677. </options>
  1678. </job>
  1679. <!-- description of the execution -->
  1680. <description>...</description>
  1681. <!-- argString (arguments) of the execution -->
  1682. <argstring>...</argstring>
  1683. <!-- if Rundeck is in cluster mode -->
  1684. <serverUUID>...</serverUUID>
  1685. <!-- The following elements included only if the execution has ended -->
  1686. <!-- the completion time of the execution -->
  1687. <date-ended unixtime="[unixtime]">[datetime]</date-ended>
  1688. <!-- if the execution was aborted, the username who aborted it: -->
  1689. <abortedby>[username]</abortedby>
  1690. <!-- if the execution was is finished, a list of node names that succeeded -->
  1691. <successfulNodes>
  1692. <node name="node1"/>
  1693. <node name="node2"/>
  1694. </successfulNodes>
  1695. <!-- if the execution was is finished, a list of node names that failed -->
  1696. <failedNodes>
  1697. <node name="node3"/>
  1698. <node name="node4"/>
  1699. </failedNodes>
  1700. </execution>
  1701. ~~~~~~~~~~
  1702. **Since API v14, JSON format is available**
  1703. Response with `Content-Type: application/json`:
  1704. It contains a `paging` entry with paging information, and a `executions` array:
  1705. ~~~~~~~~~~ {.json}
  1706. {
  1707. "paging": {
  1708. "count": 2,
  1709. "total": 2,
  1710. "offset": 0,
  1711. "max": 20
  1712. },
  1713. "executions": [
  1714. {
  1715. "id": 387,
  1716. "href": "[API url]",
  1717. "permalink": "[GUI url]",
  1718. "status": "[status]",
  1719. "project": "test",
  1720. "user": "[user]",
  1721. "serverUUID":"[UUID]",
  1722. "date-started": {
  1723. "unixtime": 1431536339809,
  1724. "date": "2015-05-13T16:58:59Z"
  1725. },
  1726. "date-ended": {
  1727. "unixtime": 1431536346423,
  1728. "date": "2015-05-13T16:59:06Z"
  1729. },
  1730. "job": {
  1731. "id": "7400ff98-31c4-4834-ba3d-aee9646e867f",
  1732. "averageDuration": 6094,
  1733. "name": "test job",
  1734. "group": "api-test/job-run-steps",
  1735. "project": "test",
  1736. "description": "",
  1737. "href": "[API url]",
  1738. "permalink": "[GUI url]",
  1739. "options": {
  1740. "opt2": "a",
  1741. "opt1": "testvalue"
  1742. }
  1743. },
  1744. "description": "echo hello there [... 5 steps]",
  1745. "argstring": "-opt1 testvalue -opt2 a",
  1746. "successfulNodes": [
  1747. "madmartigan.local"
  1748. ]
  1749. },
  1750. ...
  1751. ]
  1752. }
  1753. ~~~~~~~~~~
  1754. The `[status]` value indicates the execution status. It is one of:
  1755. * `running`: execution is running
  1756. * `succeeded`: execution completed successfully
  1757. * `failed`: execution completed with failure
  1758. * `aborted`: execution was aborted
  1759. The `[url]` value for the `href` is a URL the Rundeck API for the execution.
  1760. The `[url]` value for the `permalink` is a URL to the Rundeck server page to view the execution output.
  1761. `[user]` is the username of the user who started the execution.
  1762. `[unixtime]` is the millisecond unix timestamp, and `[datetime]` is a W3C dateTime string in the format "yyyy-MM-ddTHH:mm:ssZ".
  1763. If known, the average duration of the associated Job will be indicated (in milliseconds) as `averageDuration`. (Since API v5)
  1764. **API v9 and above**: `project="[project]"` is the project name of the execution.
  1765. `successfulNodes` and `failedNodes` list the names of nodes which succeeded or failed. **API v10 and above**.
  1766. The `job` section contains `options` if an `argstring` value is set (**API v10 and above**). Inside `options` is a sequence of `<option>` elements with two attributes:
  1767. * `name` the parsed option name
  1768. * `value` the parsed option value
  1769. **Since API v13**: The `serverUUID` will indicate the server UUID
  1770. if executed in cluster mode.
  1771. ### Execution Info
  1772. Get the status for an execution by ID.
  1773. **Request:**
  1774. GET /api/1/execution/[ID]
  1775. **Response:**
  1776. An Item List of `executions` with a single item. See [Listing Running Executions](#listing-running-executions).
  1777. With `Content-Type: application/json`, a single object:
  1778. ~~~~~ {.json}
  1779. {
  1780. "id": X,
  1781. "href": "[url]",
  1782. "permalink": "[url]",
  1783. "status": "succeeded/failed/aborted/timedout/retried/other",
  1784. "project": "[project]",
  1785. "user": "[user]",
  1786. "date-started": {
  1787. "unixtime": 1431536339809,
  1788. "date": "2015-05-13T16:58:59Z"
  1789. },
  1790. "date-ended": {
  1791. "unixtime": 1431536346423,
  1792. "date": "2015-05-13T16:59:06Z"
  1793. },
  1794. "job": {
  1795. "id": "[uuid]",
  1796. "href": "[url]",
  1797. "permalink": "[url]",
  1798. "averageDuration": 6094,
  1799. "name": "[name]",
  1800. "group": "[group]",
  1801. "project": "[project]",
  1802. "description": "",
  1803. "options": {
  1804. "opt2": "a",
  1805. "opt1": "testvalue"
  1806. }
  1807. },
  1808. "description": "echo hello there [... 5 steps]",
  1809. "argstring": "-opt1 testvalue -opt2 a",
  1810. "successfulNodes": [
  1811. "nodea","nodeb"
  1812. ],
  1813. "failedNodes": [
  1814. "nodec","noded"
  1815. ]
  1816. }
  1817. ~~~~~
  1818. ### Delete an Execution
  1819. Delete an execution by ID.
  1820. **Request:**
  1821. DELETE /api/12/execution/[ID]
  1822. **Response:**
  1823. `204 No Content`
  1824. *Authorization requirement*:
  1825. * Requires the `delete_execution` action allowed for a `project` in the `application` context. See: [Administration - Access Control Policy - Application Scope Resources and Actions](../administration/access-control-policy.html#application-scope-resources-and-actions)
  1826. ### Bulk Delete Executions
  1827. Delete a set of Executions by their IDs.
  1828. **Request:**
  1829. POST /api/12/executions/delete
  1830. The IDs can be specified in two ways:
  1831. 1. Using a URL parameter `ids`, as a comma separated list, with no body content
  1832. POST /api/12/executions/delete?ids=1,2,17
  1833. Content-Length: 0
  1834. 2. Using a request body of either XML or JSON data.
  1835. If using a request body, the formats are specified below:
  1836. `Content-Type: application/json`
  1837. ~~~~ {.json}
  1838. {"ids": [ 1, 2, 17 ] }
  1839. ~~~~
  1840. *OR* more simply:
  1841. ~~~~ {.json}
  1842. [ 1, 2, 17 ]
  1843. ~~~~
  1844. `Content-Type: application/xml`
  1845. ~~~~ {.xml}
  1846. <executions>
  1847. <execution id="1"/>
  1848. <execution id="2"/>
  1849. <execution id="17"/>
  1850. </executions>
  1851. ~~~~
  1852. Response:
  1853. The response format will be either `xml` or `json`, depending on the `Accept` header.
  1854. `Content-Type: application/json`
  1855. ~~~~ {.json}
  1856. {
  1857. "failures": [
  1858. {
  1859. "id": "82",
  1860. "message": "Not found: 82"
  1861. },
  1862. {
  1863. "id": "83",
  1864. "message": "Not found: 83"
  1865. },
  1866. {
  1867. "id": "84",
  1868. "message": "Not found: 84"
  1869. }
  1870. ],
  1871. "failedCount": 3,
  1872. "successCount": 2,
  1873. "allsuccessful": false,
  1874. "requestCount": 5
  1875. }
  1876. ~~~~
  1877. The JSON fields will be:
  1878. * `failures`: a list of objects indicating the `id` and `message` for the failed deletion attempt
  1879. * `failedCount`: number of deletion attempts that failed
  1880. * `successCount`: number of deletion attempts that succeeded
  1881. * `allsuccessful`: true if all deletions were successful
  1882. * `requestCount`: number of requested execution deletions
  1883. `Content-Type: application/xml`
  1884. ~~~~ {.xml}
  1885. <deleteExecutions requestCount='4' allsuccessful='false'>
  1886. <successful count='0' />
  1887. <failed count='4'>
  1888. <execution id='131' message='Unauthorized: Delete execution 131' />
  1889. <execution id='109' message='Not found: 109' />
  1890. <execution id='81' message='Not found: 81' />
  1891. <execution id='74' message='Not found: 74' />
  1892. </failed>
  1893. </deleteExecutions>
  1894. ~~~~
  1895. ### Execution Query
  1896. Query for Executions based on Job or Execution details.
  1897. **Request:**
  1898. GET /api/14/project/[PROJECT]/executions
  1899. (**Deprecated URL**: `/api/14/executions`, required parameter `project`.)
  1900. The following parameters can also be used to narrow down the result set.
  1901. * `statusFilter`: execution status, one of "running", succeeded", "failed" or "aborted"
  1902. * `abortedbyFilter`: Username who aborted an execution
  1903. * `userFilter`: Username who started the execution
  1904. * Date query parameters:
  1905. * `recentFilter`: Use a simple text format to filter executions that completed within a period of time. The format is "XY" where X is an integer, and "Y" is one of:
  1906. * `h`: hour
  1907. * `d`: day
  1908. * `w`: week
  1909. * `m`: month
  1910. * `y`: year
  1911. So a value of `2w` would return executions that completed within the last two weeks.
  1912. * `olderFilter`: (same format as `recentFilter`) return executions that completed before the specified relative period of time. E.g. a value of `30d` returns executions older than 30 days.
  1913. * `begin`: Specify exact date for earliest execution completion time
  1914. * `end`: Specify exact date for latest execution completion time
  1915. * `adhoc`: "true/false", if true, include only Adhoc executions, if false return only Job executions. By default any matching executions are returned, however if you use any of the Job filters below, then only Job executions will be returned.
  1916. The format for the `end`, and `begin` filters is either: a unix millisecond timestamp, or a W3C dateTime string in the format "yyyy-MM-ddTHH:mm:ssZ".
  1917. Parameters for querying for Executions for particular jobs:
  1918. * `jobIdListFilter`: specify a Job ID to include, can be specified multiple times
  1919. * `excludeJobIdListFilter`: specify a Job ID to exclude, can be specified multiple times
  1920. * `jobListFilter`: specify a full Job group/name to include, can be specified multiple times
  1921. * `excludeJobListFilter`: specify a full Job group/name to exclude, can be specified multiple times
  1922. * `groupPath`: specify a group or partial group path to include all jobs within that group path. Set to the special value "-" to match the top level jobs only.
  1923. * `groupPathExact`: specify an exact group path to match. Set to the special value "-" to match the top level jobs only.
  1924. * `excludeGroupPath`: specify a group or partial group path to exclude all jobs within that group path. Set to the special value "-" to match the top level jobs only.
  1925. * `excludeGroupPathExact`: specify an exact group path to exclude. Set to the special value "-" to match the top level jobs only.
  1926. * `jobFilter`: specify a filter for the job Name. Include any job name that matches this value.
  1927. * `excludeJobFilter`: specify a filter for the job Name. Exclude any job name that matches this value.
  1928. * `jobExactFilter`: specify an exact job name to match.
  1929. * `excludeJobExactFilter`: specify an exact job name to exclude.
  1930. The format for the `jobListFilter` and `excludeJobListFilter` is the job's group and name separated by a '/' character, such as: "group1/job name", or "my job" if there is no group.
  1931. Paging parameters:
  1932. * `max`: maximum number of results to include in response. (default: 20)
  1933. * `offset`: offset for first result to include. (default: 0)
  1934. **Response**
  1935. See [Listing Running Executions](#listing-running-executions).
  1936. ### Execution State
  1937. Get detail about the node and step state of an execution by ID. The execution can be currently running or completed.
  1938. **Request:**
  1939. GET /api/10/execution/[ID]/state
  1940. Specify expected output format with the `Accept: ` HTTP header. Supported formats:
  1941. * `text/xml`
  1942. * `application/json`
  1943. The content of the response contains state information for different parts of the workflow:
  1944. * overall state
  1945. * per-node overall state
  1946. * per-step node state
  1947. A workflow can have a step which consists of a sub-workflow, so each particular step has a "Step Context Identifier" which defines its location in the workflow(s), and looks something like "1/5/2". Each number identifies the step number (starting at 1) at a workflow level. If there is a "/" in the context identifier, it means there are sub-workflow step numbers, and each preceding number corresponds to a step which has a sub-workflow.
  1948. To identify the state of a particular node at a particular step, both a Node name, and a Step Context Identifier are necessary.
  1949. In the result set returned by this API call, state information is organized primarily by Step and is structured in the same way as the workflow. This means that sub-workflows will have nested state structures for their steps.
  1950. The state information for a Node will not contain the full set of details for the Step and Node, since this information is present in the workflow structure which contains the step state.
  1951. #### State Result Content
  1952. The result set contains this top-level structure:
  1953. * general overal state information
  1954. - `startTime` execution start time (see *Timestamp format* below)
  1955. - `endTime` execution end time if complete
  1956. - `updateTime` last update time
  1957. - `executionState` overall execution state
  1958. * `allNodes` contains a *Node Name List* (see below) of nodes known to be targetted in some workflow
  1959. * `nodes` contains an *Overall Node State List* of per-node step states
  1960. * `serverNode` name of the server node
  1961. * `executionId` current execution ID
  1962. * `completed` true/false whether the execution is completed
  1963. * A *Workflow Section* (see below)
  1964. **Workflow Section**
  1965. Each Workflow Section within the result set will contain these structures
  1966. * `stepCount` Number of steps in the workflow
  1967. * `targetNodes` contains a Node Name List identifying the target nodes of the current workflow
  1968. * `steps` contains a *Step State List* (see below) of information and state for each step
  1969. **Node Name List**
  1970. Consists of a sequence of node name entries, identifying each entry by a name.
  1971. In XML, a sequence of `node` elements:
  1972. <node name="abc" />
  1973. <node name="xyz" />
  1974. <!-- ... more node elements -->
  1975. In JSON, an array of node names.
  1976. **Overall Node State List**
  1977. Consists of a sequence of entries for each Node. Each entry contains
  1978. * `name` node name
  1979. * `steps` list of simple state indicator for steps executed by this node
  1980. State Indicators:
  1981. * `stepctx` Step Context Identifier
  1982. * `executionState` execution state for this step and node
  1983. In XML:
  1984. ~~~~~~~~~~ {.xml}
  1985. <node name="abc">
  1986. <steps>
  1987. <step>
  1988. <stepctx>1</stepctx>
  1989. <executionState>SUCCEEDED</executionState>
  1990. </step>
  1991. <step>
  1992. <stepctx>2/1</stepctx>
  1993. <executionState>SUCCEEDED</executionState>
  1994. </step>
  1995. </steps>
  1996. </node>
  1997. <!-- more node elements -->
  1998. ~~~~~~~~~~
  1999. In JSON: an object where each key is a node name, and the value is an array of State indicators. A state indicator is an object with two keys, `stepctx` and `executionState`
  2000. ~~~~~~~~~~ {.json}
  2001. {
  2002. "abc": [
  2003. {
  2004. "executionState": "SUCCEEDED",
  2005. "stepctx": "1"
  2006. },
  2007. {
  2008. "executionState": "SUCCEEDED",
  2009. "stepctx": "2/1"
  2010. }
  2011. ]
  2012. }
  2013. ~~~~~~~~~~
  2014. **Step State List**
  2015. A list of Step State information. Each step is identified by its number in the workflow (starting at 1) and its step context
  2016. * `num` the step number (XML)
  2017. * `id` the step number (JSON)
  2018. * `stepctx` the step context identifier in the workflow
  2019. * general overall state information for the step
  2020. - `startTime` execution start time
  2021. - `endTime` execution end time if complete
  2022. - `updateTime` last update time
  2023. - `executionState` overall execution state
  2024. * `nodeStep` true/false. true if this step directly targets each node from the targetNodes list. If true, this means the step will contain a `nodeStates` section
  2025. * `nodeStates` a *Node Step State Detail List* (see below) for the target nodes if this is a node step.
  2026. * `hasSubworkflow` true/false. true if this step has a sub-workflow and a `workflow` entry
  2027. * `workflow` this section contains a Workflow Section
  2028. **Node Step State Detail List**
  2029. A sequence of state details for a set of Nodes for the containing step. Each entry will contain:
  2030. * `name` the node name
  2031. * state information for the Node
  2032. - `startTime` execution start time
  2033. - `endTime` execution end time if complete
  2034. - `updateTime` last update time
  2035. - `executionState` overall execution state
  2036. In XML:
  2037. ~~~~~~~~~~ {.xml}
  2038. <nodeState name="abc">
  2039. <startTime>2014-01-13T20:58:59Z</startTime>
  2040. <updateTime>2014-01-13T20:59:04Z</updateTime>
  2041. <endTime>2014-01-13T20:59:04Z</endTime>
  2042. <executionState>SUCCEEDED</executionState>
  2043. </nodeState>
  2044. <!-- more nodeState elements -->
  2045. ~~~~~~~~~~
  2046. In JSON: an object with node names as keys. Values are objects containing the state information entries.
  2047. ~~~~~~~~~~ {.json}
  2048. {
  2049. "abc": {
  2050. "executionState": "SUCCEEDED",
  2051. "endTime": "2014-01-13T20:38:31Z",
  2052. "updateTime": "2014-01-13T20:38:31Z",
  2053. "startTime": "2014-01-13T20:38:25Z"
  2054. }
  2055. }
  2056. ~~~~~~~~~~
  2057. **Full XML Example**
  2058. Within the `<result>` element:
  2059. ~~~~~~~~~~ {.xml}
  2060. <executionState id="135">
  2061. <startTime>2014-01-13T20:58:59Z</startTime>
  2062. <updateTime>2014-01-13T20:59:10Z</updateTime>
  2063. <stepCount>2</stepCount>
  2064. <allNodes>
  2065. <nodes>
  2066. <node name="dignan" />
  2067. </nodes>
  2068. </allNodes>
  2069. <targetNodes>
  2070. <nodes>
  2071. <node name="dignan" />
  2072. </nodes>
  2073. </targetNodes>
  2074. <executionId>135</executionId>
  2075. <serverNode>dignan</serverNode>
  2076. <endTime>2014-01-13T20:59:10Z</endTime>
  2077. <executionState>SUCCEEDED</executionState>
  2078. <completed>true</completed>
  2079. <steps>
  2080. <step stepctx="1" id="1">
  2081. <startTime>2014-01-13T20:58:59Z</startTime>
  2082. <nodeStep>true</nodeStep>
  2083. <updateTime>2014-01-13T20:58:59Z</updateTime>
  2084. <endTime>2014-01-13T20:59:04Z</endTime>
  2085. <executionState>SUCCEEDED</executionState>
  2086. <nodeStates>
  2087. <nodeState name="dignan">
  2088. <startTime>2014-01-13T20:58:59Z</startTime>
  2089. <updateTime>2014-01-13T20:59:04Z</updateTime>
  2090. <endTime>2014-01-13T20:59:04Z</endTime>
  2091. <executionState>SUCCEEDED</executionState>
  2092. </nodeState>
  2093. </nodeStates>
  2094. </step>
  2095. <step stepctx="2" id="2">
  2096. <startTime>2014-01-13T20:59:04Z</startTime>
  2097. <nodeStep>false</nodeStep>
  2098. <updateTime>2014-01-13T20:59:10Z</updateTime>
  2099. <hasSubworkflow>true</hasSubworkflow>
  2100. <endTime>2014-01-13T20:59:10Z</endTime>
  2101. <executionState>SUCCEEDED</executionState>
  2102. <workflow>
  2103. <startTime>2014-01-13T20:59:04Z</startTime>
  2104. <updateTime>2014-01-13T20:59:10Z</updateTime>
  2105. <stepCount>1</stepCount>
  2106. <allNodes>
  2107. <nodes>
  2108. <node name="dignan" />
  2109. </nodes>
  2110. </allNodes>
  2111. <targetNodes>
  2112. <nodes>
  2113. <node name="dignan" />
  2114. </nodes>
  2115. </targetNodes>
  2116. <endTime>2014-01-13T20:59:10Z</endTime>
  2117. <executionState>SUCCEEDED</executionState>
  2118. <completed>true</completed>
  2119. <steps>
  2120. <step stepctx="2/1" id="1">
  2121. <startTime>2014-01-13T20:59:04Z</startTime>
  2122. <nodeStep>true</nodeStep>
  2123. <updateTime>2014-01-13T20:59:04Z</updateTime>
  2124. <endTime>2014-01-13T20:59:10Z</endTime>
  2125. <executionState>SUCCEEDED</executionState>
  2126. <nodeStates>
  2127. <nodeState name="dignan">
  2128. <startTime>2014-01-13T20:59:04Z</startTime>
  2129. <updateTime>2014-01-13T20:59:10Z</updateTime>
  2130. <endTime>2014-01-13T20:59:10Z</endTime>
  2131. <executionState>SUCCEEDED</executionState>
  2132. </nodeState>
  2133. </nodeStates>
  2134. </step>
  2135. </steps>
  2136. </workflow>
  2137. </step>
  2138. </steps>
  2139. <nodes>
  2140. <node name="dignan">
  2141. <steps>
  2142. <step>
  2143. <stepctx>1</stepctx>
  2144. <executionState>SUCCEEDED</executionState>
  2145. </step>
  2146. <step>
  2147. <stepctx>2/1</stepctx>
  2148. <executionState>SUCCEEDED</executionState>
  2149. </step>
  2150. </steps>
  2151. </node>
  2152. </nodes>
  2153. </executionState>
  2154. ~~~~~~~~~~
  2155. **Full JSON example**
  2156. ~~~~~~~~~~ {.json}
  2157. {
  2158. "completed": true,
  2159. "executionState": "SUCCEEDED",
  2160. "endTime": "2014-01-13T20:38:36Z",
  2161. "serverNode": "dignan",
  2162. "startTime": "2014-01-13T20:38:25Z",
  2163. "updateTime": "2014-01-13T20:38:36Z",
  2164. "stepCount": 2,
  2165. "allNodes": [
  2166. "dignan"
  2167. ],
  2168. "targetNodes": [
  2169. "dignan"
  2170. ],
  2171. "nodes": {
  2172. "dignan": [
  2173. {
  2174. "executionState": "SUCCEEDED",
  2175. "stepctx": "1"
  2176. },
  2177. {
  2178. "executionState": "SUCCEEDED",
  2179. "stepctx": "2/1"
  2180. }
  2181. ]
  2182. },
  2183. "executionId": 134,
  2184. "steps": [
  2185. {
  2186. "executionState": "SUCCEEDED",
  2187. "endTime": "2014-01-13T20:38:31Z",
  2188. "nodeStates": {
  2189. "dignan": {
  2190. "executionState": "SUCCEEDED",
  2191. "endTime": "2014-01-13T20:38:31Z",
  2192. "updateTime": "2014-01-13T20:38:31Z",
  2193. "startTime": "2014-01-13T20:38:25Z"
  2194. }
  2195. },
  2196. "updateTime": "2014-01-13T20:38:25Z",
  2197. "nodeStep": true,
  2198. "id": "1",
  2199. "startTime": "2014-01-13T20:38:25Z"
  2200. },
  2201. {
  2202. "workflow": {
  2203. "completed": true,
  2204. "startTime": "2014-01-13T20:38:31Z",
  2205. "updateTime": "2014-01-13T20:38:36Z",
  2206. "stepCount": 1,
  2207. "allNodes": [
  2208. "dignan"
  2209. ],
  2210. "targetNodes": [
  2211. "dignan"
  2212. ],
  2213. "steps": [
  2214. {
  2215. "executionState": "SUCCEEDED",
  2216. "endTime": "2014-01-13T20:38:36Z",
  2217. "nodeStates": {
  2218. "dignan": {
  2219. "executionState": "SUCCEEDED",
  2220. "endTime": "2014-01-13T20:38:36Z",
  2221. "updateTime": "2014-01-13T20:38:36Z",
  2222. "startTime": "2014-01-13T20:38:31Z"
  2223. }
  2224. },
  2225. "updateTime": "2014-01-13T20:38:31Z",
  2226. "nodeStep": true,
  2227. "id": "1",
  2228. "startTime": "2014-01-13T20:38:31Z"
  2229. }
  2230. ],
  2231. "endTime": "2014-01-13T20:38:36Z",
  2232. "executionState": "SUCCEEDED"
  2233. },
  2234. "executionState": "SUCCEEDED",
  2235. "endTime": "2014-01-13T20:38:36Z",
  2236. "hasSubworkflow": true,
  2237. "updateTime": "2014-01-13T20:38:36Z",
  2238. "nodeStep": false,
  2239. "id": "2",
  2240. "startTime": "2014-01-13T20:38:31Z"
  2241. }
  2242. ]
  2243. }
  2244. ~~~~~~~~~~
  2245. **Timestamp format:**
  2246. The timestamp format is ISO8601: `yyyy-MM-dd'T'HH:mm:ss'Z'`
  2247. **Execution states:**
  2248. * `WAITING` - Waiting to start running
  2249. * `RUNNING` - Currently running
  2250. * `RUNNING_HANDLER` - Running error handler\*
  2251. * `SUCCEEDED` - Finished running successfully
  2252. * `FAILED` - Finished with a failure
  2253. * `ABORTED` - Execution was aborted
  2254. * `NODE_PARTIAL_SUCCEEDED` - Partial success for some nodes\*
  2255. * `NODE_MIXED` - Mixed states among nodes\*
  2256. * `NOT_STARTED` - After waiting the execution did not start\*
  2257. \* these states only apply to steps/nodes and do not apply to the overall execution or workflow.
  2258. ### Execution Output
  2259. Get the output for an execution by ID. The execution can be currently running or may have already completed. Output can be filtered down to a specific node or workflow step.
  2260. **Request:**
  2261. GET /api/5/execution/[ID]/output
  2262. GET /api/10/execution/[ID]/output/node/[NODE]
  2263. GET /api/10/execution/[ID]/output/node/[NODE]/step/[STEPCTX]
  2264. GET /api/10/execution/[ID]/output/step/[STEPCTX]
  2265. The log output for each execution is stored in a file on the Rundeck server, and this API endpoint allows you to retrieve some or all of the output, in several possible formats: json, XML, and plain text. When retrieving the plain text output, some metadata about the log is included in HTTP Headers. JSON and XML output formats include metadata about each output log line, as well as metadata about the state of the execution and log file, and your current index location in the file.
  2266. Output can be selected by Node or Step Context or both as of API v10.
  2267. Several parameters can be used to retrieve only part of the output log data. You can use these parameters to more efficiently retrieve the log content over time while an execution is running.
  2268. The log file used to store the execution output is a formatted text file which also contains metadata about each line of log output emitted during an execution. Several data values in this API endpoint refer to "bytes", but these do not reflect the size of the final log data; they are only relative to the formatted log file itself. You can treat these byte values as opaque locations in the log file, but you should not try to correlate them to the actual textual log lines.
  2269. Optional Parameters:
  2270. * `offset`: byte offset to read from in the file. 0 indicates the beginning.
  2271. * `lastlines`: number of lines to retrieve from the end of the available output. If specified it will override the `offset` value and return only the specified number of lines at the end of the log.
  2272. * `lastmod`: epoch datestamp in milliseconds, return results only if modification changed since the specified date OR if more data is available at the given `offset`
  2273. * `maxlines`: maximum number of lines to retrieve forward from the specified offset.
  2274. **Response:**
  2275. The output content in the requested format, see [Output Content](#output-content).
  2276. #### Tailing Output
  2277. To "tail" the output from a running execution, you will need to make a series of requests to this API endpoint, and update the `offset` value that you send to reflect the returned `dataoffset` value that you receive. This gives you a consistent pointer into the output log file.
  2278. When starting these requests, there are two mechanisms you can use:
  2279. 1. Start at the beginning, specifying either a `lastmod` or a `offset` of 0
  2280. 2. Start at the end, by using `lastlines` to receive the last available set of log lines.
  2281. After your first request you will have the `dataoffset` and `lastmod` response values you can use to continue making requests for subsequent log output. You can choose several ways to do this:
  2282. 1. Use the `offset` and `lastmod` parameters to indicate modification time and receive as much output as is available
  2283. 2. Use the `offset` and `maxlines` parameter to specify a maximum number of log entries
  2284. 3. Use only the `offset` parameter and receive as much output as is available.
  2285. After each request, you will update your `offset` value to reflect the `dataoffset` in the response.
  2286. All log output has been read when the `iscompleted` value is "true".
  2287. Below is some example pseudo-code for using this API endpoint to follow the output of a running execution "live":
  2288. * set offset to 0
  2289. * set lastmod to 0
  2290. * Repeat until `iscompleted` response value is "true":
  2291. * perform request sending `offset` and `lastmod` parameters
  2292. * print any log entries, update progress bar, etc.
  2293. * Record the resulting `dataoffset` and `lastmod` response values for the next request
  2294. * if `unmodified` is "true", sleep for 5 seconds
  2295. * otherwise sleep for 2 seconds
  2296. **Authorization:**
  2297. This endpoint requires that the user have 'read' access to the Job or to Adhoc executions to retrieve the output content.
  2298. #### Output Format Using the URL
  2299. Specifying an output format can occur in several ways. The simplest ways are to include the format in the URL, either by including a `format` URL parameter, or an extension on the request URL.
  2300. When using a URL format, use one of these values for the format:
  2301. * `json`
  2302. * `xml`
  2303. * `text`
  2304. To use a URL parameter, add a `?format=` parameter to your request.
  2305. E.g.:
  2306. GET /api/5/execution/3/output?format=json
  2307. To use a URL extension, add a ".[format]" to the end of the URL, but prior to any URL parameters.
  2308. E.g.:
  2309. GET /api/5/execution/3/output.xml?offset=120
  2310. #### Output Format using Accept Header
  2311. You can also specify the format using Content Negotiation techniques by including an `Accept` header in your request, and specifying a valid MIME-type to represent one of the formats:
  2312. * For XML, `text/xml` or `application/xml`
  2313. * For JSON, `application/json` or `text/json`
  2314. * For plain text, `text/plain`
  2315. E.g.:
  2316. GET /api/5/execution/3/output
  2317. Accept: */xml
  2318. #### Output Content
  2319. The result will contain a set of data values reflecting the execution's status, as well as the status and read location in the output file.
  2320. * In JSON, there will be an object containing these entries.
  2321. * In XML, within the standard [Response Format](#response-format) `result` there will be an `output` element, containing these sub-elements, each with a text value.
  2322. Entries:
  2323. * `id`: ID of the execution
  2324. * `message`: optional text message indicating why no entries were returned
  2325. * `error`: optional text message indicating an error case
  2326. * `unmodified`: true/false, (optional) "true" will be returned if the `lastmod` parameter was used and the file had not changed
  2327. * `empty`: true/false, (optional) "true" will be returned if the log file does not exist or is empty, which may occur if the log data is requested before any output has been stored.
  2328. * `offset`: Byte offset to read for the next set of data
  2329. * `completed`: true/false, "true" if the current log entries or request parameters include all of the available data
  2330. * `execCompleted`: true/false, "true" if the execution has completed.
  2331. * `hasFailedNodes`: true/false, "true" if the execution has recorded a list of failed nodes
  2332. * `execState`: execution state, one of "running","succeeded","failed","aborted"
  2333. * `lastModified`: (long integer), millisecond timestamp of the last modification of the log file
  2334. * `execDuration`: (long integer), millisecond duration of the execution
  2335. * `percentLoaded`: (float), percentage of the output which has been loaded by the parameters to this request
  2336. * `totalSize`: (integer), total bytes available in the output file
  2337. * `filter` - if a `node` or `step` filter was used
  2338. - `nodename` - value of the node name filter
  2339. - `stepctx` - value of the step context filter
  2340. Each log entry will be included in a section called `entries`.
  2341. * In JSON, `entries` will contain an array of Objects, each containing the following format
  2342. * In XML, the `entries` element will contain a sequence of `entry` elements
  2343. Content of each Log Entry:
  2344. * `time`: Timestamp in format: "HH:MM:SS"
  2345. * `level`: Log level, one of: SEVERE,WARNING,INFO,CONFIG,FINEST
  2346. * `log`: The log message
  2347. * `user`: User name
  2348. * `command`: Workflow command context string
  2349. * `node`: Node name
  2350. **Note for API version 5:**
  2351. For API requests using version `5` only, the XML `entry` will have the log message as the text value. Otherwise the log entry
  2352. value will be within the `log` attribute.
  2353. #### Text Format Content
  2354. For the plain text format, the content of the response will simply be the log output lines at the chosen offset location.
  2355. Included in the response will be some HTTP headers that provide the metadata about the output location. Some headers may not be present, depending on the state of the response. See the [Output Content](#output-content) section for descriptions of the content and availability of the values:
  2356. * `X-Rundeck-ExecOutput-Error`: The `error` field
  2357. * `X-Rundeck-ExecOutput-Message`: The `message` field
  2358. * `X-Rundeck-ExecOutput-Empty`: The `empty` field
  2359. * `X-Rundeck-ExecOutput-Unmodified`: The `unmodified` field
  2360. * `X-Rundeck-ExecOutput-Offset`: The `offset` field
  2361. * `X-Rundeck-ExecOutput-Completed`: The `completed` field
  2362. * `X-Rundeck-Exec-Completed`: The `execCompleted` field
  2363. * `X-Rundeck-Exec-State`: The `execState` field
  2364. * `X-Rundeck-Exec-Duration`: the `execDuration` field
  2365. * `X-Rundeck-ExecOutput-LastModifed`: The `lastModified` field
  2366. * `X-Rundeck-ExecOutput-TotalSize`: The `totalSize` field
  2367. ### Execution Output with State
  2368. Get the metadata associated with workflow step state changes along with the log output, optionally excluding log output.
  2369. **Request:**
  2370. GET /api/10/execution/[ID]/output/state
  2371. GET /api/10/execution/[ID]/output/state?stateOnly=true
  2372. This API endpoint provides the sequential log of state changes for steps and nodes, optionally interleaved with the actual log output.
  2373. **Response:**
  2374. The output format is the same as [Execution Output](#execution-output), with this change:
  2375. * in the `entries` section, each entry will have a `type` value indicating the entry type
  2376. - `log` a normal log entry
  2377. - `stepbegin` beginning of the step indicated by the `stepctx`
  2378. - `stepend` finishing of the step
  2379. - `nodebegin` beginning of execution of a node for the given step
  2380. - `nodeend` finishing of execution of a node for the given step
  2381. * metadata about the entry may be included in the entry
  2382. ### Aborting Executions
  2383. Abort a running execution by ID.
  2384. **Request:**
  2385. GET /api/1/execution/[ID]/abort
  2386. Optional Parameters:
  2387. * `asUser` : specifies a username identifying the user who aborted the execution. Requires `runAs` permission.
  2388. **Response:**
  2389. `Content-Type: application/xml`: The result will contain a `success/message` element will contain a descriptive message. The status of the abort action will be included as an element:
  2390. ~~~~~~~~~~ {.xml}
  2391. <abort status="[abort-state]">
  2392. <execution id="[id]" status="[status]"/>
  2393. </abort>
  2394. ~~~~~~~~~~
  2395. `Content-Type: application/json`:
  2396. ~~~~~~ {.json}
  2397. {
  2398. "abort": {
  2399. "status": "[abort-state]",
  2400. "reason": "[reason]"
  2401. },
  2402. "execution": {
  2403. "id": "[id]",
  2404. "status": "[execution status]",
  2405. "href": "[API href]",
  2406. }
  2407. }
  2408. ~~~~~~
  2409. The `[abort-state]` will be one of: "pending", "failed", or "aborted".
  2410. If the `[abort-state]` is "failed", then `[reason]` will be a textual description of the reason.
  2411. ## Adhoc
  2412. ### Running Adhoc Commands
  2413. Run a command string.
  2414. **Request:**
  2415. GET /api/14/project/[PROJECT]/run/command
  2416. POST /api/14/project/[PROJECT]run/command
  2417. (**Deprecated URLs**: `/api/14/run/command`, with required parameter `project`).
  2418. The necessary content can be supplied as request Parameters:
  2419. * `exec`: the shell command string to run, e.g. "echo hello". (required)
  2420. * `nodeThreadcount`: threadcount to use (optional)
  2421. * `nodeKeepgoing`: if "true", continue executing on other nodes even if some fail. (optional)
  2422. * `asUser` : specifies a username identifying the user who ran the command. Requires `runAs` permission. (optional)
  2423. Node filter parameters as described under [Using Node Filters](#using-node-filters)
  2424. Or the request can be `Content-type: application/json`:
  2425. ~~~~~~ {.json}
  2426. {
  2427. "project":"[project]",
  2428. "exec":"[exec]",
  2429. "nodeThreadcount": #threadcount#,
  2430. "nodeKeepgoing": true/false,
  2431. "asUser": "[asUser]",
  2432. "filter": "[node filter string]"
  2433. }
  2434. ~~~~~~
  2435. **Response:**
  2436. `Content-Type: application/xml`: A success message, and a single `<execution>` item identifying the
  2437. new execution by ID:
  2438. ~~~~~~~~~~ {.xml}
  2439. <execution id="X" href="[API Href]" permalink="[GUI href]"/>
  2440. ~~~~~~~~~~
  2441. `Content-Type: application/json`:
  2442. ~~~~~~~~~~ {.json}
  2443. {
  2444. "message": "Immediate execution scheduled (X)",
  2445. "execution": {
  2446. "id": X,
  2447. "href": "[API Href]",
  2448. "permalink": "[GUI Href]"
  2449. }
  2450. }
  2451. ~~~~~~~~~~
  2452. ### Running Adhoc Scripts
  2453. Run a script.
  2454. **Request:**
  2455. POST /api/14/project/[PROJECT]/run/script
  2456. (**Deprecated URL**: `/api/14/run/script`, with required parameter `project`).
  2457. Request Content:
  2458. The script file content can be submitted either as a form request or multipart attachment with request parameters, or can be a json document.
  2459. For Content-Type: `application/x-www-form-urlencoded`
  2460. * `scriptFile`: A `x-www-form-urlencoded` request parameter containing the script file content.
  2461. For Content-Type: `multipart/form-data`
  2462. * `scriptFile`: the script file contents (`scriptFile` being the `name` attribute of the `Content-Disposition` header)
  2463. Parameters:
  2464. * `argString`: Arguments to pass to the script when executed.
  2465. * `nodeThreadcount`: threadcount to use
  2466. * `nodeKeepgoing`: if "true", continue executing on other nodes even if some fail.
  2467. * `asUser` : specifies a username identifying the user who ran the script. Requires `runAs` permission.
  2468. * `scriptInterpreter`: a command to use to run the script (*since version 8*)
  2469. * `interpreterArgsQuoted`: `true`/`false`: if true, the script file and arguments will be quoted as the last argument to the `scriptInterpreter` (*since version 8*)
  2470. * `fileExtension`: extension of of the script file on the remote node (*since version 14*)
  2471. Node filter parameters as described under [Using Node Filters](#using-node-filters)
  2472. If using a json document with Content-type: `application/json`:
  2473. ~~~~~~ {.json}
  2474. {
  2475. "project":"[project]",
  2476. "script":"[script]",
  2477. "nodeThreadcount": #threadcount#,
  2478. "nodeKeepgoing": true/false,
  2479. "asUser": "[asUser]",
  2480. "argString": "[argString]",
  2481. "scriptInterpreter": "[scriptInterpreter]",
  2482. "interpreterArgsQuoted": true/false,
  2483. "fileExtension": "[fileExtension]",
  2484. "filter": "[node filter string]"
  2485. }
  2486. ~~~~~~
  2487. #### Response
  2488. `Content-Type: application/xml`: A success message, and a single `<execution>` item identifying the
  2489. new execution by ID:
  2490. ~~~~~~~~~~ {.xml}
  2491. <execution id="X" href="[API Href]" permalink="[GUI href]"/>
  2492. ~~~~~~~~~~
  2493. `Content-Type: application/json`:
  2494. ~~~~~~~~~~ {.json}
  2495. {
  2496. "message": "Immediate execution scheduled (X)",
  2497. "execution": {
  2498. "id": X,
  2499. "href": "[API Href]",
  2500. "permalink": "[GUI Href]"
  2501. }
  2502. }
  2503. ~~~~~~~~~~
  2504. ### Running Adhoc Script URLs
  2505. Run a script downloaded from a URL. (**API version 4** required.)
  2506. **Request:**
  2507. POST /api/14/project/[PROJECT]/run/url
  2508. GET /api/14/project/[PROJECT]/run/url
  2509. (**Deprecated URL**: `/api/14/run/url`, with required parameter `project`).
  2510. The request can be form content, or a JSON document.
  2511. With Content-Type: `application/x-www-form-urlencoded` form or query parameters are used.
  2512. * `scriptURL`: A URL pointing to a script file (required)
  2513. * `argString`: Arguments to pass to the script when executed.
  2514. * `nodeThreadcount`: threadcount to use
  2515. * `nodeKeepgoing`: if "true", continue executing on other nodes even if some fail.
  2516. * `asUser` : specifies a username identifying the user who ran the script. Requires `runAs` permission.
  2517. * `scriptInterpreter`: a command to use to run the script (*since version 8*)
  2518. * `interpreterArgsQuoted`: `true`/`false`: if true, the script file and arguments will be quoted as the last argument to the `scriptInterpreter` (*since version 8*)
  2519. * `fileExtension`: extension of of the script file on the remote node (*since version 14*)
  2520. Node filter parameters as described under [Using Node Filters](#using-node-filters)
  2521. If using a json document with Content-type: `application/json`:
  2522. ~~~~~~ {.json}
  2523. {
  2524. "project":"[project]",
  2525. "url":"[scriptURL]",
  2526. "nodeThreadcount": #threadcount#,
  2527. "nodeKeepgoing": true/false,
  2528. "asUser": "[asUser]",
  2529. "argString": "[argString]",
  2530. "scriptInterpreter": "[scriptInterpreter]",
  2531. "interpreterArgsQuoted": true/false,
  2532. "fileExtension": "[fileExtension]",
  2533. "filter": "[node filter string]"
  2534. }
  2535. ~~~~~~
  2536. **Response:**
  2537. A success message, and a single `<execution>` item identifying the
  2538. new execution by ID:
  2539. ~~~~~~~~~~ {.xml}
  2540. <execution id="X" href="[API Href]" permalink="[GUI href]"/>
  2541. ~~~~~~~~~~
  2542. **Since API version 8**: The script interpreter and whether the arguments to the interpreter are quoted can be specified.
  2543. `Content-Type: application/json`:
  2544. ~~~~~~~~~~ {.json}
  2545. {
  2546. "message": "Immediate execution scheduled (X)",
  2547. "execution": {
  2548. "id": X,
  2549. "href": "[API Href]",
  2550. "permalink": "[GUI Href]"
  2551. }
  2552. }
  2553. ~~~~~~~~~~
  2554. ## Key Storage ###
  2555. Upload and manage public and private key files and passwords.
  2556. For more information see the [Administration - Key Storage](../administration/key-storage.html) document.
  2557. Keys are stored via Rundeck's *Storage* facility. This is a path-based interface to manage files. The underlying storage may be on disk or in a database.
  2558. The Storage facility manages "resources", which may be files or directories. File resources can have metadata associated with them (such as MIME content type).
  2559. Note: Private Keys and Passwords can be uploaded but not retrieved directly with this API. They can only be used internally by Rundeck.
  2560. URL:
  2561. /api/11/storage/keys/[PATH]/[FILE]
  2562. ### Upload Keys ####
  2563. Specify the type of key via the `Content-type` header:
  2564. * `application/octet-stream` specifies a **private key**
  2565. * `application/pgp-keys` specifies a **public key**
  2566. * `application/x-rundeck-data-password` specifies a **password**
  2567. Use `POST` to create a new file, or `PUT` to modify an existing file.
  2568. ~~~
  2569. POST /api/11/storage/keys/[PATH]/[FILE]
  2570. Content-Type: [...]
  2571. ~~~
  2572. ~~~
  2573. PUT /api/11/storage/keys/[PATH]/[FILE]
  2574. Content-Type: [...]
  2575. ~~~
  2576. ### List keys ####
  2577. Lists resources at the specified PATH, provides a JSON or XML response based on the `Accept` request header.
  2578. Each resource has a type of `file` or `directory`.
  2579. GET /api/11/storage/keys/[PATH]/
  2580. Response:
  2581. `application/xml`
  2582. ~~~~ {.xml}
  2583. <resource path='keys' type='directory'
  2584. url='http://dignan.local:4440/api/11/storage/keys'>
  2585. <contents count='3'>
  2586. <resource path='keys/test1.pem' type='file'
  2587. url='http://dignan.local:4440/api/11/storage/keys/test1.pem'
  2588. name='test1.pem'>
  2589. <resource-meta>
  2590. <Rundeck-content-type>
  2591. application/octet-stream</Rundeck-content-type>
  2592. <Rundeck-content-size>1679</Rundeck-content-size>
  2593. <Rundeck-content-mask>content</Rundeck-content-mask>
  2594. <Rundeck-key-type>private</Rundeck-key-type>
  2595. </resource-meta>
  2596. </resource>
  2597. <resource path='keys/test1.pub' type='file'
  2598. url='http://dignan.local:4440/api/11/storage/keys/test1.pub'
  2599. name='test1.pub'>
  2600. <resource-meta>
  2601. <Rundeck-content-type>
  2602. application/pgp-keys</Rundeck-content-type>
  2603. <Rundeck-content-size>393</Rundeck-content-size>
  2604. <Rundeck-key-type>public</Rundeck-key-type>
  2605. </resource-meta>
  2606. </resource>
  2607. <resource path='keys/monkey1.pub' type='file'
  2608. url='http://dignan.local:4440/api/11/storage/keys/monkey1.pub'
  2609. name='monkey1.pub'>
  2610. <resource-meta>
  2611. <Rundeck-content-type>
  2612. application/pgp-keys</Rundeck-content-type>
  2613. <Rundeck-content-size>640198</Rundeck-content-size>
  2614. <Rundeck-key-type>public</Rundeck-key-type>
  2615. </resource-meta>
  2616. </resource>
  2617. <resource path='keys/subdir' type='directory'
  2618. url='http://dignan.local:4440/api/11/storage/keys/subdir'>
  2619. </resource>
  2620. </contents>
  2621. </resource>
  2622. ~~~~
  2623. `application/json`
  2624. ~~~~ {.json}
  2625. {
  2626. "resources": [
  2627. {
  2628. "meta": {
  2629. "Rundeck-key-type": "private",
  2630. "Rundeck-content-mask": "content",
  2631. "Rundeck-content-size": "1679",
  2632. "Rundeck-content-type": "application/octet-stream"
  2633. },
  2634. "url": "http://dignan.local:4440/api/11/storage/keys/test1.pem",
  2635. "name": "test1.pem",
  2636. "type": "file",
  2637. "path": "keys/test1.pem"
  2638. },
  2639. {
  2640. "url": "http://dignan.local:4440/api/11/storage/keys/subdir",
  2641. "type": "directory",
  2642. "path": "keys/subdir"
  2643. },
  2644. {
  2645. "meta": {
  2646. "Rundeck-key-type": "public",
  2647. "Rundeck-content-size": "640198",
  2648. "Rundeck-content-type": "application/pgp-keys"
  2649. },
  2650. "url": "http://dignan.local:4440/api/11/storage/keys/monkey1.pub",
  2651. "name": "monkey1.pub",
  2652. "type": "file",
  2653. "path": "keys/monkey1.pub"
  2654. },
  2655. {
  2656. "meta": {
  2657. "Rundeck-key-type": "public",
  2658. "Rundeck-content-size": "393",
  2659. "Rundeck-content-type": "application/pgp-keys"
  2660. },
  2661. "url": "http://dignan.local:4440/api/11/storage/keys/test1.pub",
  2662. "name": "test1.pub",
  2663. "type": "file",
  2664. "path": "keys/test1.pub"
  2665. }
  2666. ],
  2667. "url": "http://dignan.local:4440/api/11/storage/keys",
  2668. "type": "directory",
  2669. "path": "keys"
  2670. }
  2671. ~~~~
  2672. ### Get Key Metadata ####
  2673. Returns the metadata about the stored key file.
  2674. Provides a JSON or XML response based on the `Accept` request header:
  2675. GET /api/11/storage/keys/[PATH]/[FILE]
  2676. Response:
  2677. `application/xml`
  2678. ~~~~ {.xml}
  2679. <resource path='keys/test1.pub' type='file'
  2680. url='http://dignan.local:4440/api/11/storage/keys/test1.pub'
  2681. name='test1.pub'>
  2682. <resource-meta>
  2683. <Rundeck-content-type>
  2684. application/pgp-keys</Rundeck-content-type>
  2685. <Rundeck-content-size>393</Rundeck-content-size>
  2686. <Rundeck-key-type>public</Rundeck-key-type>
  2687. </resource-meta>
  2688. </resource>
  2689. ~~~~
  2690. `application/json`
  2691. ~~~~ {.json}
  2692. {
  2693. "meta": {
  2694. "Rundeck-key-type": "public",
  2695. "Rundeck-content-size": "393",
  2696. "Rundeck-content-type": "application/pgp-keys"
  2697. },
  2698. "url": "http://dignan.local:4440/api/11/storage/keys/test1.pub",
  2699. "name": "test1.pub",
  2700. "type": "file",
  2701. "path": "keys/test1.pub"
  2702. }
  2703. ~~~~
  2704. ### Get Key Contents ####
  2705. Provides the **public key** content if the `Accept` request header matches `*/*` or `application/pgp-keys`:
  2706. GET /api/11/storage/keys/[PATH]/[FILE]
  2707. **Retrieving private key or password file contents is not allowed.**
  2708. A GET request for a private key file if the `Accept` request header matches `*/*` or `application/octet-stream`,
  2709. or a password if the request header matches `*/*` or `application/x-rundeck-data-password`
  2710. will result in a `403 Unauthorized` response.
  2711. GET /api/11/storage/keys/[PATH]/[FILE]
  2712. Accept: application/octet-stream
  2713. ...
  2714. Response:
  2715. 403 Unauthorized
  2716. ...
  2717. ### Delete Keys ####
  2718. Deletes the file if it exists and returns `204` response.
  2719. DELETE /api/11/storage/keys/[PATH]/[FILE]
  2720. ## Projects
  2721. ### Listing Projects ###
  2722. List the existing projects on the server.
  2723. **Request:**
  2724. GET /api/1/projects
  2725. **Response:**
  2726. An Item List of `projects`, each `project` of the form specified in the [Getting Project Info](#getting-project-info) section.
  2727. *Since API version 11*: JSON content can be retrieved with `Accept: application/json`
  2728. ~~~~~ {.json}
  2729. [
  2730. {
  2731. "name":"...",
  2732. "description":"...",
  2733. "url":"...",
  2734. }
  2735. ]
  2736. ~~~~~
  2737. ### Project Creation ###
  2738. Create a new project.
  2739. POST /api/11/projects
  2740. XML content:
  2741. `Content-Type: application/xml`
  2742. ~~~~~~~~~~ {.xml}
  2743. <project>
  2744. <name>name</name>
  2745. <config>
  2746. <property key="propname" value="propvalue"/>
  2747. <!-- ... -->
  2748. </config>
  2749. </project>
  2750. ~~~~~~~~~~
  2751. JSON content:
  2752. `Content-Type: application/json`
  2753. ~~~~~~~~~~ {.json}
  2754. { "name": "myproject", "config": { "propname":"propvalue" } }
  2755. ~~~~~~~~~~
  2756. Response: XML or JSON project definition of the form indicated in the [Getting Project Info](#getting-project-info) section.
  2757. ### Getting Project Info ###
  2758. Get information about a project.
  2759. GET /api/1/project/[PROJECT]
  2760. **Response:**
  2761. An Item List of `projects` with one `project`. XML or JSON is determined by the `Accept` request header. The `project` is of the form:
  2762. `Content-Type: application/xml`
  2763. ~~~~~~~~~~ {.xml}
  2764. <project>
  2765. <name>Project Name</name>
  2766. <description>...</description>
  2767. <!-- additional items -->
  2768. </project>
  2769. ~~~~~~~~~~
  2770. If the project defines a Resource Model Provider URL, then the additional items are:
  2771. ~~~~~~~~~~ {.xml}
  2772. <resources>
  2773. <providerURL>URL</providerURL>
  2774. </resources>
  2775. ~~~~~~~~~~
  2776. Updated in version 11:
  2777. GET /api/11/project/[PROJECT]
  2778. `Content-Type: application/xml`
  2779. ~~~~~~~~~~ {.xml}
  2780. <project url="http://server:4440/api/11/project/NAME">
  2781. <name>Project Name</name>
  2782. <description>...</description>
  2783. <!-- additional items -->
  2784. </project>
  2785. ~~~~~~~~~~
  2786. `Content-Type: application/json` *since version 11*
  2787. ~~~~~~~~~~ {.json}
  2788. {
  2789. "description": "",
  2790. "name": "NAME",
  2791. "url": "http://server:4440/api/11/project/NAME",
  2792. "config": { }
  2793. }
  2794. ~~~~~~~~~~
  2795. **API version 11 and later**: If the user has `configure` authorization for the project, then the project configuration properties are included in the response.
  2796. ~~~~~~~~~~ {.xml}
  2797. <config>
  2798. <property key="[name]" value="[value]"/>
  2799. <!-- ... -->
  2800. </config>
  2801. ~~~~~~~~~~
  2802. ### Project Deletion ###
  2803. Delete an existing projects on the server. Requires 'delete' authorization.
  2804. DELETE /api/11/project/[PROJECT]
  2805. Response:
  2806. 204 No Content
  2807. ### Project Configuration ###
  2808. Retrieve or modify the project configuration data. Requires `configure` authorization for the project.
  2809. #### GET Project Configuration ####
  2810. GET /api/11/project/[PROJECT]/config
  2811. Response, based on `Accept` header:
  2812. `Content-Type: application/xml`
  2813. ~~~~~ {.xml}
  2814. <config>
  2815. <property key="name" value="value"/>
  2816. <!-- ... -->
  2817. </config>
  2818. ~~~~~
  2819. `Content-Type: application/json`
  2820. ~~~~~ {.json}
  2821. {
  2822. "key":"value",
  2823. "key2":"value2..."
  2824. }
  2825. ~~~~~
  2826. `Content-Type: text/plain` ([Java Properties](http://en.wikipedia.org/wiki/.properties)-formatted text.)
  2827. ~~~~~ {.text}
  2828. key=value
  2829. key2=value
  2830. ~~~~~
  2831. #### PUT Project Configuration ####
  2832. Replaces all configuration data with the submitted values.
  2833. **Request:**
  2834. PUT /api/11/project/[PROJECT]/config
  2835. Content:
  2836. `Content-Type: application/xml`
  2837. ~~~~~ {.xml}
  2838. <config>
  2839. <property key="key" value="value"/>
  2840. <!-- ... -->
  2841. </config>
  2842. ~~~~~
  2843. `Content-Type: application/json`
  2844. ~~~~~ {.json}
  2845. {
  2846. "key":"value",
  2847. "key2":"value2..."
  2848. }
  2849. ~~~~~
  2850. `Content-Type: text/plain` ([Java Properties](http://en.wikipedia.org/wiki/.properties)-formatted text.)
  2851. ~~~~~ {.text}
  2852. key=value
  2853. key2=value
  2854. ~~~~~
  2855. Response: same as [GET Project Configuration](#get-project-configuration).
  2856. ### Project Configuration Keys ###
  2857. Retrieve, change or delete individual configuration properties by their key. Requires `configure` authorization for the project.
  2858. URL:
  2859. /api/11/project/[PROJECT]/config/[KEY]
  2860. Request and response formats:
  2861. `application/xml`:
  2862. ~~~ {.xml}
  2863. <property key="[KEY]" value="key value"/>
  2864. ~~~
  2865. `application/json`:
  2866. ~~~ {.json}
  2867. { "[KEY]" : "key value" }
  2868. ~~~
  2869. `text/plain`: the plain text key value
  2870. ~~~ {.text}
  2871. key value
  2872. ~~~
  2873. #### GET Project Configuration Key ####
  2874. Retrieve the value.
  2875. GET /api/11/project/[PROJECT]/config/[KEY]
  2876. #### PUT Project Configuration Key ####
  2877. Set the value.
  2878. PUT /api/11/project/[PROJECT]/config/[KEY]
  2879. #### DELETE Project Configuration Key ####
  2880. Delete the key.
  2881. DELETE /api/11/project/[PROJECT]/config/[KEY]
  2882. Response will be
  2883. 204 No Content
  2884. ### Project Archive Export ###
  2885. Export a zip archive of the project. Requires `export` authorization for the project.
  2886. GET /api/11/project/[PROJECT]/export
  2887. Response content type is `application/zip`
  2888. Optional parameters:
  2889. * `executionIds` a list (comma-separated) of execution IDs. If this is specified then the archive will
  2890. contain *only* executions that are specified, and will not contain Jobs, ACLs, or project configuration/readme files.
  2891. * optionally use `POST` method with with `application/x-www-form-urlencoded` content for large lists of execution IDs
  2892. * optionally, specify `executionIds` multiple times, with a single ID per entry.
  2893. GET Examples:
  2894. GET /api/11/project/AlphaProject/export?executionIds=1,4,9
  2895. GET /api/11/project/AlphaProject/export?executionIds=1&executionIds=4&executionIds=9
  2896. Post:
  2897. POST /api/11/project/AlphaProject/export
  2898. Content-Type: application/x-www-form-urlencoded
  2899. executionIds=1&executionIds=4&executionIds=9&...
  2900. ### Project Archive Import ###
  2901. **Request:**
  2902. Import a zip archive to the project. Requires `import` authorization for the project.
  2903. PUT /api/14/project/[PROJECT]/import{?jobUuidOption,importExecutions,importConfig,importACL}
  2904. Parameters:
  2905. + `jobUuidOption` (optional, string, `preserve/remove`) ... Option declaring how duplicate Job UUIDs should be handled. If `preserve` (default) then imported job UUIDs will not be modified, and may conflict with jobs in other projects. If `remove` then all job UUIDs will be removed before importing.
  2906. + `importExecutions` (optional, boolean, `true/false`) ... If true, import all executions and logs from the archive (default). If false, do not import executions or logs.
  2907. + `importConfig` (optional,boolean,`true/false`) ... If true, import the project configuration from the archive. If false, do not import the project configuration (default).
  2908. + `importACL` (optional,boolean,`true/false`) ... If true, import all of the ACL Policies from the archive. If false, do not import the ACL Policies (default).
  2909. Expected Request Content:
  2910. `Content-Type: application/zip`
  2911. **Response:**
  2912. Note: the import status indicates "failed" if any Jobs had failures,
  2913. otherwise it indicates "successful" even if other files in the archive were not imported.
  2914. Response will indicate whether the imported contents had any errors:
  2915. *All imported jobs and files were successful:*
  2916. `application/xml`
  2917. ~~~ {.xml}
  2918. <import status="successful">
  2919. </import>
  2920. ~~~
  2921. `application/json`
  2922. ~~~ {.json}
  2923. {"import_status":"successful"}
  2924. ~~~
  2925. *Some imported files failed:*
  2926. `application/xml`
  2927. ~~~ {.xml}
  2928. <import status="failed">
  2929. <errors count="[#]">
  2930. <error>Job ABC could not be validated: ...</error>
  2931. <error>Job XYZ could not be validated: ...</error>
  2932. </errors>
  2933. <executionErrors count="[#]">
  2934. <error>Execution 123 could not be imported: ...</error>
  2935. <error>Execution 456 could not be imported: ...</error>
  2936. </executionErrors>
  2937. <aclErrors count="[#]">
  2938. <error>file.aclpolicy could not be validated: ...</error>
  2939. <error>file2.aclpolicy could not be validated: ...</error>
  2940. </aclErrors>
  2941. </import>
  2942. ~~~
  2943. `application/json`
  2944. ~~~ {.json}
  2945. {
  2946. "import_status":"failed",
  2947. "errors": [
  2948. "Job ABC could not be validated: ...",
  2949. "Job XYZ could not be validated: ..."
  2950. ],
  2951. "execution_errors": [
  2952. "Execution 123 could not be imported: ...",
  2953. "Execution 456 could not be imported: ..."
  2954. ],
  2955. "acl_errors": [
  2956. "file.aclpolicy could not be validated: ...",
  2957. "file2.aclpolicy could not be validated: ..."
  2958. ]
  2959. }
  2960. ~~~
  2961. ### Updating and Listing Resources for a Project
  2962. Update or retrieve the Resources for a project. A GET request returns the resources
  2963. for the project, and a POST request will update the resources. (**API version 2** required.)
  2964. #### List Resources for a Project
  2965. **Request:**
  2966. GET /api/2/project/[PROJECT]/resources
  2967. See [Listing Resources](#listing-resources).
  2968. #### Update Resources for a Project
  2969. **Request:**
  2970. POST /api/2/project/[PROJECT]/resources
  2971. POSTing to this URL will set the resources for the project to the content of the request.
  2972. Expected POST Content: For API version 2: either `text/xml` or `text/yaml` Content-Type containing the
  2973. Resource Model definition in [resource-xml](../man5/resource-xml.html) or [resource-yaml](../man5/resource-yaml.html) formats as the request body. (Note: any MIME type ending with '/yaml' or '/x-yaml' or '/xml' will be accepted).
  2974. **Since API version 3**: You can also POST data using a content type supported by a Resource Format Parser plugin. This requires using API version `3`.
  2975. POST Result: A success or failure API response. (See [Response Format](#response-format)).
  2976. Example POST request:
  2977. POST /api/2/project/test/resources
  2978. Content-Type: text/yaml
  2979. node1:
  2980. hostname: node1
  2981. username: bob
  2982. node2:
  2983. hostname: node2
  2984. username: bob
  2985. **Response:**
  2986. 200 OK
  2987. <result success="true">
  2988. <success>
  2989. <message>Resources were successfully updated for project test</message>
  2990. </success>
  2991. </result>
  2992. ### Refreshing Resources for a Project
  2993. **DEPRECATED**
  2994. Refresh the resources for a project via its Resource Model Provider URL. The URL can be
  2995. specified as a request parameter, or the pre-configured URL for the project
  2996. can be used. (**API version 2** required.)
  2997. **Request:**
  2998. POST /api/2/project/[PROJECT]/resources/refresh
  2999. Optional Parameters:
  3000. `providerURL`
  3001. : Specify the Resource Model Provider URL to refresh the resources from. If
  3002. not specified then the configured provider URL in the `project.properties`
  3003. file will be used.
  3004. **Response:**
  3005. A success or failure result with a message.
  3006. The URL requested as the `providerURL` must be allowed by the `project.properties` and `framework.properties` configuration settings according to these rules:
  3007. * If the `providerURL` matches the value of `project.resources.url`, it is allowed.
  3008. * Otherwise, these properties are checked as regular expressions to match the URL:
  3009. * `project.resources.allowedURL.X` in project.properties (X starts at 0).
  3010. * `framework.resources.allowedURL.X` in framework.properties
  3011. * If both files define allowedURL regexes, the URL must match a regex in both of them.
  3012. * Otherwise, if only one file defines regexes, the URL must match one of them.
  3013. * Otherwise if no regexes are defined in either file, the URL is rejected.
  3014. Multiple regexes can be specified in those config files by adding multiple properties:
  3015. project.resources.allowedURL.0=^http://myserver:9090/resources/.*$
  3016. project.resources.allowedURL.1=^http://server2:9090/resources/.*$
  3017. ### Project Readme File
  3018. The `readme.md` and `motd.md` files,
  3019. which are Markdown formatted and displayed in the Project listing page,
  3020. can be managed via the API. (See [Project Readme.md](http://rundeck.org/docs/administration/project-setup.html#project-readme.md).)
  3021. **Request:**
  3022. /api/13/project/[PROJECT]/readme.md
  3023. /api/13/project/[PROJECT]/motd.md
  3024. Method: `GET`, `PUT` and `DELETE`.
  3025. Format: XML, JSON and plain text formats.
  3026. #### GET Readme File
  3027. GET /api/13/project/[PROJECT]/readme.md
  3028. GET /api/13/project/[PROJECT]/motd.md
  3029. Response format depends on the `Accept:` HTTP header.
  3030. `text/plain`:
  3031. The readme contents
  3032. `application/xml`:
  3033. ```{.xml}
  3034. <contents>The readme contents</contents>
  3035. ```
  3036. *Note*: XML output will use CDATA to preserve formatting of the contents
  3037. `application/json`:
  3038. ```{.json}
  3039. {"contents":"The readme contents"}
  3040. ```
  3041. If the file does not exist, then the response will be : `404 Not Found`
  3042. #### PUT Readme File
  3043. PUT /api/13/project/[PROJECT]/readme.md
  3044. PUT /api/13/project/[PROJECT]/motd.md
  3045. To create or modify the contents, use a `PUT` request, and `Content-Type` header to specify the same format. Use the same format as returned by the GET responses.
  3046. #### DELETE Readme File
  3047. DELETE /api/13/project/[PROJECT]/readme.md
  3048. DELETE /api/13/project/[PROJECT]/motd.md
  3049. Deletes the resource if it exists.
  3050. Response: `204 No Content`
  3051. ### Project ACLs
  3052. Manage a set of ACL Policy files for a project. These files will apply to the specified project only,
  3053. and must either have a `context:` section which specifies the project context, or have no `context:` section.
  3054. The request and response formats for Project ACL Policies matches that of the
  3055. [System ACL Policies][/api/V/system/acl/*],
  3056. however the URL is rooted under the Project's URL path: `/api/13/project/[PROJECT]/acl/*`.
  3057. For more information about ACL Policies see:
  3058. * [ACLPOLICY format][ACLPOLICY]
  3059. * [Access Control Policy](../administration/access-control-policy.html)
  3060. #### List Project ACL Policies
  3061. **Request:**
  3062. GET /api/13/project/[PROJECT]/acl/
  3063. See [List System ACL Policies](#list-system-acl-policies) for request and response.
  3064. #### Get a Project ACL Policy
  3065. **Request:**
  3066. GET /api/13/project/[PROJECT]/acl/name.aclpolicy
  3067. See [Get an ACL Policy](#get-an-acl-policy) for request and response.
  3068. #### Create a Project ACL Policy
  3069. **Request:**
  3070. POST /api/13/project/[PROJECT]/acl/name.aclpolicy
  3071. See [Create an ACL Policy](#create-an-acl-policy) for request and response.
  3072. #### Update a Project ACL Policy
  3073. **Request:**
  3074. PUT /api/13/project/[PROJECT]/acl/name.aclpolicy
  3075. See [Update an ACL Policy](#update-an-acl-policy) for request and response.
  3076. #### Delete a Project ACL Policy
  3077. **Request:**
  3078. DELETE /api/13/project/[PROJECT]/acl/name.aclpolicy
  3079. See [Delete an ACL Policy](#delete-an-acl-policy)
  3080. ## Listing History
  3081. List the event history for a project.
  3082. **Request:**
  3083. GET /api/14/project/[PROJECT]/history
  3084. (**Deprecated URL**: `/api/14/history`, requires URL parameter: `project`.)
  3085. Optional Parameters:
  3086. * History query parameters:
  3087. * `jobIdFilter`: include events for a job ID.
  3088. * `reportIdFilter`: include events for an event Name.
  3089. * `userFilter`: include events created by a user
  3090. * `statFilter`: include events based on result status. this can be 'succeed','fail', or 'cancel'.
  3091. * `jobListFilter`: include events for the job by name, format: 'group/name'. To use multiple values, include this parameter multiple times. (Since *API v5*)
  3092. * `excludeJobListFilter`: exclude events for the job by name, format: 'group/name'. To use multiple values, include this parameter multiple times. (Since *API v5*)
  3093. * Date query parameters:
  3094. * `recentFilter`: Use a simple text format to filter events that occurred within a period of time. The format is "XY" where X is an integer, and "Y" is one of:
  3095. * `h`: hour
  3096. * `d`: day
  3097. * `w`: week
  3098. * `m`: month
  3099. * `y`: year
  3100. So a value of "2w" would return events within the last two weeks.
  3101. * `begin`: Specify exact date for earliest result.
  3102. * `end`: Specify exact date for latest result.
  3103. * Paging parameters:
  3104. * `max`: indicate the maximum number of events to return. The default maximum to return is 20.
  3105. * `offset`: indicate the 0-indexed offset for the first event to return.
  3106. The format for the `end`, and `begin` filters is either: a unix millisecond timestamp, or a W3C dateTime string in the format "yyyy-MM-ddTHH:mm:ssZ".
  3107. The format for the `jobListFilter` and `excludeJobListFilter` is the job's group and name separated by a '/' character, such as: "group1/job name", or "my job" if there is no group.
  3108. **Response:**
  3109. `Content-Type: application/xml`: an Item List of `events`. Each `event` has this form:
  3110. ~~~~~~~~~~ {.xml}
  3111. <event starttime="[unixtime]" endtime="[unixtime]">
  3112. <title>[job title, or "adhoc"]</title>
  3113. <status>[status]</status>
  3114. <summary>[summary text]</summary>
  3115. <node-summary succeeded="[X]" failed="[Y]" total="[Z]"/>
  3116. <user>[user]</user>
  3117. <project>[project]</project>
  3118. <date-started>[start date]</date-started>
  3119. <date-ended>[end date]</date-ended>
  3120. <!-- if the execution was aborted, the username who aborted it: -->
  3121. <abortedby>[username]</abortedby>
  3122. <!-- if associated with an Execution, include the execution id: -->
  3123. <execution id="[execid]" href="[api href]" permalink="[gui href]"/>
  3124. <!-- if associated with a Job, include the Job ID: -->
  3125. <job id="[jobid]" href="[api href]" permalink="[gui href]"/>
  3126. </event>
  3127. ~~~~~~~~~~
  3128. The `events` element will also have `max`, `offset`, and `total` attributes, to indicate the state of paged results. E.G:
  3129. ~~~~ {.xml}
  3130. <events count="8" total="268" max="20" offset="260">
  3131. ...
  3132. </events>
  3133. ~~~~ {.xml}
  3134. `total` is the total number of events matching the query parameters.
  3135. `count` is the number of events included in the results.
  3136. `max` is the paging size as specified in the request, or with the default value of 20.
  3137. `offset` is the offset specified, or default value of 0.
  3138. **As of v14**: the `<execution>` and `<job>` elements will have a `href` attribute with the URL to the API for that resource, and a `permalink` attribute with the URL to the GUI view for the job or execution.
  3139. `Content-Type: application/json`:
  3140. ~~~~~~ {.json}
  3141. {
  3142. "paging": {
  3143. "count": 10,
  3144. "total": 110,
  3145. "max": 20,
  3146. "offset": 100
  3147. },
  3148. "events": [...]
  3149. }
  3150. ~~~~~~
  3151. The `events` array contains elements like:
  3152. ~~~~~ {.json}
  3153. {
  3154. "starttime": #unixtime,
  3155. "endtime": #unixtime,
  3156. "title": "[job title, or "adhoc"]",
  3157. "status": "[status]",
  3158. "statusString": "[string]",
  3159. "summary": "[summary text]",
  3160. "node-summary": {
  3161. "succeeded": #X,
  3162. "failed": #Y,
  3163. "total": #Z
  3164. },
  3165. "user": "[user]",
  3166. "project": "[project]",
  3167. "date-started": "[yyyy-MM-ddTHH:mm:ssZ]",
  3168. "date-ended": "[yyyy-MM-ddTHH:mm:ssZ]",
  3169. "job": {
  3170. "id": "[uuid]",
  3171. "href": "[api href]"
  3172. },
  3173. "execution": {
  3174. "id": "[id]",
  3175. "href": "[api href]"
  3176. }
  3177. }
  3178. ~~~~~
  3179. ## Resources/Nodes
  3180. ### Listing Resources
  3181. List or query the resources for a project.
  3182. **Request:**
  3183. GET /api/14/project/[PROJECT]/resources
  3184. (**Deprecated URL**: `/api/1/resources` requires `project` query parameter.)
  3185. Optional Parameters:
  3186. * `format` : Result format. Default is "xml", can use "yaml" or "json", or an installed ResourceFormat plugin name.
  3187. * Node Filter parameters: You can select resources to include and exclude in the result set, see [Using Node Filters](#using-node-filters) below.
  3188. **Note:** If no query parameters are included, the result set will include all Node resources for the project.
  3189. **Response:**
  3190. Depending on the `format` parameter, a value of "xml" will return [resource-xml](../man5/resource-xml.html) and "yaml" will return [resource-yaml](../man5/resource-yaml.html), and "json" will return [resource-json](../man5/resource-json.html) formatted results. Any other supported format value will return content in the specified format.
  3191. ### Getting Resource Info
  3192. Get a specific resource within a project.
  3193. **Request:**
  3194. GET /api/14/project/[PROJECT]/resource/[NAME]
  3195. (**Deprecated URL**: `/api/1/resource/[NAME]` requires `project` query parameter.)
  3196. Optional Parameters:
  3197. * `format` : Result format. Default is "xml", can use "yaml" or "json", or an installed ResourceFormat plugin name.
  3198. **Response:**
  3199. Depending on the `format` parameter, a value of "xml" will return [resource-xml](../man5/resource-xml.html) and "yaml" will return [resource-yaml](../man5/resource-yaml.html), and "json" will return [resource-json](../man5/resource-json.html) formatted results.
  3200. The result will contain a single item for the specified resource.
  3201. ### Using Node Filters
  3202. Refer to the [User Guide - Node Filters](../manual/node-filters.html) Documentation for information on
  3203. the node filter syntax and usage.
  3204. A basic node filter looks like:
  3205. attribute: value attribute2: value2
  3206. To specify a Node Filter string as a URL parameter for an API request, use a parameter named `filter`.
  3207. Your HTTP client will have to correctly escape the value of the `filter` parameter. For example you can
  3208. use `curl` like this;
  3209. curl --data-urlencoded "filter=attribute: value"
  3210. Common attributes:
  3211. * `name` - node name
  3212. * `tags` - tags
  3213. * `hostname`
  3214. * `username`
  3215. * `osFamily`, `osName`, `osVersion`, `osArch`
  3216. Custom attributes can also be used.
  3217. Note: previous Rundeck versions supported individual URL parameters for specific node filter attributes,
  3218. these are deprecated, but mentioned below.
  3219. ##### Deprecated Node Filter parameters
  3220. To include certain resources, specify the inclusion filters:
  3221. * `hostname`, `tags`, `os-[name,family,arch,version]`, `name`
  3222. To exclude certain resources, specify the exclusion filters as above but with `exclude-` prepended:
  3223. * `exclude-hostname`, `exclude-tags`, etc..
  3224. To specify which type of filter (inclusion or exclusion) takes precedence, specify:
  3225. * `exclude-precedence` : Whether exclusion filters take precedence. "true"/"false" (default is "true").
  3226. If using only inclusion filters, the result set will be only those resources which *do* match the filters.
  3227. If using only exclusion filters, the result set will be only those resources which *do not* match the filters.
  3228. When using both types of filters, the result will depend on the `exclude-precedence` value (default true).
  3229. * When `exclude-precedence` is true:
  3230. 1. First select the resources which *do not* match the **exclusion** filters.
  3231. 2. Then select from those the resources which *do* match the **inclusion** filters.
  3232. * When `exclude-precedence` is false:
  3233. 1. First select all resources.
  3234. 2. Then remove the resources which *do not* match the **exclusion** filters.
  3235. 3. Then add the resources which *do* match the **inclusion** filters.
  3236. The difference between these results is apparent when you have resources which are matched by both the exclusion and the inclusion filters. The precedence determines whether those resources are included or not.
  3237. Using set logic, if "A" is the set of all resources, "X" is the set of all resources matching the exclusion filters, and "I" is the set of all resources matching the inclusion filters, then:
  3238. * when `exclude-precedence=true` then the result is:
  3239. * $( A - X ) \cap I$
  3240. * which is also $I - X$
  3241. * when `exclude-precedence=false` then the result is:
  3242. * $( A - X ) \cup I$
  3243. ## SCM
  3244. Rundeck SCM Plugins can be used to synchronize Job definitions with an external Source Control Management repository.
  3245. Currently Rundeck includes a single built-in plugin for Git repositories.
  3246. There are two "integration" types of SCM Plugins: `import` and `export`, and they are managed separately.
  3247. A Project can be configured with a single Import and Export plugin. After setting up these plugins, Project and Job level "status" can be read. Changes to Jobs within a project affect the status for Import or Export.
  3248. Plugins provide "actions" which are available based on the Project or Job status. For example, a plugin can provide a "commit" action for a Job, which allows a user to save the changes for the job.
  3249. The specific actions, and their behaviors depend on the plugin. The actions can be listed and performed via the API.
  3250. ### List SCM Plugins
  3251. Lists the available plugins for the specified integration. Each plugin is identified by a `type` name.
  3252. **Request**
  3253. GET /api/15/project/[PROJECT]/scm/[INTEGRATION]/plugins
  3254. **Response**
  3255. A list of plugin description.
  3256. Each plugin has these properties:
  3257. * `type` identifier for the plugin
  3258. * `configured` true/false whether a configuration is stored for the plugin
  3259. * `enabled` true/false whether the plugin is enabled
  3260. * `title` display title for the plugin
  3261. * `description` descriptive text for the plugin
  3262. `Content-Type: application/xml`:
  3263. ~~~~~~~~~~ {.xml}
  3264. <scmPluginList>
  3265. <integration>[$integration]</integration>
  3266. <plugins>
  3267. <scmPluginDescription>
  3268. <configured>[$boolean]</configured>
  3269. <description>[$string]</description>
  3270. <enabled>[$boolean]</enabled>
  3271. <title>[$string]</title>
  3272. <type>[$type]</type>
  3273. </scmPluginDescription>
  3274. </plugins>
  3275. </scmPluginList>
  3276. ~~~~~~~~~~
  3277. `Content-Type: application/json`:
  3278. ~~~~~~~~~~ {.json}
  3279. {
  3280. "integration": "$integration",
  3281. "plugins": [
  3282. {
  3283. "configured": $boolean,
  3284. "description": "$string",
  3285. "enabled": $boolean,
  3286. "title": "$string",
  3287. "type": "$type"
  3288. }
  3289. ]
  3290. }
  3291. ~~~~~~~~~~
  3292. ### Get SCM Plugin Input Fields
  3293. List the input fields for a specific plugin. The `integration` and `type` must be specified.
  3294. The response will list each input field.
  3295. **Request**
  3296. GET /api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/input
  3297. **Response**
  3298. Input fields have a number of properties:
  3299. * `name` identifier for the field, used when submitting the input values.
  3300. * `defaultValue` a default value if the input does not specify one
  3301. * `description` textual description
  3302. * `renderOptions` a key/value map of options, such as declaring that GUI display the input as a password field.
  3303. * `required` true/false whether the input is required
  3304. * `scope`
  3305. * `title` display title for the field
  3306. * `type` data type of the field: `String`, `Integer`, `Select` (multi-value), `FreeSelect` (open-ended multi-value), `Boolean` (true/false)
  3307. * `values` if the type is `Select` or `FreeSelect`, a list of string values to choose from
  3308. `Content-Type: application/xml`:
  3309. ~~~~~~~~~~ {.xml}
  3310. <scmPluginSetupInput>
  3311. <integration>$integration</integration>
  3312. <type>$type</type>
  3313. <fields>
  3314. <scmPluginInputField>
  3315. <defaultValue>$string</defaultValue>
  3316. <description>$string</description>
  3317. <name>$string</name>
  3318. <renderingOptions>
  3319. <entry key="$string">$string</entry>
  3320. <!-- <entry ... -->
  3321. </renderingOptions>
  3322. <required>$boolean</required>
  3323. <scope>$string</scope>
  3324. <title>$string</title>
  3325. <type>$string</type>
  3326. <values>
  3327. <!-- may be empty -->
  3328. <string>$string</string>
  3329. <string>$string</string>
  3330. <!-- <string ... -->
  3331. </values>
  3332. </scmPluginInputField>
  3333. <!--
  3334. <scmPluginInputField>...</scmPluginInputField>
  3335. -->
  3336. </fields>
  3337. </scmPluginSetupInput>
  3338. ~~~~~~~~~~
  3339. `Content-Type: application/json`:
  3340. ~~~~~~~~~~ {.json}
  3341. {
  3342. "fields": [
  3343. {
  3344. "defaultValue": "$string",
  3345. "description": "$string",
  3346. "name": "$string",
  3347. "renderingOptions": {
  3348. "$string": "$string"
  3349. },
  3350. "required": $boolean,
  3351. "scope": "$string",
  3352. "title": "$string",
  3353. "type": "$string",
  3354. "values": null or array
  3355. }
  3356. //...
  3357. ],
  3358. "integration": "$integration",
  3359. "type": "$type"
  3360. }
  3361. ~~~~~~~~~~
  3362. ### Setup SCM Plugin for a Project
  3363. Configure and enable a plugin for a project.
  3364. The request body is expected to contain entries for all of the `required` input fields for the plugin.
  3365. If a validation error occurs with the configuration, then the response will include detail about the errors.
  3366. **Request**
  3367. POST /api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/setup
  3368. Content:
  3369. `Content-Type: application/xml`
  3370. ~~~~~ {.xml}
  3371. <scmPluginConfig>
  3372. <config>
  3373. <entry key="key">value</entry>
  3374. <entry key="key2">value2</entry>
  3375. <!-- ... -->
  3376. </config>
  3377. </scmPluginConfig>
  3378. ~~~~~
  3379. `Content-Type: application/json`
  3380. ~~~~~ {.json}
  3381. {
  3382. "config":{
  3383. "key":"value",
  3384. "key2":"value2..."
  3385. }
  3386. }
  3387. ~~~~~
  3388. **Response**
  3389. If a validation error occurs, the response will include information about the result.
  3390. HTTP/1.1 400 Bad Request
  3391. `Content-Type: application/xml`:
  3392. ~~~~~~~~~~ {.xml}
  3393. <scmActionResult>
  3394. <message>Some input values were not valid.</message>
  3395. <nextAction />
  3396. <success>false</success>
  3397. <validationErrors>
  3398. <entry key="dir">required</entry>
  3399. <entry key="url">required</entry>
  3400. </validationErrors>
  3401. </scmActionResult>
  3402. ~~~~~~~~~~
  3403. `Content-Type: application/json`:
  3404. ~~~~~~~~~~ {.json}
  3405. {
  3406. "message": "Some input values were not valid.",
  3407. "nextAction": null,
  3408. "success": false,
  3409. "validationErrors": {
  3410. "dir": "required",
  3411. "url": "required"
  3412. }
  3413. }
  3414. ~~~~~~~~~~
  3415. If the result is successul:
  3416. HTTP/1.1 200 OK
  3417. `Content-Type: application/xml`:
  3418. ~~~~~~~~~~ {.xml}
  3419. <scmActionResult>
  3420. <message>$string</message>
  3421. <success>true</success>
  3422. <nextAction />
  3423. <validationErrors/>
  3424. </scmActionResult>
  3425. ~~~~~~~~~~
  3426. `Content-Type: application/json`:
  3427. ~~~~~~~~~~ {.json}
  3428. {
  3429. "message": "$string",
  3430. "nextAction": null,
  3431. "success": true,
  3432. "validationErrors": null
  3433. }
  3434. ~~~~~~~~~~
  3435. If a follow-up **Action** is expected to be called, the action ID will be identified by the `nextAction` value.
  3436. See [Get Project SCM Status](#get-project-scm-status).
  3437. ### Enable SCM Plugin for a Project
  3438. Enable a plugin that was previously configured. (Idempotent)
  3439. **Request**
  3440. POST /api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/enable
  3441. No content body is expected.
  3442. **Response**
  3443. Same response as [Setup SCM Plugin for a Project](#setup-scm-plugin-for-a-project).
  3444. ### Disable SCM Plugin for a Project
  3445. Disable a plugin. (Idempotent)
  3446. **Request**
  3447. POST /api/15/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/disable
  3448. No content body is expected.
  3449. **Response**
  3450. Same response as [Setup SCM Plugin for a Project](#setup-scm-plugin-for-a-project).
  3451. ### Get Project SCM Status
  3452. Get the SCM plugin status and available actions for the project.
  3453. **Request**
  3454. GET /api/15/project/[PROJECT]/scm/[INTEGRATION]/status
  3455. **Response**
  3456. If no plugin is configured:
  3457. HTTP/1.1 404 Not Found
  3458. Otherwise:
  3459. HTTP/1.1 200 OK
  3460. The plugin status has these properties:
  3461. * `actions` empty, or a list of action ID strings
  3462. * `integration` the integration
  3463. * `message` a string indicating the status message
  3464. * `synchState` a value indicating the state
  3465. * `project` project name
  3466. Import plugin values for `synchState`:
  3467. * `CLEAN` - no changes
  3468. * `UNKNOWN` - status unknown
  3469. * `REFRESH_NEEDED` - plugin needs to refresh
  3470. * `IMPORT_NEEDED` - some changes need to be imported
  3471. * `DELETE_NEEDED` - some jobs need to be deleted
  3472. Export plugin values for `synchState`:
  3473. * `CLEAN` - no changes
  3474. * `REFRESH_NEEDED` - plugin needs to refresh
  3475. * `EXPORT_NEEDED` - some changes need to be exported
  3476. * `CREATE_NEEDED` - some jobs need to be added to the repo
  3477. `Content-Type: application/xml`:
  3478. ~~~~~~~~~~ {.xml}
  3479. <scmProjectStatus>
  3480. <actions>
  3481. <string>action1</string>
  3482. <string>action2</string>
  3483. </actions>
  3484. <integration>$integration</integration>
  3485. <message>$string</message>
  3486. <project>$project</project>
  3487. <synchState>$state</synchState>
  3488. </scmProjectStatus>
  3489. ~~~~~~~~~~
  3490. `Content-Type: application/json`:
  3491. ~~~~~~~~~~ {.json}
  3492. {
  3493. "actions": ['action1','action2',..],
  3494. "integration": "$integration",
  3495. "message": null,
  3496. "project": "$project",
  3497. "synchState": "$state"
  3498. }
  3499. ~~~~~~~~~~
  3500. ### Get Project SCM Config
  3501. Get the configuration properties for the current plugin.
  3502. **Request**
  3503. GET /api/15/project/[PROJECT]/scm/[INTEGRATION]/config
  3504. **Response**
  3505. If no plugin for the given integration is configured for the project, a `404` response is sent:
  3506. HTTP/1.1 404 Not Found
  3507. Otherwise the response contains:
  3508. * `config` a set of key/value pairs for the configuration
  3509. * `enabled` true/false if it is enabled
  3510. * `integration` integration name
  3511. * `project` project name
  3512. * `type` plugin type name
  3513. `Content-Type: application/xml`:
  3514. ~~~~~~~~~~ {.xml}
  3515. <scmProjectPluginConfig>
  3516. <config>
  3517. <entry key="key">value</entry>
  3518. <entry key="key2">value2</entry>
  3519. <!-- <entry ..>...</entry> -->
  3520. </config>
  3521. <enabled>$boolean</enabled>
  3522. <integration>$integration</integration>
  3523. <project>$project</project>
  3524. <type>$type</type>
  3525. </scmProjectPluginConfig>
  3526. ~~~~~~~~~~
  3527. `Content-Type: application/json`:
  3528. ~~~~~~~~~~ {.json}
  3529. {
  3530. "config": {
  3531. "key": "$string",
  3532. "key2": "$string"
  3533. },
  3534. "enabled": $boolean,
  3535. "integration": "$integration",
  3536. "project": "$project",
  3537. "type": "$type"
  3538. }
  3539. ~~~~~~~~~~
  3540. ### Get Project SCM Action Input Fields
  3541. Get the input fields and selectable items for a specific action.
  3542. Each action may have a set of Input Fields describing user-input values.
  3543. Export actions may have a set of `scmExportActionItem`s which describe Job changes that can be
  3544. included in the action.
  3545. Import actions may have a set of `scmImportActionItem`s which describe paths from the import repo
  3546. which can be selected for the action, they will also be associated with a Job after they are matched.
  3547. **Request**
  3548. GET /api/15/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]/input
  3549. **Response**
  3550. `Content-Type: application/xml`:
  3551. The content of `<scmPluginInputField>` is the same as shown in [Get SCM Plugin Input Fields](#get-scm-plugin-input-fields).
  3552. `scmExportActionItem` values:
  3553. * `itemId` - ID of the repo item, e.g. a file path
  3554. * `job` - job information
  3555. * `groupPath` group path, or empty/null
  3556. * `jobId` job ID
  3557. * `jobName` job name
  3558. * `deleted` - boolean, whether the job was deleted and requires deleting the associated repo item
  3559. * `renamed` - boolean if the job was renamed
  3560. * `originalId` - ID of a repo item if the job was renamed and now is stored at a different repo path, or empty/null
  3561. `scmImportActionItem` values:
  3562. * `itemId` - ID of the repo item, e.g. a file path
  3563. * `job` - job information, may be empty/null
  3564. * `groupPath` group path, or empty
  3565. * `jobId` job ID
  3566. * `jobName` job name
  3567. * `tracked` - boolean, true if there is an associated `job`
  3568. ~~~~~~~~~~ {.xml}
  3569. <scmActionInput>
  3570. <actionId>$actionId</actionId>
  3571. <description />
  3572. <fields>
  3573. <scmPluginInputField>...</scmPluginInputField>
  3574. </fields>
  3575. <integration>$integration</integration>
  3576. <title>$string</title>
  3577. <importItems>
  3578. <!-- import only -->
  3579. <scmImportActionItem>
  3580. <itemId>$string</itemId>
  3581. <job>
  3582. <!-- job tag may be empty if no associated job-->
  3583. <groupPath>$jobgroup</groupPath>
  3584. <jobId>$jobid</jobId>
  3585. <jobName>$jobname</jobName>
  3586. </job>
  3587. <tracked>$boolean</tracked>
  3588. </scmImportActionItem>
  3589. </importItems>
  3590. <exportItems>
  3591. <!-- export only -->
  3592. <scmExportActionItem>
  3593. <deleted>$boolean</deleted>
  3594. <itemId>$string</itemId>
  3595. <job>
  3596. <groupPath>$jobgroup</groupPath>
  3597. <jobId>$jobid</jobId>
  3598. <jobName>$jobname</jobName>
  3599. </job>
  3600. <originalId>$string</originalId>
  3601. <renamed>$boolean</renamed>
  3602. </scmExportActionItem>
  3603. </exportItems>
  3604. </scmActionInput>
  3605. ~~~~~~~~~~
  3606. `Content-Type: application/json`:
  3607. The content of `"fields"` array is the same as shown in [Get SCM Plugin Input Fields](#get-scm-plugin-input-fields).
  3608. ~~~~~~~~~~ {.json}
  3609. {
  3610. "actionId": "$actionId",
  3611. "description": "$string",
  3612. "fields": [
  3613. { "name": ...
  3614. }
  3615. ],
  3616. "integration": "$integration",
  3617. "title": "$string",
  3618. "importItems": [
  3619. {
  3620. "itemId": "$string",
  3621. "job": {
  3622. "groupPath": "$jobgroup",
  3623. "jobId": "$jobid",
  3624. "jobName": "$jobname"
  3625. },
  3626. "tracked": $boolean
  3627. }
  3628. ],
  3629. "exportItems": [
  3630. {
  3631. "deleted": $boolean,
  3632. "itemId": "$string",
  3633. "job": {
  3634. "groupPath": "$jobgroup",
  3635. "jobId": "$jobid",
  3636. "jobName": "$jobname"
  3637. },
  3638. "originalId": "$string",
  3639. "renamed": $boolean
  3640. }
  3641. ]
  3642. }
  3643. ~~~~~~~~~~
  3644. ### Perform Project SCM Action
  3645. Perform the action for the SCM integration plugin, with a set of input parameters,
  3646. selected Jobs, or Items, or Items to delete.
  3647. Depending on the [available Input Fields for the action](#get-project-scm-action-input-fields), the action will
  3648. expect a set of `input` values.
  3649. The set of `jobs` and `items` to choose from will be included in the Input Fields response,
  3650. however where an Item has an associated Job, you can supply either the Job ID, or the Item ID.
  3651. When there are items to be deleted (`export` integration), you can specify the Item IDs in the `deleted`
  3652. section. However, if the item is associated with a renamed Job, including the Job ID will have the same effect.
  3653. Note: including the Item ID of an associated job, instead of the Job ID,
  3654. will not automatically delete a renamed item.
  3655. **Request**
  3656. POST /api/15/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]
  3657. `Content-Type: application/xml`:
  3658. ~~~~~~~~~~ {.xml}
  3659. <scmAction>
  3660. <input>
  3661. <entry key="message">$commitMessage</entry>
  3662. </input>
  3663. <jobs>
  3664. <job jobId="$jobId"/>
  3665. </jobs>
  3666. <items>
  3667. <item itemId="$itemId"/>
  3668. </items>
  3669. <deleted></deleted>
  3670. </scmAction>
  3671. ~~~~~~~~~~
  3672. `Content-Type: application/json`:
  3673. ~~~~~~~~~~ {.json}
  3674. {
  3675. "input":{
  3676. "message":"$commitMessage"
  3677. },
  3678. "jobs":[
  3679. "$jobId"
  3680. ],
  3681. "items":[
  3682. "$itemId"
  3683. ],
  3684. "deleted":null
  3685. }
  3686. ~~~~~~~~~~
  3687. **Response**
  3688. Same response as [Setup SCM Plugin for a Project](#setup-scm-plugin-for-a-project).
  3689. ### Get Job SCM Status
  3690. **Request**
  3691. GET /api/15/job/[ID]/scm/[INTEGRATION]/status
  3692. **Response**
  3693. Note: `import` status will not include any actions for the job, refer to the Project status to list import actions.
  3694. Import plugin values for `$synchState`:
  3695. * `CLEAN` - no changes
  3696. * `UNKNOWN` - status unknown, e.g. the job was not imported via SCM
  3697. * `REFRESH_NEEDED` - plugin needs to refresh
  3698. * `IMPORT_NEEDED` - Job changes need to be imported
  3699. * `DELETE_NEEDED` - Job need to be deleted
  3700. Export plugin values for `$synchState`:
  3701. * `CLEAN` - no changes
  3702. * `REFRESH_NEEDED` - plugin needs to refresh
  3703. * `EXPORT_NEEDED` - job changes need to be exported
  3704. * `CREATE_NEEDED` - Job needs to be added to the repo
  3705. `Content-Type: application/xml`:
  3706. ~~~~~~~~~~ {.xml}
  3707. <scmJobStatus>
  3708. <actions>
  3709. <string>$action</string>
  3710. <!--
  3711. <string>$action2</string>
  3712. -->
  3713. </actions>
  3714. <commit>
  3715. <author>$commitAuthor</author>
  3716. <commitId>$commitId</commitId>
  3717. <date>$commitDate</date>
  3718. <info>
  3719. <entry key="key">value</entry>
  3720. <!-- <entry key="..">...</entry> -->
  3721. </info>
  3722. <message>$commitMessage</message>
  3723. </commit>
  3724. <id>$jobId</id>
  3725. <integration>$integration</integration>
  3726. <message>$statusMessage</message>
  3727. <project>$project</project>
  3728. <synchState>$synchState</synchState>
  3729. </scmJobStatus>
  3730. ~~~~~~~~~~
  3731. `Content-Type: application/json`:
  3732. ~~~~~~~~~~ {.json}
  3733. {
  3734. "actions": [
  3735. "$action"
  3736. ],
  3737. "commit": {
  3738. "author": "$commitAuthor",
  3739. "commitId": "$commitId",
  3740. "date": "$commitDate",
  3741. "info": {
  3742. "key": "value.."
  3743. },
  3744. "message": "$commitMessage"
  3745. },
  3746. "id": "$jobId",
  3747. "integration": "$integration",
  3748. "message": "$statusMessage",
  3749. "project": "$project",
  3750. "synchState": "$synchState"
  3751. }
  3752. ~~~~~~~~~~
  3753. ### Get Job SCM Diff
  3754. Retrieve the file diff for the Job, if there are changes for the integration.
  3755. The format of the diff content depends on the specific plugin. For the Git plugins,
  3756. a unified diff format is used.
  3757. **Request**
  3758. GET /api/15/job/[ID]/scm/[INTEGRATION]/diff
  3759. **Response**
  3760. The `commit` info will be the same structure as in [Get Job SCM Status](#get-job-scm-status).
  3761. For `import` only, `incomingCommit` will indicate the to-be-imported change.
  3762. For `application/xml`, the `diffContent` will use a CDATA section to preserve whitespace.
  3763. `Content-Type: application/xml`:
  3764. ~~~~~~~~~~ {.xml}
  3765. <scmJobDiff>
  3766. <commit>
  3767. <!-- commit info -->
  3768. </commit>
  3769. <diffContent><![CDATA[...]]></diffContent>
  3770. <id>$jobId</id>
  3771. <incomingCommit>
  3772. <!-- import only: incoming commit info -->
  3773. </incomingCommit>
  3774. <integration>$integration</integration>
  3775. <project>$project</project>
  3776. </scmJobDiff>
  3777. ~~~~~~~~~~
  3778. `Content-Type: application/json`:
  3779. ~~~~~~~~~~ {.json}
  3780. {
  3781. "commit": {
  3782. ...
  3783. },
  3784. "diffContent": "...",
  3785. "id": "$jobId",
  3786. "incomingCommit": {
  3787. ...
  3788. },
  3789. "integration": "$integration",
  3790. "project": "$project"
  3791. }
  3792. ~~~~~~~~~~
  3793. ### Get Job SCM Action Input Fields
  3794. Get the input fields and selectable items for a specific action for a job.
  3795. Each action may have a set of Input Fields describing user-input values.
  3796. Export actions will include one `scmExportActionItem` for the Job.
  3797. Import actions may have a set of `scmImportActionItem` for the job.
  3798. **Request**
  3799. GET /api/15/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]/input
  3800. **Response**
  3801. The same response format as in [Get Project SCM Action Input Fields](#get-project-scm-action-input-fields).
  3802. ### Perform Job SCM Action
  3803. **Request**
  3804. POST /api/15/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]
  3805. Request Content is nearly exactly as expected in [Perform Project SCM Action](#perform-project-scm-action),
  3806. however the `jobIds` do not need to be specified, as the `ID` of the job is already specified.
  3807. The `items` and `deleted` sections are not used.
  3808. Only the `input` values need to be specified:
  3809. `Content-Type: application/xml`:
  3810. ~~~~~~~~~~ {.xml}
  3811. <scmAction>
  3812. <input>
  3813. <entry key="message">$commitMessage</entry>
  3814. </input>
  3815. </scmAction>
  3816. ~~~~~~~~~~
  3817. `Content-Type: application/json`:
  3818. ~~~~~~~~~~ {.json}
  3819. {
  3820. "input":{
  3821. "message":"$commitMessage"
  3822. }
  3823. }
  3824. ~~~~~~~~~~
  3825. **Response**
  3826. Same response as [Setup SCM Plugin for a Project](#setup-scm-plugin-for-a-project).
  3827. ## Index
  3828. [/api/V/execution/[ID]][]
  3829. * `GET` [Execution Info](#execution-info)
  3830. * `DELETE` [Delete an Execution](#delete-an-execution)
  3831. [/api/V/execution/[ID]/abort][]
  3832. * `GET` [Aborting Executions](#aborting-executions)
  3833. [/api/V/execution/[ID]/output/state][]
  3834. * `GET` [Execution Output with State](#execution-output-with-state)
  3835. [/api/V/execution/[ID]/output][]
  3836. * `GET` [Tailing Output](#tailing-output)
  3837. [/api/V/execution/[ID]/output/step/[STEPCTX]][]
  3838. [/api/V/execution/[ID]/output/node/[NODE]/step/[STEPCTX]][]
  3839. [/api/V/execution/[ID]/output/node/[NODE]][]
  3840. [/api/V/execution/[ID]/output][]
  3841. * `GET` [Execution Output](#execution-output)
  3842. [/api/V/execution/[ID]/state][]
  3843. * `GET` [Execution State](#execution-state)
  3844. [/api/V/executions/delete][]
  3845. * `POST` [Bulk Delete Executions](#bulk-delete-executions)
  3846. [/api/V/job/[ID]][]
  3847. * `GET` [Getting a Job Definition](#getting-a-job-definition)
  3848. * `DELETE` [Deleting a Job Definition](#deleting-a-job-definition)
  3849. [/api/V/job/[ID]/executions][]
  3850. * `POST` [Running a Job](#running-a-job)
  3851. * `GET` [Getting Executions for a Job](#getting-executions-for-a-job)
  3852. * `DELETE` [Delete all Executions for a Job](#delete-all-executions-for-a-job)
  3853. [/api/V/job/[ID]/execution/enable][]
  3854. * `POST` [Enable Executions for a Job](#enable-executions-for-a-job)
  3855. [/api/V/job/[ID]/execution/disable][]
  3856. * `POST` [Disable Executions for a Job](#disable-executions-for-a-job)
  3857. [/api/V/job/[ID]/run][]
  3858. * `POST` [Running a Job](#running-a-job)
  3859. [/api/V/job/[ID]/schedule/enable][]
  3860. * `POST` [Enable Scheduling for a Job](#enable-scheduling-for-a-job)
  3861. [/api/V/job/[ID]/schedule/disable][]
  3862. * `POST` [Disable Scheduling for a Job](#disable-scheduling-for-a-job)
  3863. [/api/V/job/[ID]/scm/[INTEGRATION]/status][]
  3864. - `GET` [Get SCM status for a Job][/api/V/job/[ID]/scm/[INTEGRATION]/status]
  3865. [/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]][]
  3866. - `POST` [Perform SCM action for a Job.][/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]]
  3867. [/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]/input][]
  3868. - `GET` [Get Job SCM Action Input Fields.][/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]/input]
  3869. [/api/V/jobs/delete][]
  3870. * `DELETE` [Bulk Job Delete](#bulk-job-delete)
  3871. [/api/V/jobs/execution/enable][]
  3872. * `POST` [Bulk Toggle Job Execution](#bulk-toggle-job-execution)
  3873. [/api/V/jobs/execution/disable][]
  3874. * `POST` [Bulk Toggle Job Execution](#bulk-toggle-job-execution)
  3875. [/api/V/jobs/schedule/enable][]
  3876. * `POST` [Bulk Toggle Job Schedules](#bulk-toggle-job-schedules)
  3877. [/api/V/jobs/schedule/disable][]
  3878. * `POST` [Bulk Toggle Job Schedules](#bulk-toggle-job-schedules)
  3879. [/api/V/project/[PROJECT]][]
  3880. * `GET` [Getting Project Info](#getting-project-info)
  3881. * `DELETE` [Project Deletion](#project-deletion)
  3882. [/api/V/project/[PROJECT]/acl/*][]
  3883. * `GET` [List Project ACL Policies](#list-project-acl-policies)
  3884. * `GET` [Get a Project ACL Policy](#get-a-project-acl-policy)
  3885. * `POST` [Create a Project ACL Policy](#create-a-project-acl-policy)
  3886. * `PUT` [Update a Project ACL Policy](#update-a-project-acl-policy)
  3887. * `DELETE` [Delete a Project ACL Policy](#delete-a-project-acl-policy)
  3888. [/api/V/project/[PROJECT]/config][]
  3889. * `GET` [GET Project Configuration](#get-project-configuration)
  3890. * `PUT` [PUT Project Configuration](#put-project-configuration)
  3891. [/api/V/project/[PROJECT]/config/[KEY]][]
  3892. * `GET` [GET Project Configuration Key](#get-project-configuration-key)
  3893. * `PUT` [PUT Project Configuration Key](#put-project-configuration-key)
  3894. * `DELETE` [DELETE Project Configuration Key](#delete-project-configuration-key)
  3895. [/api/V/project/[PROJECT]/executions][]
  3896. * `GET` [Execution Query](#execution-query)
  3897. [/api/V/project/[PROJECT*]/executions/running][]
  3898. * `GET` [Listing Running Executions](#listing-running-executions)
  3899. [/api/V/project/[PROJECT]/export][]
  3900. * `GET` [Project Archive Export](#project-archive-export)
  3901. [/api/V/project/[PROJECT]/[FILE.md]][]
  3902. * `GET` [GET Readme File](#get-readme-file)
  3903. * `PUT` [PUT Readme File](#put-readme-file)
  3904. * `DELETE` [DELETE Readme File](#delete-readme-file)
  3905. [/api/V/project/[PROJECT]/history][]
  3906. * `GET` [Listing History](#listing-history)
  3907. [/api/V/project/[PROJECT]/import][]
  3908. * `PUT` [Project Archive Import](#project-archive-import)
  3909. [/api/V/project/[PROJECT]/jobs][]
  3910. * `GET` [Listing Jobs](#listing-jobs)
  3911. [/api/V/project/[PROJECT]/jobs/export][]
  3912. * `GET` [Exporting Jobs](#exporting-jobs)
  3913. [/api/V/project/[PROJECT]/jobs/import][]
  3914. * `POST` [Importing Jobs](#importing-jobs)
  3915. [/api/V/project/[PROJECT]/resources][]
  3916. * `GET` [Listing Resources](#listing-resources)
  3917. * `POST` [Update Resources for a Project](#update-resources-for-a-project)
  3918. [/api/V/project/[PROJECT]/resource/[NAME]][]
  3919. * `GET` [Getting Resource Info](#getting-resource-info)
  3920. [/api/V/project/[PROJECT]/resources/refresh][]
  3921. * `POST` [Refreshing Resources for a Project](#refreshing-resources-for-a-project)
  3922. [/api/V/project/[PROJECT]/run/command][]
  3923. * `POST` [Running Adhoc Commands](#running-adhoc-commands)
  3924. [/api/V/project/[PROJECT]/run/script][]
  3925. * `POST` [Running Adhoc Scripts](#running-adhoc-scripts)
  3926. [/api/V/project/[PROJECT]/run/url][]
  3927. * `POST` [Running Adhoc Script URLs](#running-adhoc-script-urls)
  3928. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugins][]
  3929. * `GET` [List SCM plugins for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugins]
  3930. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/input][]
  3931. * `GET` [Get SCM plugin setup input fields.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/input]
  3932. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/setup][]
  3933. * `POST` [Setup SCM for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/setup]
  3934. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/enable][]
  3935. * `POST` [Enable SCM for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/enable]
  3936. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/disable][]
  3937. * `POST` [Disable SCM for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/disable]
  3938. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/status][]
  3939. * `GET` [Get SCM status for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/status]
  3940. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/config][]
  3941. * `GET` [Get SCM config for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/config]]
  3942. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]][]
  3943. * `POST` [Perform SCM action for a project.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]]
  3944. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]/input][]
  3945. * `GET` [Get Project SCM Action Input Fields.][/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]/input]
  3946. [/api/V/projects][]
  3947. * `GET` [Listing Projects](#listing-projects)
  3948. * `POST` [Project Creation](#project-creation)
  3949. [/api/V/scheduler/takeover][]
  3950. * `PUT` [Takeover Schedule in Cluster Mode](#takeover-schedule-in-cluster-mode)
  3951. [/api/V/scheduler/jobs][]
  3952. * `GET` [List Scheduled Jobs For this Cluster Server][/api/V/scheduler/jobs]
  3953. [/api/V/scheduler/server/[UUID]/jobs][]
  3954. * `GET` [List Scheduled Jobs For a Cluster Server][/api/V/scheduler/server/[UUID]/jobs]
  3955. [/api/V/storage/keys/[PATH]/[FILE]][]
  3956. * `PUT` [Upload Keys](#upload-keys)
  3957. * `GET` [List keys](#list-keys)
  3958. * `GET` [Get Key Metadata](#get-key-metadata)
  3959. * `GET` [Get Key Contents](#get-key-contents)
  3960. * `DELETE` [Delete Keys](#delete-keys)
  3961. [/api/V/system/acl/*][]
  3962. * `GET` [List System ACL Policies](#list-system-acl-policies)
  3963. * `GET` [Get an ACL Policy](#get-an-acl-policy)
  3964. * `POST` [Create an ACL Policy](#create-an-acl-policy)
  3965. * `PUT` [Update an ACL Policy](#update-an-acl-policy)
  3966. * `DELETE` [Delete an ACL Policy](#delete-an-acl-policy)
  3967. [/api/V/system/executions/enable][]
  3968. * `POST` [Set Active Mode](#set-active-mode)
  3969. [/api/V/system/executions/disable][]
  3970. * `POST` [Set Passive Mode](#set-passive-mode)
  3971. [/api/V/system/info][]
  3972. * `GET` [System Info](#system-info)
  3973. [/api/V/system/logstorage][]
  3974. * `GET` [Log Storage Info][/api/V/system/logstorage]
  3975. [/api/V/system/logstorage/incomplete][]
  3976. * `GET` [List Executions with Incomplete Log Storage][/api/V/system/logstorage/incomplete]
  3977. [/api/V/system/logstorage/incomplete/resume][]
  3978. * `POST` [Resume Incomplete Log Storage][/api/V/system/logstorage/incomplete/resume]
  3979. [/api/V/tokens][]
  3980. [/api/V/tokens/[USER]][]
  3981. * `GET` [List Tokens](#list-tokens)
  3982. * `POST` [Create a Token](#create-a-token)
  3983. [/api/V/token/[ID]][]
  3984. * `GET` [Get a token](#get-a-token)
  3985. * `DELETE` [Delete a token](#delete-a-token)
  3986. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugins]:#list-scm-plugins
  3987. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/input]:#get-scm-plugin-input-fields
  3988. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/setup]:#setup-scm-plugin-for-a-project
  3989. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/enable]:#enable-scm-plugin-for-a-project
  3990. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/plugin/[TYPE]/disable]:#disable-scm-plugin-for-a-project
  3991. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/status]:#get-project-scm-status
  3992. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/config]:#get-project-scm-config
  3993. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]]:#perform-project-scm-action
  3994. [/api/V/project/[PROJECT]/scm/[INTEGRATION]/action/[ACTION_ID]/input]:#get-project-scm-action-input-fields
  3995. [/api/V/job/[ID]/scm/[INTEGRATION]/status]:#get-job-scm-status
  3996. [/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]]:#perform-job-scm-action
  3997. [/api/V/job/[ID]/scm/[INTEGRATION]/action/[ACTION_ID]/input]:#get-job-scm-action-input-fields
  3998. [/api/V/execution/[ID]]: #execution-info
  3999. [/api/V/execution/[ID]/abort]:#aborting-executions
  4000. [/api/V/execution/[ID]/output/state]:#execution-output-with-state
  4001. [/api/V/execution/[ID]/output/step/[STEPCTX]]:#execution-output
  4002. [/api/V/execution/[ID]/output/node/[NODE]/step/[STEPCTX]]:#execution-output
  4003. [/api/V/execution/[ID]/output/node/[NODE]]:#execution-output
  4004. [/api/V/execution/[ID]/output]:#execution-output
  4005. [/api/V/execution/[ID]/state]:#execution-state
  4006. [/api/V/executions/delete]:#bulk-delete-executions
  4007. [/api/V/job/[ID]]:#getting-a-job-definition
  4008. [DELETE /api/V/job/[ID]]:#deleting-a-job-definition
  4009. [/api/V/job/[ID]/executions]:#getting-executions-for-a-job
  4010. [/api/V/job/[ID]/execution/enable]:#enable-executions-for-a-job
  4011. [/api/V/job/[ID]/execution/disable]:#disable-executions-for-a-job
  4012. [POST /api/V/job/[ID]/executions]:#running-a-job
  4013. [DELETE /api/V/job/[ID]/executions]:#delete-all-executions-for-a-job
  4014. [/api/V/job/[ID]/schedule/enable]:#enable-scheduling-for-a-job
  4015. [/api/V/job/[ID]/schedule/disable]:#disable-scheduling-for-a-job
  4016. [/api/V/job/[ID]/run]:#running-a-job
  4017. [/api/V/jobs/delete]:#bulk-job-delete
  4018. [/api/V/jobs/execution/enable]:#bulk-toggle-job-execution
  4019. [/api/V/jobs/execution/disable]:#bulk-toggle-job-execution
  4020. [/api/V/jobs/schedule/enable]:#bulk-toggle-job-schedules
  4021. [/api/V/jobs/schedule/disable]:#bulk-toggle-job-schedules
  4022. [/api/V/project/[PROJECT]]:#getting-project-info
  4023. [DELETE /api/V/project/[PROJECT]]:#project-deletion
  4024. [/api/V/project/[PROJECT]/acl/*]:#project-acls
  4025. [/api/V/project/[PROJECT]/config]:#get-project-configuration
  4026. [PUT /api/V/project/[PROJECT]/config]:#put-project-configuration
  4027. [/api/V/project/[PROJECT]/config/[KEY]]:#get-project-configuration-key
  4028. [PUT /api/V/project/[PROJECT]/config/[KEY]]:#put-project-configuration-key
  4029. [DELETE /api/V/project/[PROJECT]/config/[KEY]]:#delete-project-configuration-key
  4030. [/api/V/project/[PROJECT]/executions]:#execution-query
  4031. [/api/V/project/[PROJECT*]/executions/running]:#listing-running-executions
  4032. [/api/V/project/[PROJECT]/export]:#project-archive-export
  4033. [/api/V/project/[PROJECT]/[FILE.md]]:#get-readme-file
  4034. [PUT /api/V/project/[PROJECT]/[FILE.md]]:#put-readme-file
  4035. [DELETE /api/V/project/[PROJECT]/[FILE.md]]:#delete-readme-file
  4036. [/api/V/project/[PROJECT]/history]:#listing-history
  4037. [/api/V/project/[PROJECT]/import]:#project-archive-import
  4038. [/api/V/project/[PROJECT]/jobs]:#listing-jobs
  4039. [/api/V/project/[PROJECT]/jobs/export]:#exporting-jobs
  4040. [/api/V/project/[PROJECT]/jobs/import]:#importing-jobs
  4041. [/api/V/project/[PROJECT]/resources]:#listing-resources
  4042. [POST /api/V/project/[PROJECT]/resources]:#update-resources-for-a-project
  4043. [/api/V/project/[PROJECT]/resource/[NAME]]:#getting-resource-info
  4044. [/api/V/project/[PROJECT]/resources/refresh]:#refreshing-resources-for-a-project
  4045. [/api/V/projects]:#listing-projects
  4046. [POST /api/V/projects]:#project-creation
  4047. [/api/V/project/[PROJECT]/run/command]:#running-adhoc-commands
  4048. [/api/V/project/[PROJECT]/run/script]:#running-adhoc-scripts
  4049. [/api/V/project/[PROJECT]/run/url]:#running-adhoc-script-urls
  4050. [/api/V/scheduler/takeover]:#takeover-schedule-in-cluster-mode
  4051. [/api/V/scheduler/jobs]:#list-scheduled-jobs-for-this-cluster-server
  4052. [/api/V/scheduler/server/[UUID]/jobs]:#list-scheduled-jobs-for-a-cluster-server
  4053. [/api/V/storage/keys/[PATH]/[FILE]]:#list-keys
  4054. [PUT /api/V/storage/keys/[PATH]/[FILE]]:#upload-keys
  4055. [DELETE /api/V/storage/keys/[PATH]/[FILE]]:#delete-keys
  4056. [/api/V/system/acl/*]:#acls
  4057. [/api/V/system/info]:#system-info
  4058. [/api/V/system/executions/enable]:#set-active-mode
  4059. [/api/V/system/executions/disable]:#set-passive-mode
  4060. [/api/V/system/logstorage]:#log-storage-info
  4061. [/api/V/system/logstorage/incomplete]:#list-executions-with-incomplete-log-storage
  4062. [/api/V/system/logstorage/incomplete/resume]:#resume-incomplete-log-storage
  4063. [POST /api/V/system/logstorage/incomplete/resume]:#resume-incomplete-log-storage
  4064. [/api/V/tokens]:#list-tokens
  4065. [/api/V/tokens/[USER]]:#list-tokens
  4066. [POST /api/V/tokens/[USER]]:#create-a-token
  4067. [/api/V/token/[ID]]:#get-a-token
  4068. [DELETE /api/V/token/[ID]]:#delete-a-token
  4069. [ACLPOLICY]:../man5/aclpolicy.html