Create Location Alias
/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/locationaliases
Create a new location alias in the given application and database (cube).
A location alias is a named pointer to the location of another cube. You can define the alias using a saved connection, or embed the details of the secondary cube within the definition. You should create location alias on the cube from which the calculation scripts are run.
Request
- application/json
- application/xml
-
applicationName(required): string
Application name for the database/cube to which the location alias refers.
-
databaseName(required): string
Name of the database to which the location alias refers.
Location alias definition details.
object-
aliasName:
string
Name of the location alias.
-
applicationLevelConnection:
boolean
If the location alias is based on a saved connection, this parameter should be true if the connection is application-level, or false if the connection is globally defined.
-
applicationName:
string
Application name for the database/cube to which the location alias refers.
-
connectionName:
string
If the location alias is based on a saved connection, the name of the connection.
-
databaseName:
string
Name of the database to which the location alias refers.
-
links:
array links
-
serverName:
string
If the location alias is not based on a saved connection, the Essbase Server host name of the database/cube to which the location alias refers.
-
userName:
string
If the location alias is not based on a saved connection, the name of a user who is authorized to log in to serverName. Optional if both cubes are on the same Essbase Server.
Response
- application/json
- application/xml
204 Response
OK
Location alias created successfully.
400 Response
Bad Request
Failed to create location alias.
500 Response
Internal Server Error.
Examples
The following example shows how to define a location alias on the Essbase database (cube).
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 script creates the location alias named EasternDB on Sample Basic.
call properties.bat
curl -X POST https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/locationaliases -H "Accept:application/json" -H "Content-Type:application/json" --data "@./locationaliasdef.json" -u %User%:%Password%Example of Request Body
The input file, locationaliasdef.json, consists of the following JSON information.
{
"aliasName" : "EasternDB",
"applicationLevelConnection" : "false",
"applicationName" : "Eastern",
"databaseName" : "Sales",
"serverName" : "https://myserver.example.com:9001/essbase/agent",
"userName" : ""
}Example of Response Body
A response is returned if there is an error; for example,
{
"errorMessage" : "Location alias EasternDB already exists",
"errorCode" : 1023069
}