Start Data Load
/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/dataload
Starts streaming data load. This call generates a unique stream ID that is consumed by subsequent calls Push Data and End Data Load.
Request
- application/json
- application/xml
-
applicationName(required): string
Application name.
-
databaseName(required): string
Database name.
Data load options such as rule file name and delimiter.
object
-
delimiter:
string
Currently, only Comma is supported as the delimiter for streaming data load.
-
ruleFileName:
string
Name of the rule file to use for the data load. Omit the file extension.
Response
- application/json
- application/xml
200 Response
OK
Data load started successfully; includes unique stream id which can be passed to subsequent requests. If links=true
parameter is passed, also includes links to push more data and end the data load.
400 Response
Bad Request
The logged in user may not have the appropriate application role.
500 Response
Internal Server Error.
Examples
The following example shows you how to perform a streaming data load to an Essbase cube. The Start Data Load call generates a stream ID that is consumed by the Push Data and End Data Load calls. Therefore, the calls need to be issued in same HTTP session. Because the REST API is stateless, you must store the information using a cookie. In this example, cookies are stored using the --cookie-jar
option.
This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat
.
Start Data Load
The cURL statement starts a streaming data load.
call properties.bat
curl --cookie-jar cookies.txt -X POST https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/dataload -H Accept:application/json -H Content-Type:application/json -d '{"ruleFileName": "Data"}' -u %User%:%Password%
Response
The JSON response includes a unique stream ID.
{
"streamId" : "178641591",
"links" : [ {
"rel" : "pushData",
"href" : "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/dataload/178641591",
"method" : "POST"
} ]
}
Push Data
The cURL statement uses the stream ID from the first call to push comma-separated data from the text file into the Sample Basic cube.
call properties.bat
curl -X POST -b cookies.txt https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/dataload/178641591 -H Content-Type:text/plain --data-binary "@./Data_Basic.txt" -u %User%:%Password%
Response
{
"links" : [ {
"rel" : "pushData",
"href" : "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/dataload/178641591",
"method" : "POST"
}, {
"rel" : "endDataLoad",
"href" : "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/dataload/178641591",
"method" : "DELETE"
} ]
}
End Data Load
The cURL statement uses the stream ID to end the streaming data load process.
call properties.bat
curl -X DELETE -b cookies.txt https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/dataload/178641591 -u %User%:%Password%
Response
{
"status" : "Data load completed successfully"
}