Run Recreate on a Service (11.1.2.3.600)

The Run Recreate on a Service (v11.1.2.3.600) REST API restores an environment to a clean state by recreating the deployment.

This topic describes the original version of this REST API. You can also use the simplified v2 version of the REST API. The v2 version contains all parameters in the payload and does not require URL encoding while calling the REST APIs. This makes the v2 API easier to use. The v2 version is backwards compatible.

You re-create the deployment to complete these tasks:

  • Clean up an environment before importing a full snapshot.
  • Change the business process that can be deployed in an environment.
  • Change the Essbase version in use in Oracle Enterprise Performance Management Cloud environments other than Narrative Reporting, Oracle Enterprise Data Management Cloud, and Account Reconciliation, which do not use Essbase.

    By default, EPM Standard Cloud Service and EPM Enterprise Cloud Service environments are deployed with Hybrid-enabled Essbase, while legacy environments are deployed with Non-Hybrid Essbase. Downgrading the deployment of Hybrid-enabled Essbase in EPM Standard Cloud Service and EPM Enterprise Cloud Service environments is required, if you are importing a snapshot from an environment that has a Non-Hybrid Essbase version. Upgrading the deployment of Non-Hybrid Essbase in legacy environments is required to:

    • Support the extended dimensionality in existing legacy Financial Consolidation and Close environments
    • Enable hybrid block storage (BSO) applications in legacy Enterprise Planning and Planning Modules environments

    For detailed information about Hybrid Essbase and the considerations for upgrading to Hybrid Essbase, see About Essbase in EPM Cloud in Getting Started with Oracle Enterprise Performance Management Cloud for Administrators.

Caution:

  • This API deletes the existing application and, optionally, all user defined artifacts from the environment. Additionally, it re-creates the database and removes all existing data. After recreating the service, you can create a new business process or import one using REST APIs, Migration, or EPM Automate.
  • This API deletes migration history. As a result, the Migration Status Report available in Migration will not contain historic information.
  • Before using this API, perform a complete backup of the environment. You can create a backup snapshot by executing runDailyMaintenance.

This API is version 11.1.2.3.600.

Required Roles

Service Administrator

REST Resource

POST /interop/rest/{api_version}/services/{servicename}/recreate

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/x-www-form-urlencoded

Table 9-43 Parameters

Name Description Type Required Default
api_version Specific API version Path Yes None
servicename Name of the service for which recreate needs to be run, such as PBCS Path Yes None
tempServiceType

Optionally, convert an environment to a different service environment. The business processes that you can deploy in an environment is governed by the type of subscription that you have. For example, if you have an EPM Standard Cloud Service subscription, you cannot create a FreeForm application after converting the environment from Account Reconciliation to Planning. If you have an EPM Enterprise Cloud Service subscription, you can create any business process in your environment after changing the service type appropriately. See "About the New EPM Cloud Services" in Getting Started with Oracle Enterprise Performance Management Cloud for Administrators.

The behavior of this parameter is dependent on your subscription. For details and examples, see Recreate in Working with EPM Automate for Oracle Enterprise Performance Management Cloud.

Acceptable tempServiceType values:

  • ARCS to convert an environment to an Account Reconciliation environment
  • EDMCS to convert an environment to an Oracle Enterprise Data Management Cloud environment
  • EPRCS to convert an environment to a Narrative Reporting environment
  • PCMCS to convert an environment to a Profitability and Cost Management Cloud environment
  • PBCS to convert a Profitability and Cost Management environment to a Planning, Enterprise Planning, or Enterprise Profitability and Cost Management environment

Note: You can create a Tax Reporting or Financial Consolidation and Close application in a new Planning environment. You do not need to change the service type of the environment.

When you run this REST API with tempserviceType, the serviceType change can be verified by making a REST call to /interop/rest.

Payload No None
removeAll If set to true, deletes all the snapshots and the content of the Inbox and Outbox folders Payload No None
essbaseChange

Optionally, upgrade or downgrade the current Essbase version. The REST API retains the current Essbase version if you do not specify this option. Permissible values are:

  • upgrade to change from Non-Hybrid Essbase to Hybrid Essbase
  • downgrade to change from Hybrid Essbase to Non-Hybrid Essbase

Caution: Before using this option, read and understand the information available in About Essbase in EPM Cloud in Getting Started with Oracle Enterprise Performance Management Cloud for Administrators.

