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 History
Request method - GET
Description
Returns a specified number of job status results for a job.
URI syntax
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/job-configuration/job-history/<job-configuration-id>?start=0&length=10'
Example response
[ { "id": 30, "jobStatus": "COMPLETED" }, { "id": 27, "jobStatus": "COMPLETED" }, { "id": 23, "jobStatus": "COMPLETED" } ]
Job Details
Request method - GET
Description
Returns data about a job including the job counters, failure count, status, start/stop time, and successful record count.
URI syntax
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/job-execution/job-details/<job-execution-id>'
Example response
{ "counters": { "IMPORT_RECORDS": 494400, "IMPORT_BYTES": 23911522, "IMPORT_DROPPED_RECORDS": 0, "IMPORT_PREVIEW_RECORDS": 5000, "IMPORT_OUTPUT_BYTES": 24444883, "IMPORT_DROPPED_SPLITS": 0, "IMPORT_OUTPUT_PARTITIONS": 0 }, "failureCount": 0, "jobStatus": "COMPLETED", "startTime": "2012-07-06 18:19:09.0", "stopTime": "2012-07-06 18:21:07.0", "successCount": 494400 }
List Active Jobs
Request method - GET
Description
Returns a list of all the active jobs in Datameer. This list displays the configuration ID, estimated time until completion, execution ID, current status, percent finished, and start time.
URI syntax
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/jobs/list-running'
Example response
[ { "dapJobConfigurationId": 17, "estimateTime": "11 sec", "jobExecutionId": 37, "jobStatus": "RUNNING", "progress": 0, "startTime": "2011-05-19 22:35:39.0" }, { "dapJobConfigurationId": 20, "jobExecutionId": 38, "jobStatus": "RUNNING", "progress": 0, "startTime": "2011-05-19 22:35:39.0" }, { "dapJobConfigurationId": 19, "jobExecutionId": 39, "jobStatus": "RUNNING", "progress": 0, "startTime": "2011-05-19 22:35:39.0" }, { "dapJobConfigurationId": 18, "jobStatus": "RUNNING", "progress": 0, "startTime": "2011-05-19 22:35:39.0" } ]
Delete Job
Request method - DELETE
Description
Removes a job from Datameer.
URI syntax
curl -u <username>:<password> -X DELETE 'http://<Datameer-serverIP>:<port-number>/rest/data/<data-id>'
Example response
No job or data available:
{ "status": "failure", "reason": "Entity of type 'Data' with id '272' not found." }
Job and data are available, but data has already been deleted or marked for deletion:
{ "status": false }
Job and data have been marked for deletion:
{ "status": true }
If your file name includes " "
(empty spaces), replace those spaces with "+"
.