Goal
Read the full SQL Sheet description, including the exact SQL query.
When trying to read a Workbook configuration via REST API, there is very limited information about any included SQL Sheet(s).
REST call syntax:
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/workbook/<workbook-configuration-id>'
Example call:
curl -u user:pass -X GET 'http://localhost:8080/rest/workbook/21'
Example response:
{
"name": "SqlSheet",
"sheetId": "a6ddafe4-5757-4f72-8ef4-997f8d80324f",
"sheetType": "das.internal.SqlSheetType",
"keep": true,
"columnStyles": []
}
Learn
The above REST API call and response are from the v1 API, which was deprecated prior to the introduction of SQL Sheets. Because of this, Datameer returns only very basic metadata for any SQL Sheet in response to a v1 API call. To retrieve the full details of a SQL sheet, please use REST API v2 calls.
REST call syntax:
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<file-id>'
Example call:
curl -u qa:qa -X GET 'http://localhost:8080/api/workbooks/47'
Example response:
"_type": "SqlSheet", "identifier": "a6ddafe4-5757-4f72-8ef4-997f8d80324f", "kept": true, "position": 1, "sqlQuery": "SELECT * FROM Source WHERE Source.OrderNumber > 20", "columns": [ { "position": 0, "type": { "_type": "IntegerType" }, "id": "OrderNumber", "name": "OrderNumber" }, { "position": 1, "type": { "_type": "DateType" }, "id": "TimeStamp", "name": "TimeStamp" } ], "name": "SqlSheet" }
For more information, please see our REST API Workbook documentation.
Comments
0 comments
Please sign in to leave a comment.