REST API Export Job
- 1 Read Export Job
- 1.1 Description
- 1.2 URI syntax
- 1.3 Example response
- 2 Create Export Job
- 2.1 Description
- 2.2 URI syntax
- 2.3 Example response
- 2.4 Additional notes
- 3 Update Export Job
- 3.1 Description
- 3.2 URI syntax
- 3.3 Example response
- 3.4 Additional sotes
- 4 Delete Export Job
- 4.1 Description
- 4.2 URI syntax
- 4.3 Example response
- 5 List All Export Jobs
- 5.1 Description
- 5.2 URI syntax
- 5.3 Example response
- 6 Start Export Job
- 6.1 Description
- 6.2 URI syntax
- 6.3 Example response
- 7 Cancel Export Job
- 7.1 Description
- 7.2 URI syntax
- 7.3 Example response
- 8 Export Job Dependencies
- 8.1 Description
- 8.2 URI syntax
- 8.3 Example response
- 8.4 Additional notes
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.