Run Recreate on a Service

Restores an environment to a clean state by refreshing the deployment. This process deletes the existing application and all user defined artifacts from the environment. After recreating the service, you can create a new application or import an application using Migration or EPM Automate.

This REST API is version 11.1.2.3.600.

REST Resource

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

Request

Supported Media Types: application/json

Parameters:

The following table summarizes the client request.

Table 6-17 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
servicename TempServiceType is an optional parameter to temporarily convert an Planning environment to a different service environment. This parameter takes the following as the Service_type value:
  • ARCS converts the environment to an Oracle Account Reconciliation Cloud environment
  • EDMCS converts the environment to an Oracle Enterprise Data Management Cloud environment
  • EPRCS converts the environment to an Oracle Narrative Reporting environment
  • PCMCS converts the environment to an Oracle Profitability and Cost Management Cloud environment

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

     

Response

Parameters:

Table 6-18 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 6-17 Java Sample – runRecreateOnAService.java

Prerequisites: json.jar

Common Functions: See Common Helper Functions for Java

//
// BEGIN - Recreate services
//
public void recreateService(String serviceName) 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);
	}
	String urlString = String.format("%s/interop/rest/%s/services/%s/recreate", serverUrl, apiVersion, serviceName);
	String response = executeRequest(urlString, "POST", null);
	waitForCompletion(fetchPingUrlFromResponse(response, "Job Status"));
}

//
// END - Recreate services
//

Example 6-18 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/$1/recreate
	funcExecuteRequest "POST" $url

	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 6-19 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;
	try {
		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", null);
	if (response != null) {
		waitForCompletion(response)
	}
}