cURL Sample – EssbaseDataLoad.sh for Oracle Profitability and Cost Management Cloud

Common functions: See Oracle Profitability and Cost Management Cloud Common Helper Functions for cURL.

funcLoadData() {
	dataLoadValue="ADD_EXISTING_VALUES"
	dataFileName="BksML12C.txt"
	param="{\"clearAllDataFlag\":\"false\",\"dataLoadValue\":\"$dataLoadValue\",\"dataFileName\":\"$dataFileName\"}"
	url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/jobs/essbaseDataLoadJob
	funcExecuteRequest "POST" $url "$param" "application/json"

	output=`cat response.txt`
	status=`echo $output | jq '.status'`
    if [ $status == -1 ]; then
        echo "Started Loading Data successfully"
		funcGetStatus "GET"
    else
        error=`echo $output | jq '.details'`
        echo "Error occurred. " $error
    fi
	funcRemoveTempFiles "respHeader.txt" "response.txt"
}