Validate Calc Script
/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/scripts/scriptops/validate
Validates the specified script. Applicable only for calculation scripts.
Request
- application/json
- application/xml
-
applicationName(required): string
Application name.
-
databaseName(required): string
Database name.
-
file: string
File.
Default Value:calc
Script details.
Response
200 Response
Script validated successfully.
400 Response
Bad Request
Failed to validate the script. The application or database name may be incorrect, or the contents may be incomplete for the specified script name.
415 Response
Not Acceptable
The media type isn't supported or wasn't specified.
500 Response
Internal Server Error.
Examples
The following example shows how to use the Essbase REST API to validate the syntax of your calc script content before you create the calc script.
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
.
Script with cURL Command
The following REST call checks if the calc script syntax SET UPDATECALC; CALC ALL;
is valid for the Sample Basic cube.
call properties.bat
curl -X POST https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/scriptops/validate -H "accept: application/json" -H "Content-Type:application/json" -d '{"content": "SET UPDATECALC; CALC ALL;"}' -u %User%:%Password%
Example of Response Body
A response is only returned if there are syntax errors in the calc script content.
{
"errorMessage" : "Invalid Calc Script syntax [SET UPDATECALC;]",
"errorCode" : 1012001
}
The SET UPDATECALC command requires an ON or OFF parameter, so the validation returned an error (did not pass).