REST API Export Job

REST API Export Job

 

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.

Read Export Job

Request method - GET

Description

Returns information on a specified export job within Datameer including version number, class name, file information (uuid, path, description, name), run schedule, iterations set to keep, properties information, custom properties, sheet data, and export configuration data.

URI syntax

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

Example response

{ "version": "2.0.0.4", "className":"datameer.dap.common.entity.FileDataSinkImpl", "file": { "path": "/Admin/REST_API_TestExportJob.exp", "description": "Test Export Job" }, "pullType": "MANUALLY", "minKeepCount": 1, "properties": {}, "hadoopProperties": "", "connection": "/Admin/DFS_DataStore", "sheet": { "name": "Sheet1", "workbook": "/Admin/ExplodeRange.wbk" }, "mappings": [ { "name": "A", "srcColumnIndex": 0, "nullable": true } ], "errorHandlingMode": "DROP_RECORD", "fullDataPermission": 63, "notificationAddresses": "", "notificationSuccessAddresses": "", "fileName": "/TestExport", "confirmOverwrite": false, "clearTargetDirectory": false, "includeHeader": true, "delimiterString": ",", "quoteString": "\"", "escapeString": "\\", "characterEncoding": "ISO-8859-1" }

Create Export Job 

Request method - POST

Description

Adds an export job in Datameer.

URI syntax

curl -u '<username>:<password>' -X POST -d @<job-payload>.json 'http://<Datameer-serverIP>:<port-number>/rest/export-job'

Example response

{ "configuration-id": 480, "status": "success" }

Additional notes

<job-payload>.json

  • The payload is a JSON representation of all information entered during the creation process using the web interface.

  • An easy method of creating a payload is to use REST to read an import job, data link, or workbook and change the JSON that is returned.

Update Export Job

Request method - PUT

Description

Edits an existing export job in Datameer.

URI syntax

curl -u '<username>:<password>' -X PUT -d @<job-payload>.json 'http://<Datameer-serverIP>:<port-number>/rest/export-job/<export-job-configuration-id>'

Example response

{"status": "success"}

Additional sotes

<job-payload>.json

  • The payload is a JSON representation of all information entered during the creation process using the web interface.

  • An easy method of creating a payload is to use REST to read an import job, data link, or workbook and change the JSON that is returned.

Delete Export Job

Request method - DELETE

Description

Removes an export job from Datameer.

URI syntax

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

Example response

{"status": "success"}

List All Export Jobs

Request method - GET

Description

Returns a list of all the export jobs in Datameer. This list displays the description, ID, name, and the path of the file. 

URI syntax

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

Example response

[ { "description": "", "id": 272, "name": "exp_kp0705_oracle", "path": "/ExportJobs/exp_kp0705_oracle.exp" }, { "description": "", "id": 427, "name": "exp hdfs", "path": "/ExportJobs/tester/exp hdfs.exp" }, { "description": "", "id": 428, "name": "exp hdfs 2", "path": "/ExportJobs/tester/exp hdfs 2.exp" }, { "description": "", "id": 429, "name": "exp mysql", "path": "/ExportJobs/exp mysql.exp" } ]

Start Export Job

Request method - POST

Description

Runs an export job.

URI syntax

curl -u '<username>:<password>' -X POST 'http://<Datameer-serverIP>:<port-number>/rest/job-execution?configuration=<export-job-configuration-id>'

Example response

{ "job-execution-id": 1, "job-execution-trigger": "RESTAPI", "job-execution-user": "admin", "status": "success" }

Cancel Export Job

Request method - POST

Description

Cancels the run order of an export job.