REST API Administrator Information
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.
Data Volume Limit
Request method - GET
Description
Returns the volume size of a job (in bytes).
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/job-configuration/volume-report/<job-configuration-id>'
Example response
[ { "id": 187, "jobStatus": "COMPLETED", "importedVolume": 56765, "type": "NORMAL" }, { "id": 186, "jobStatus": "COMPLETED", "importedVolume": 4098, "type": "NORMAL" } ]
Global Volume and License Information
Request method - GET
Description
Returns information on your Datameer product. This information includes the product ID, version, license holder, license type, start date of license, expiration of license, volume period, volume limit (in bytes), and total volume consumed (in bytes).
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/license-details'
Example response
{ "ProductId": "4c4038ba-3250-4844-b432-7c8f64d85807", "ProductVersion": "2.1.3", "LicenseHolder": "CN=Stefan Groschupf,O=Datameer,STREET=Unknown,L=Unknown Unknown,ST=Unknown,C=Unknown", "LicenseType": "Enterprise", "LicenseStartDate": "Jan 23, 2013 5:20:10 PM", "LicenseExpirationDate": "Mar 25, 2013 5:20:10 PM", "LicenseVolumePeriodInMonths": 1, "LicenseVolumelimitInBytes": 214748364800, "TotalVolumeConsumedInBytes": 38758720 }
Upload License File
Request method - POST
Description
Uploads a license file to Datameer.
URI syntax
curl -u '<username>:<password>' -X POST --form "file=@<license path>" http://<Datameer-serverIP>:<port-number>/license/upload
Example response
If the license is accepted.
VALID
If the license isn't accepted.
INVALID
Product ID
Request method - GET
Description
Returns the product ID and version.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/license/product-id'
Example response
Returns the product ID and version.
4b4038ba-3550-4844-b432-4c6f64d80807das-test:Datameer-2.1.3-1.0.3
Metrics
Request method - GET
Description
Viewing the metrics in JSON format.
URI syntax
curl -s -S -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/monitor/'
curl -s -S -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/monitor/prependLabel'
Additional notes
An HTML table of the metrics for the current collection interval can be viewed with the following commandĀ
curl -s -S -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/monitor/html'
JAMon
Request method - PUT
Description
Allows clients to enable or disable JAMon at runtime.
URI syntax
curl -s -S -u '<username>:<password>' -X PUT 'http://<Datameer-serverIP>:<port-number>/rest/monitor/enable'
curl -s -S -u '<username>:<password>' -X PUT 'http://<Datameer-serverIP>:<port-number>/rest/monitor/disable'
If your file name includes " "
(empty spaces), replace those spaces with "+"
.
Create Variable
Request method - POST
Description
Create a variable value that can be called within Datameer paths and workbooks.
URI syntax
curl -u <username>:<password> -X POST 'http://<Datameer-serverIP>:<port-number>/api/variables' -d '[{ "name":"<variable name>", "value":"<variable value>"}, {"name":"<variable name>", "value":"<variable value>"}]' -H "Content-Type: application/json"
Example response
[ {"created": 1552379198782, "id": 1, "modified": 1552379198782, "name": "name1", "type": "STRING", "value": "value1"}, {"created": 1552379198783, "id": 2, "modified": 1552379198783, "name": "name2", "type": "STRING", "value": "value2"} ]
Update Variable
Request method - PUT
Description
Update a variable value that can be called within Datameer paths and workbooks.
URI syntax
curl -u <username>:<password> -X PUT 'http://<Datameer-serverIP>:<port-number>/api/variables/<variable-name or variable-id>' -d '{ "name":"<new name>", "value":"<new value>" }' -H "Content-Type: application/json"
Example response
{ "created": 1552379198782, "id": 1, "modified": 1552489010718, "name": "newName", "type": "STRING", "value": "newValue" }
Additional notes
Update multiple variables
URI syntax
curl -uĀ <username>:<password> -X PUTĀ 'http://<Datameer-serverIP>:<port-number>/api/variables' -d '[{ "id":1, "name":"<new name>", "value":"<new value>" }, { "id":2, "name":"<new name>", "value":"<new value>" }]' -H "Content-Type: application/json"
Example response
[ { "created": 1552379198782, "id": 1, "modified": 1552489010718, "name": "newName", "type": "STRING", "value": "newValue" } { "created": 1552379198783, "id": 2, "modified": 1552489010734, "name": "newName2", "type": "STRING", "value": "newValue2" } ]
Note
The variables are identified by id, the idsĀ mustĀ be present in the JSON body of the request.
Delete Variable
Request method - DELETE
Description
Delete a variable value that can be called within Datameer paths and workbooks.
URI syntax
curl -u <username>:<password> -X DELETE 'http://<Datameer-serverIP>:<port-number>/api/variables/<variable-name or variable-id>'
Example response
If the request is successful, there is no output.
Additional notes
Delete multiple variables
URI syntax
curl -uĀ <username>:<password> -X DELETEĀ 'http://<Datameer-serverIP>:<port-number>/api/variables' -d '["<variable-name or variable-id>", "<variable-name or variable-id>"]' -H "Content-Type: application/json"
Example response
If the request is successful, there is no output.
List a Variable
Request method - GET
Description
Display a list of information about variables values that can be called within Datameer paths and workbooks.
URI syntax
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/variables/<variable-name or variable-id>'
Example response
{ "created": 1552379198782, "id": 1, "modified": 1552489010718, "name": "name1", "type": "STRING", "value": "value1" }
Additional notes
List all variables
URI syntax
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/variables'
Example response
[ {"created": 1552379198782, "id": 1, "modified": 1552379198782, "name": "name1", "type": "STRING", "value": "value1"}, {"created": 1552379198783, "id": 2, "modified": 1552379198783, "name": "name2", "type": "STRING", "value": "value2"} ]