Job Run APIs
This topic describes the REST APIs for the jobs in BMC Helix Automation Console.
The base URL for the Job Run API is: https://<serverName>/api/v1/policies/
GET/api/v1/policies/job/{jobRunId}/summary
Retrieves summary for the specified job run ID.
Request body
Parameter | Description |
jobRunId | Specifies the job run ID. |
Responses
Code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
GET/api/v1/policies/job/{jobRunId}/target
Retrieves summary for the specified job run ID and target.
Request body
Parameter | Description |
filter | |
from | Returns the specified page number of the results. The value starts at 0. By default, all the results are displayed on one page. Default value: 0 |
jobRunId | Specifies the job run ID. |
size | The number of items to be displayed on one page. Default value: 1000 |
sort | Sorts on the specified field and format. Default value: policy_name:asc |
Responses
Code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
GET/api/v1/policies/job/{jobRunId}/target/{targetId}
Retrieves summary for the specified job run ID and target ID.
Request body
Parameter | Description |
from | Default value: 0 |
jobRunId | Specifies the job run ID. |
size | Default value: 2147483647 |
targetId | Specifies the target ID. |
Responses
Code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
GET/api/v1/policies/policy/{policyId}/jobRuns
Retrieves the job runs for the specified policy ID.
Request body
Parameter | Description |
policyId | Specifies the policy ID. |
Responses
Code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
GET/api/v1/policies/{policyId}/runs/{runId}/logs
Retrieves event logs for a specified policy scan run.
Request body
Parameter | Description |
policyId | Specifies the remediation or a policy scan ID. |
RunId | Specifies the remediation job run ID or a policy scan ID. |
page | Retrieves results for a specified page number. The value starts with 0. By default, all results appear on a single page. |
size | Specifies a job type. Available values: analysis, remediation, deploy_job, stage, commit, simulate, download |
event_type | Represents a log level type. Available values: info, error, warning, fine, finer, finest |
server_id | Specifies the server ID. |
server_name | Specifies the server name. |
Responses
Code | Description |
200 | OK |
204 | Content Not Found |
401 | Unauthorized |
403 | Forbidden |
Sample response
"job_logs": [
{
"type": "info",
"date": "2019-06-09 07:56:13.897",
"message": "Execution Override not enabled for job analysis-2000347-TS_Dev Test window policy2019-06-06 23-52-30-799-1200 .",
"server_name": "pos-vm3",
"server_id": 1
}
],
"total_records": 57
}