cURL Sample – DeployCube.sh for Profitability and Cost Management

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

funcDeployCube() {
	comment="Cube deployment Curl"
	param="{\"isKeepData\":\"false\",\"isReplaceCube\":\"true\",\"isRunNow\":\"true\",\"comment\":\"$comment\"}"
	url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/jobs/ledgerDeployCubeJob
	funcExecuteRequest "POST" $url "$param" "application/json"

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