Jobs list functions
Use the jobs list functions to view current jobs and information about them. You can apply various filters as explained in the following sections:
The base URL for the API is:
https://<managerHostName>/bda/rest/api
Current BDA jobs
Use the following procedure to list all current BDA jobs.
Syntax
/bda/rest/api/1.0/jobs
Method
GET
Required parameters
None
Optional parameters
- limitMax—This is the number of jobs that the API is supposed to return.
- status—The jobs with a specific status. The available BDA job statuses are:
- VERIFICATION
- SUCCEEDED
- FAILED
- RUNNING
- SCHEDULED
- CANCELED
- EXPIRED
- APPROVALPENDING
- APPROVALREJECTED
- start_date, end_date—The jobs executed between the specified start and end dates. The values must be in the format YYYYMMDD.
Possible response codes
- 200 OK—This code shows that the request was successful.
- 401 Unauthorized—This code shows that the Client is not correctly authorized.
- 500 Internal Server Error—This code shows that an internal error occurred during the generation of the jobs list.
Response
{
"status": "success",
"status_code": "200",
"data": {
"jobs": [
{
"id": "27",
"title": "Exporting Action mysql_stop_instance",
"status": "SUCCEEDED",
"start_time": "1450128088",
"end_time": "1450128090",
"start_time_display": "12-14-15 16:21:28",
"end_time_display": "12-14-15 16:21:30",
},
{
"id": "28",
"title": "Exporting Action mysql_stop_instance",
"status": "SUCCEEDED",
"start_time": "1450129088",
"end_time": "1450129090",
"start_time_display": "12-14-15 16:23:28",
"end_time_display": "12-14-15 16:23:30",
}
]
}
}
"status": "success",
"status_code": "200",
"data": {
"jobs": [
{
"id": "27",
"title": "Exporting Action mysql_stop_instance",
"status": "SUCCEEDED",
"start_time": "1450128088",
"end_time": "1450128090",
"start_time_display": "12-14-15 16:21:28",
"end_time_display": "12-14-15 16:21:30",
},
{
"id": "28",
"title": "Exporting Action mysql_stop_instance",
"status": "SUCCEEDED",
"start_time": "1450129088",
"end_time": "1450129090",
"start_time_display": "12-14-15 16:23:28",
"end_time_display": "12-14-15 16:23:30",
}
]
}
}
Examples
To list all BDA jobs:
curl -k -H "x-auth-token: c4595aa18668ff24b79963eacb8d3000" https://rh6-ma-195.gridapp-dev.com/bda/rest/api/1.0/jobsTo list the 10 most recent BDA jobs:
curl -k -H "x-auth-token: c4595aa18668ff24b79963eacb8d3000" https://rh6-ma-195.gridapp-dev.com/bda/rest/api/1.0/jobs?limit=10To list jobs that completed successfully:
curl -k -H "x-auth-token: c4595aa18668ff24b79963eacb8d3000" https://rh6-ma-195.gridapp-dev.com/bda/rest/api/1.0/jobs?status=SUCCEEDEDTo list the five most recently canceled jobs:
curl -k -H "x-auth-token: c4595aa18668ff24b79963eacb8d3000" https://rh6-ma-195.gridapp-dev.com/bda/rest/api/1.0/jobs?status=CANCELED&limit=5To list all jobs that were canceled in 2015 (from 20150101 to 20151231):
curl -k -H "x-auth-token: c4595aa18668ff24b79963eacb8d3000" https://rh6-ma-195.gridapp-dev.com/bda/rest/api/1.0/jobs?status=CANCELED&start_date=20150101&end_date=20151231
Job information
Use the following procedure to get information about a particular BDA job.
Syntax
/bda/rest/api/1.0/jobs/<id>
Method
GET
Required parameters
None
Optional parameters
None
Response
{
"status": "success",
"status_code": "200",
"data": {
"id": "27",
"title": "Exporting Action mysql_stop_instance",
"status": "SUCCEEDED",
"start_time": "1450128088",
"end_time": "1450128090",
"start_time_display": "12-14-15 16:21:28",
"end_time_display": "12-14-15 16:21:30",
"error_message": {}
}
}
"status": "success",
"status_code": "200",
"data": {
"id": "27",
"title": "Exporting Action mysql_stop_instance",
"status": "SUCCEEDED",
"start_time": "1450128088",
"end_time": "1450128090",
"start_time_display": "12-14-15 16:21:28",
"end_time_display": "12-14-15 16:21:30",
"error_message": {}
}
}
Example
To get information about a job with id=25:
curl -k -H "x-auth-token: c4595aa18668ff24b79963eacb8d3000" https://rh6-ma-195.gridapp-dev.com/bda/rest/api/1.0/jobs/25
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*