End Data Load
/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/dataload/{streamId}
Ends streaming data load.
Request
- application/json
- application/xml
-
applicationName(required): string
Application name.
-
databaseName(required): string
Database name.
-
streamId(required): string
Stream ID.
Response
- application/json
- application/xml
200 Response
OK
Data load ended successfully; includes status.
400 Response
Bad Request
Failed to end data load. The stream ID may be invalid.
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"
}