Create Partition
/applications/{applicationName}/databases/{databaseName}/partitions
Creates a new partition. For partitions across instances, connectionName must be provided.
If the connection is defined at the application level, the property applicationLevelConnection must be specified as true.
If the Datasource is defined at the application level, the property applicationLevelDatasource must be specified as true.
Examples (with minimum required properties)
TRANSPARENT/REPLICATED (change type appropriately)
{'type':'TRANSPARENT','isNew':true,'sourceInfo':{'applicationName':'Sample_2','databaseName':'Basic','userName':'username','password':'password'},'targetInfo':{'userName':'username','password':'password'},'areas':[{'sourceArea':'Jan','targetArea':'Jan','slices':[]}],'mappings':[]}
FEDERATED
{'type':'FEDERATED','isNew':true,'sourceInfo':{'datasourceName':'federatedDatasourceExcel1','measuresDimensionName':'Measures','essbaseToColumnMap':{'arr':[{'essbaseName':'Caffeinated','columnName':''},{'essbaseName':'Ounces','columnName':''},{'essbaseName':'Pkg Type','columnName':''},{'essbaseName':'Population','columnName':''},{'essbaseName':'Intro Date','columnName':''}]}},'areas':[{'sourceArea':'Jan','targetArea':'Jan','slices':[]}]}
Request
-
applicationName(required):
Application name.
-
databaseName(required):
Database name.
-
executeInBackground:
Create the partition in the background (applicable for federated partitions).
Response
204 Response
OK
Partition created successfully.
400 Response
Bad Request
Failed to create partition.
500 Response
Internal Server Error.
Examples
The following example shows how to define partitions on the current target Essbase 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.
A transparent or replicated partition is a region of a cube that is shared with another Essbase cube. In the case of federated partitions, the data and metadata reside in Autonomous Data Warehouse.
You can create a transparent or replicated partition between a target and a source cube to share congruent cube regions between them. When you create a transparent or replicated partition, you define a partition definition in the target cube, which allows the target to pull data from one or more source cubes.
Script with cURL Command to Create a Transparent Partition
In the following REST API example, the target cube, P_Market.Demo, is based on the Essbase gallery sample Demo.Basic. The Market dimension of P_Market.Demo is comprised of transparent partitions to various source cubes (one for each individual market region: Boston, Dallas, Chicago, and 7 other cities).
Before you try it, review the partitioning overview information in Link Cubes Using Partitions and XREF/XWRITE.
call properties.bat
curl -X POST "https://myserver.example.com:9001/essbase/rest/v1/applications/P_Market/databases/Demo/partitions" -H "accept: application/json" -H "Content-Type: application/json" --data-binary "@./input_partitioninfo.json" -u %User%:%Password%Sample JSON Payload
The cURL example above delivers the following JSON payload in input_partitioninfo.json.
{
"type" : "TRANSPARENT",
"isNew": true,
"sourceInfo": {
"serverName": "https://myserver.example.com:9001/essbase/agent",
"applicationName": "P_Boston",
"databaseName": "Demo",
"userName": "username",
"password": "password"
},
"targetInfo": {
"serverName": "https://myserver.example.com:9001/essbase/agent",
"applicationName": "P_Market",
"databaseName": "Demo",
"userName": "username",
"password": "password"
},
"areas": [ {
"sourceArea": "\"Actual\", \"Budget\"",
"targetArea": "\"Actual\", \"Budget\", \"Boston\""
} ],
"mappings": [ {
"targetMember": "\"Boston\""
} ]
}
Script with cURL Command to Create a Federated Partition
The following example shows you how to create a federated partition between Essbase and Autonomous Database. Before you try it, review all of the information in Integrate Essbase with Autonomous Database Using Federated Partitions.
call properties.bat
curl -X POST "https://192.0.2.1:443/essbase/rest/v1/applications/P_Market/databases/Demo/partitions" -H "accept: application/json" -H "Content-Type: application/json" --data-binary "@./input_fedpartitioninfo.json" -u %User%:%Password%Sample JSON Payload
The cURL example above delivers the following JSON payload in input_fedpartitioninfo.json.
{
"type": "FEDERATED",
"isNew": true,
"sourceInfo": {
"measuresDimensionName": "Measures",
"essbaseToColumnMap": {
"arr": []
},
"essbaseToDataSourceMap": {
"dimensions": [{
"dimensionName": "Year",
"generations": [{
"generationNumber": 1,
"columnName": "YEAR"
}]
},
{
"dimensionName": "Product",
"generations": [{
"generationNumber": 1,
"columnName": "PRODUCT"
}]
},
{
"dimensionName": "Market",
"generations": [{
"generationNumber" : 1,
"columnName": "MARKET"
}]
},
{
"dimensionName": "Scenario",
"generations" : [{
"generationNumber": 1,
"columnName": "SCENARIO"
}]
},
{
"dimensionName": "Additions",
"isMeasureMember": true,
"generations": [{
"generationNumber" : 3,
"columnName": "ADDITIONS"
}]
},
{
"dimensionName": "COGS",
"isMeasureMember": true,
"generations": [{
"generationNumber": 4,
"columnName": "COGS"
}]
},
{
"dimensionName": "Ending Inventory",
"isMeasureMember": true,
"generations": [{
"generationNumber": 3,
"columnName": "Ending Inventory"
}]
},
{
"dimensionName": "Margin %",
"isMeasureMember": true,
"generations": [{
"generationNumber" : 3,
"columnName": "Margin %"
}]
},
{
"dimensionName": "Marketing",
"isMeasureMember": true,
"generations": [{
"generationNumber": 4,
"columnName": "MARKETING"
}]
},
{
"dimensionName": "Misc",
"isMeasureMember": true,
"generations": [{
"generationNumber": 4,
"columnName": "MISC"
}]
},
{
"dimensionName": "Opening Inventory",
"isMeasureMember": true,
"generations": [{
"generationNumber" : 3,
"columnName": "Opening Inventory"
}]
},
{
"dimensionName": "Payroll",
"isMeasureMember": true,
"generations": [{
"generationNumber": 4,
"columnName": "PAYROLL"
}]
},
{
"dimensionName": "Profit %",
"isMeasureMember": true,
"generations": [{
"generationNumber": 3,
"columnName": "Profit %"
}]
},
{
"dimensionName": "Sales",
"isMeasureMember": true,
"generations": [{
"generationNumber": 4,
"columnName": "SALES"
}]
}]
},
"applicationLevelConnection": true,
"connectionName": "conn",
"schemaName": "AVSCHEMA",
"factTableName": "SB_DATA"
},
"areas": [{
\"sourceArea\": "\"Additions\", \"COGS\", \"Ending Inventory\", \"Margin %\", \"Marketing\", \"Misc\", \"Opening Inventory\", \"Payroll\", \"Profit %\", \"Sales\"",
\"targetArea\": "\"Additions\", \"COGS\", \"Ending Inventory\", \"Margin %\", \"Marketing\", \"Misc\", \"Opening Inventory\", \"Payroll\", \"Profit %\", \"Sales\""
}]
}