Update Dimensions As a Job
Updates one or more dimensions from a dimension text/csv file.
Update Dimensions As a Job runs asynchronously; it immediately returns the job ID and the job status (Running or Failed).
Required Roles
Service Administrator, Power User
REST Resource
POST
/epm/rest/{api_version}/fileApplications/{application}/jobs/updateDimension
Note:
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.
Request
Supported Media Types: application/json
The following table summarizes the client request.
Table 24-39 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
api_version |
Version of the API you are developing with | Path | Yes | None |
application |
Name of the application to update | Path | Yes | None |
dataFileName |
Dimension Metadata flat file name that has already been uploaded to the Inbox folder; multiple file names can be passed separated by comma or other separator character listed in the stringDelimiter parameter | Payload | Yes | None |
stringDelimiter |
Separator character to use if different from commas | Payload | No | Comma (,) |
acceptableDecreasePercentage |
Specifies the percentage difference in member count that is allowed for the operation. If the new member count from the incoming file is less than the existing member count, this represents the percentage decrease that is allowed. If the percentage is exceeded, then the operation will fail. Use this parameter to safeguard against data loss that can happen during a subsequent cube deploy if one or more dimensions did not get fully updated due to missing data in the input file. |
Payload | No | None |
Example URL and Payload
https://<BASE-URL>/epm/rest/<api_version>/fileApplications/BksML12/jobs/updateDimension{"dataFileName":"input.txt",
"stringDelimiter":",","acceptableDecreasePercentage":"5"}
Response
Supported Media Types: application/json
Table 24-40 Parameters
Name | Description |
---|---|
details |
Task ID, such as BksML12_BksML12_ UpdateDimension_D20160118T051020_bb8_1 |
status |
See Migration Status Codes |
statusMessage |
Message about the status, such as In Progress |
type |
Profitability |
data |
Parameters as key value pairs |
links |
Detailed information about the link |
href |
Links to API call |
action |
The HTTP call type |
rel |
Relationship type |
data |
Parameters as key value pairs passed in the request |
Example of Response Body
The following shows an example of the response body in JSON format.
{
"type":"Profitability",
"status":-1,
"statusMessage":"In Progress",
"details":"BksML30_UpdateDimensions_D20220513T062046_c61",
"links":[
{
"href":"http:// ://<BASE-URL>/epm/rest/v1/applications/jobs/ChecktaskStatusJob/BksML30_UpdateDimensions_D20220513T062046_c61",
"action":"GET",
"rel":"Job Status"
}
]
}
Java Sample – UpdateDimensionJob.java for Profitability and Cost Management
Prerequisites: json.jar
Common Functions: See Profitability and Cost Management Common Helper Functions for Java
public void updateDimensionJob() throws Exception {
JSONObject json = new JSONObject();
json.put("dataFileName", "Accounts.txt,Activity.txt");
String urlString = serverURL + "/epm/rest/" + apiVersion + "/fileApplications/" + applicationName + "/updateDimensionJob";
exe4cuteJob(urlString, "POST", json.toString(();
}
Note:
In the main method, enter the following statement:
restSamplesObj.updateDimensionsJob();
cURL Sample – UpdateDimensionJob.sh for Profitability and Cost Management
Common Functions: See Profitability and Cost Management Common Helper Functions for cURL.
funcUpdateDimensionJob() {
dataFileName="Accounts.txt,Activity.txt"
param="{\"dataFileName\":\"$dataFileName\"}"
url=$SERVER_URL/epm/rest/$API_VERSION/fileApplications/$APP_NAME/updateDimensionJob
funcExecuteRequest "POST" $url "$param" "application/json"
output=`cat response.txt`
status=`echo $output | jq '.status'`
if [$status == -1 ]; then
echo "Started Update Dimensions Job successfully"
funcGetStatus "GET"
else
error=`echo $output | jq '.details'`
echo "Error occurred." $error
fi
funcRemoveTempFiles "respHeader.txt" response.txt"
}
Note:
At the end, call this statement along with other statements:
funcUpdateDimensionsJob
Groovy Sample – UpdateDimensionJob.groovy for Profitability and Cost Management
Prerequisites: json.jar
Common functions: See Appendix C: Common Helper Functions for Groovy.
def updateDimensionsJob() {
JSONObject json = new JSONObject();
json.put("dataFileName", "Accounts.txt,Activity.txt");
String urlString = serverUrl + "/epm/rest/"+ apiVersion + "/fileApplications/"+ appName + "/updateDimensionJob";
def url;
try {
url = new URL(urlString)
} catch (MalformedURLException e) {
println "Malformed URL. Please pass valid URL"
System.exit(0);
}
executeJob(url,"POST",json.toString());
}
Note:
In the main method, add the following statement:
restSamplesObj.updateDimensionJob();