Copy a File Between Instances (v2)
Use this REST API (v2) to copy a file from one environment (source) to another environment (target).
This API is executed on the target environment after details are provided for the source environment from which the file is to be copied. This feature gives you flexibility in copying files from one cloud environment to another.
Prerequisites: The password of the source EPM Cloud environment must have already been encrypted using EPM Automate. The encrypted password must then be passed as one of the parameters for the Copy File REST API. See the encrypt
command in Command Reference in Working with EPM Automate for Oracle Enterprise Performance Management Cloud.
This REST API is version v2.
Required Roles
Service Administrator
Power User assigned to the Migration Administrator Profitability and Cost Management application role
REST Resource
POST /interop/rest/v2/files/copyfrominstance
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 POST request parameters.
Table 9-100 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
sourceFileName |
Name of the file to copy | Payload | Yes | None |
userName |
User with the Service Administrator predefined role in the source instance | Payload | Yes | None |
pwd |
The location and name of the file containing the encrypted
password for the user.
For information on encrypting and
generating the |
Payload | Yes | None |
sourceURL |
The URL of the source instance | Payload | Yes | None |
targetFileName |
Name of the file to be copied to the target environment | Payload | Yes | None |
Example URL and Payload
https://<BASE URL>/interop/rest/files/copyfrominstance
{
"sourceFileName": "<NAME>",
"userName": "<USERNAME>",
"pwd": "<PASSWORDFILE>",
"sourceURL": "https://<BASE URL>,"
"targetFileName": "<NAME>"
}
Response
Supported Media Types: application/json
Table 9-101 Parameters
Name | Description |
---|---|
details |
In the 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 or Job
Status . If the value is set to Job
Status , you can use the href to get the status
|
data |
null |
Example of Response Body
The following shows an example of the response body in JSON format.
"status": -1,
"items": null,
"links": [{
"rel": "self",
"href": "https://<BASE URL>/interop/rest/v2/files/copyfrominstance",
"data": null,
"action": "POST"
}, {
"rel": "Job Status",
"href": "https://<BASE URL>/interop/rest/v2/status/jobs/1502357937045",
"data": null,
"action": "GET"
}],
"details": null
}
Sample cURL command
curl -X POST -s -u '<USERNAME>:<PASSWORD>' -o response.txt -D respHeader.txt -H 'Content-Type: application/json' -d '{"sourceFileName":"FILE_TO_BE_COPIED", "sourceURL":"SOURCE_URL","userName":"USER_NAME","targetFileName":"TARGET_FILENAME","pwd":"ENCRYPTED_PASSWORD"}' 'https://<BASE URL>/interop/rest/v2/files/copyfrominstance'