Payload No None

Response

Table 9-44 Parameters

Name Description
details In case of errors, details are published with the error string
status See Migration Status Codes
links Detailed information about the link
href Links to API call or status API
action The HTTP call type
rel

Possible values: self and/or Job Status.

If the value is set to Job Status, you can use the href to get the status of the recreate service

data Parameters as key value pairs passed in the request

Example of Response Body

The following is an example of the response body in JSON format.

{
	"details":null,
	"status":0,
	"links":[{
		"href":"https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com/interop/rest/11.1.2.3.600/services/PBCS/recreate",
		"rel":"self",
		"data":null,
		"action":"POST"
		},{
		"href":"https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com/interop/rest/11.1.2.3.600/services/PBCS/recreate/777",
		"rel":"Job Status",
		"data":null,
		"action":"GET"
	}]
}

Run Recreate on a Service Sample Code

Example 9-24 Java Sample – runRecreateOnAService.java

Prerequisites: json.jar

Common Functions: See Common Helper Functions for Java

//
// BEGIN - Recreate services
//
public void recreateService(String serviceName, String serviceType, String removeAll, String essbaseChange) throws Exception {
	Scanner in = new Scanner(System.in);
	System.out.println("Are you sure you want to recreate the EPM environment (yes/no): no ?[Press Enter]");
	String s = in.nextLine();
	if (!s.equals("yes")) {
		System.out.println("User cancelled the recreate command");
		System.exit(0);
	}

	

JSONObject params = new JSONObject();
//params.put("tempServiceType", serviceType);
params.put("removeAll", removeAll);
params.put("essbaseChange", essbaseChange);
	String parameters = "parameters="+ URLEncoder.encode(params.toString(), "UTF-8");
	String urlString = String.format(				"%s/interop/rest/%s/services/%s/recreate", serverUrl, apiVersion, serviceName);
	String response = executeRequest(urlString, "POST", parameters, "application/x-www-form-urlencoded");
	getJobStatus(fetchPingUrlFromResponse(response, "Job Status"),"GET");
}

//
// END - Recreate services
//

Example 9-25 cURL Sample – RunRecreateOnAService.sh

Prerequisites: jq (http://stedolan.github.io/jq/download/linux64/jq)

Common Functions: See Common Helper Functions for cURL

funcRecreateService() {
        echo "Are you sure you want to recreate the EPM environment (yes/no): no ?[Press Enter]"
        read toCreate
        if [ $toCreate != "yes" ]; then
                echo "User cancelled the recreate command"
                exit 0
        fi

        url=$SERVER_URL/interop/rest/$API_VERSION/services/EPM/recreate
        json=$(echo "{\"removeAll\":\"true\",\"essbaseChange\":\"upgrade\"}" | sed -f urlencode.sed)
        param="parameters=$json"
        funcExecuteRequest "POST" $url $param "application/x-www-form-urlencoded"
        output=`cat response.txt`
        status=`echo $output | jq '.status'`
    if [ $status == -1 ]; then
        echo "Started recreating the environment successfully"
                funcGetStatus "GET"
    else
        error=`echo $output | jq '.details'`
        echo "Error occurred. " $error
    fi
        funcRemoveTempFiles "respHeader.txt" "response.txt"
}

Example 9-26 Groovy Sample – RunRecreateOnAService.groovy

Prerequisites: json.jar

Common Functions: See CSS Common Helper Functions for Groovy

def recreateService(serviceName) {
	def toCreate = System.console().readLine 'Are you sure you want to recreate the EPM environment (yes/no): no ?[Press Enter]'
	if (!toCreate.equals("yes")) {
		println "User cancelled the recreate command"
		System.exit(0)
	}
	def url;
	JSONObject params = new JSONObject();
	try {
            //params.put("tempServiceType",serviceType);
	      params.put("removeAll", "true");
	      params.put("essbaseChange", "upgrade");
		url = new URL(serverUrl + "/interop/rest/" + apiVersion + "/services/" + serviceName + "/recreate");
	} catch (MalformedURLException e) {
			println "Malformed URL. Please pass valid URL"
			System.exit(0);
	}
	response = executeRequest(url, "POST", "parameters="+param.toString(), "application/x-www-form-urlencoded");
	if (response != null) {
		getJobStatus(response,"GET");
	}
}
Common Functions