List Jobs
List Jobs
Provides a filtered and ordered list of job information records.
HTTP Request
GET /jobs/job_id/info
Optional Parameters
Name | Type | Description |
---|---|---|
ids | array | A list of job ids, filtering the records to be returned. default: [] |
fields | array | An array specifying which fields to include in the response. Possible values are: id, name, user_tag, priority, status, substatus, progress, start_time, creation_time, end_time, expiration_time, error default: ["id"] |
filters/field | string | one of: "name" or "user_tag" or "status" or "substatus" |
filters/values | array | The job filter match values. |
order | string | The sort order of returned jobs default: "asc" one of: "asc" or "desc" |
skip | integer | Specify number of records to omit in the result list default: 0 |
sort_field | string | The sort field of returned jobs. default: "id" one of: "id" or "name" or "user_tag" or "priority" or "status" or "substatus" or "progress" or "creation_time" or "end_time" or "start_time" or "expiration_time" |
take | integer | Specify number of records to retrieve. default: 100 Range: value <= 1000 |
List Jobs Example
- curl
- JavaScript
- Response
$ curl -u OAPI_KEY:OAPI_SECRET https://api-demo.hybrik.com/v1/jobs/info \
-G \
-d ids[]=12345 \
-d ids[]=12346 \
-d ids[]=12347 \
-d "filters[0][field]=status&filters[0][values][]=active&filters[1][field]=status&filters[1][values][]=completed" \
-d fields[]=id \
-d fields[]=name \
-d fields[]=status \
-d fields[]=start_time \
-d fields[]=end_time \
-d fields[]=progress \
-d sort_field=id \
-d order=asc \
-H "X-Hybrik-Sapiauth: api_auth_token" \
-H "X-Hybrik-Compliance: 20220412"
//Get a list of jobs from #12345 to #12347
hybrik_api.call_api('GET', '/jobs/info', {
ids: [
12345,
12346,
12347
],
fields: [
"id",
"name",
"progress",
"status",
"start_time",
"end_time"
]
})
{
"items": [
{
"id": "12345",
"name": "My first job",
"status": "completed",
"start_time": "2020-06-11T23:30:37.000Z",
"end_time": "2020-06-11T23:30:45.000Z",
"progress": 100
},
{
"id": "12346",
"name": "My second job",
"status": "completed",
"start_time": "2020-06-11T23:30:37.000Z",
"end_time": "2020-06-11T23:30:40.000Z",
"progress": 100
},
{
"id": "12347",
"name": "My third job",
"status": "active",
"start_time": "2020-06-11T23:31:21.000Z",
"end_time": "2020-06-11T23:31:29.000Z",
"progress": 62
}
]
}