REST API Job Commands

REST API Job Commands

For each call, you can add the following command:

-w"\n%{http_code}\n"

After the username and password in order to receive more meaningful HTTP errors.

Job Status

Request method - GET

Description

Returns the id and current status of a specified job.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/job-configuration/job-status/<job-configuration-id>'

Example response

For a running job:

{ "id": 49, "jobStatus": "RUNNING" }


For a completed job:

{ "id": 30, "jobStatus": "COMPLETED" }


For a job completed with warnings:

{ "id": 32, "jobStatus": "COMPLETED_WITH_Warnings" }


For a job completed with errors:

{ "id": 36, "jobStatus": "ERROR" }


For a cancelled job:

{ "id": 39, "jobStatus": "CANCELED" }


For a job that hasn't been triggered:

{}

Job Status V2

Available as of Datameer 7.2.5

Request method - GET

Description

Returns the id and current status of a specified job.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/job-execution/<file-id>|<uuid>|<path>/status'

Example response

For a job that has never been run:

{ "status": "success", "job-status": "_NONE" }

 

For a running job:

{ "status": "success", "file-id": 48, "job-execution-id": 3, "job-status": "RUNNING", "start-time": "Sep 28, 2018 6:44:56 PM", "estimate-time":"11s", "job-progress":"0" }

 

For a completed job:

{ "status": "success", "file-id": 48, "job-execution-id": 3, "job-status": "COMPLETED", "start-time": "Sep 28, 2018 6:44:56 PM", "stop-time": "Sep 28, 2018 6:44:58 PM" }

 

For a completed job with errors:

{ "status": "success", "file-id": 46, "job-execution-id": 4, "job-status": "COMPLETED_WITH_WARNINGS", "start-time": "Sep 28, 2018 10:09:47 AM", "stop-time": "Sep 28, 2018 10:09:52 AM" }

 

For a queued job:

{ "status": "success", "file-id": 48, "job-execution-id": 4, "job-status": "QUEUED", "start-time": null }

 

For a canceled job:

{ "status": "success", "file-id": 48, "job-execution-id": 4, "job-status": "CANCELED", "start-time": null, "stop-time": "Sep 28, 2018 6:58:41 PM" }

If the example job had been running and was then canceled, a "start-time" would also be displayed.

 

For a triggered job:

{ "status": "success", "job-execution-id": 3, "job-execution-user": "analyst", "job-execution-trigger": "RESTAPI" }

 

For a job that has been stopped:

There isn't a response if the job was successfully stopped.

 

Error: