LIST CURRENT JOBS
Use this endpoint to see a list of all currently running and scheduled jobs (e.g. a fetch job). A job may include multiple sub-tasks. To stop individual tasks that make up a job, please use the tasks endpoint.
curl -X GET \
https://YOUR_STACK.datatap.adverity.com/api/jobs/ \
-H 'Authorization: Token TOKEN_VALUE' \
Result
{
"count": XX,
"next": null,
"previous": null,
"results": [
{
"id": JOB_ID,
"url": "https://YOUR_STACK.datatap.adverity.com/api/jobs/JOB_ID/",
"job_start": "YYYY-MM-DDTHH:MM:SSZ",
"job_end": "YYYY-MM-DDTHH:MM:SSZ",
"range_start": "YYYY-MM-DDTHH:MM:SSZ",
"range_end": "YYYY-MM-DDTHH:MM:SSZ",
"scheduled": "YYYY-MM-DDTHH:MM:SSZ",
"progress": 0.006672468813460981,
"duration": "0s",
"state": 1,
"state_label": "Running",
"state_color": "orange",
"datastream": {
"id": DATASTREAM_ID ,
"stack_id": STACK_ID,
"stack": { "add_connection_url":"/core/authorization/add/",
"add_datastream_url": "/core/apidatastream/add/",
"change_url": "/core/stack/STACK_ID/change/",
"datalake": "https://YOUR_STACK.datatap.adverity.com/api/storage/1/",
"destination": DESTINATION_ID, "extracts_url": "/core/datastreamextract/?stack_id=STACK_ID",
"issues_url": "/core/datastreamextractionlog/?ack__exact=0&stack_id=STACK_ID",
"id": STACK_ID, "name": "STACK_NAME",
"overview_url": "/STACK_SLUG/",
"parent": "https://YOUR_STACK.datatap.adverity.com/api/stacks/default/",
"parent_id": 1,
"slug": "STACK_SLUG,
"url": "https://YOUR_STACK.datatap.adverity.com/api/stacks/sub-org_1/",
"counts": { "connections": XX, "datastreams": XY },
"permissions": { "isDatastreamManager": true },
"default_manage_extract_names": TRUE/FALSE },
"name": "DATASTREAM_NAME",
"slug": "DATASTREAM_SLUG",
"app_label": "APP_LABEL",
"absolute_url": "https://YOUR_STACK.datatap.adverity.com/APP_LABEL/DATASTREAM_ID/DATASTREAM_SLUG",
"change_url": "/APP_LABEL/SHORT_NAME/DATASTREAM_ID/change/",
"extracts_url": "/datastream/DATASTREAM_ID/extracts/all",
"fetch_url": " https://YOUR_STACK.datatap.adverity.com/APP_LABEL/DATASTREAM_ID/DATASTREAM_SLUG/?action=fetch",
"overview_url": "/STACK_SLUG/DATASTREAM_SLUG/",
"enabled": FALSE/TRUE,
"next_run": "DISABLED/YYYY-MM-DDTHH-MM-SSZ",
"url": "https://YOUR_STACK.datatap.adverity.com/api/datastreams/DATASTREAM_ID/",
"datastream_type_id": DATASTREAM_TYPE_ID,
"logo_url": "/static/images/api/APP_LABEL.svg",
"extracts_stream_url": "/api/datastreams/DATASTREAM_ID/extracts/streaming/download/",
"supports_extended_intervals": TRUE/FALSE,
"updated": "YYYY-MM-DDTHH:MM:SSZ",
"creator": " CREATOR_USERNAME"
}
]
}
OBTAINING THE STATUS OF AN IN-PROGRESS JOB IMPORT
To find out the import status of a job, use the relevant JOB_ID and perform the following call:
curl -X GET \
https://YOUR_STACK.datatap.adverity.com/api/jobs/JOB_ID/imported/ \
-H 'Authorization: Token TOKEN_VALUE' \
Result
{
"status": "ok/failed",
"imported": false/true
}
Status: This will indicate whether the job is running or has failed.
Imported: This will indicate whether the job has been imported to the assigned destination.
LIST ALL JOBS THAT WERE ACTIVE WITHIN A GIVEN DATE RANGE
To obtain a list of all jobs that started and/or ended within a specific time range, just append the desired date range to the end of the request URL, using "start=YYYY-MM-DD
" to designate the earliest date, and "end=YYYY-MM-DD
" the latest:
curl -X GET \
https://YOUR_STACK.datatap.adverity.com/api/jobs/?start=YYYY-MM-DD&end=YYYY-MM-DD \
-H 'Authorization: Token TOKEN_VALUE' \
Result (cropped to one job)
{
"count": XYZ,
"next": "https://STACK.datatap.adverity.com/api/jobs/?end=YYYY-MM-DD&start=YYYY-MM-DD",
"previous": null,
"results": [
{
"id": JOB_ID,
"url": "https://STACK.datatap.adverity.com/api/jobs/JOB_ID/",
"job_start": "YYYY-MM-DDTHH:MM:SSZ",
"job_end": "YYYY-MM-DDTHH:MM:SSZ",
"range_start": "YYYY-MM-DDTHH:MM:SSZ",
"range_end": "YYYY-MM-DDTHH:MM:SSZ",
"scheduled": "YYYY-MM-DDTHH:MM:SSZ",
"progress": 0.8571428571428571,
"state": 2,
"state_label": "Success",
"state_color": "green",
"datastream": {
"id": DATASTREAM_ID,
"stack": {
"id": STACK_ID,
"name": "NAME",
"slug": "NAME",
"url": "https://STACK.datatap.adverity.com/api/stacks/NAME/",
"change_url": "/core/stack/STACK_ID/change/",
"extracts_url": "/core/datastreamextract/?STACK_ID",
"issues_url": "/core/datastreamextractionlog/?ack__exact=0 STACK_ID",
"overview_url": "/NAME/",
"permissions": {
"isDatastreamManager": true
}
}
}
Comments
0 comments
Article is closed for comments.