Copy a File Between Instances (v1)
Use this REST API to copy a file from one environment (source) to another environment (target).
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.
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.
Required Roles
Service Administrator
Power User assigned to the Migration Administrator Profitability and Cost Management granular role
REST Resource
POST /interop/rest/v1/services/copyfile
Request
Supported Media Types: application/x-www-form-urlencoded
Table 9-98 Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
sourceFileName |
Name of the file to be copied | Form | Yes | None |
userName |
User with access to the source instance | Form | Yes | None |
pwd |
Base64-encoded password | Form | Yes | None |
sourceURL |
The URL of the source instance | Form | Yes | None |
targetFileName |
Name of the file to be copied to the target environment | Form | Yes | None |
Sample Request Payload
{
"sourceFileName": "<FILE-NAME>",
"userName": "<USER_NAME>",
"pwd": "<PASSWORD>",
"sourceURL": "<SOURCE-URL>",
"targetFileName": "<TARGET-FILENAME>"
}
Response
Supported Media Types: application/json
Table 9-99 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 |
Parameters as key value pairs passed in the request |
Example of Response Body
{
"details": null,
"status": -1,
"items": null,
"links": [
{
"href": "https://<BASE-URL>/interop/rest/v1/services/copyfile",
"action": "POST",
"rel": "self",
"data": null
},
{
"href": "https://<BASE-URL>/interop/rest/v1/services/jobs/<JOB_ID>",
"action": "GET",
"rel": "Job' 'Status",
"data": null
}
]
}
Sample cURL Command
curl -s -u <USERNAME>:<PASSWORD> -H 'Content-Type: application/x-www-form-urlencoded' --request POST https://<BASE-URL>/interop/rest/v1/services/copyfile -d 'sourceFileName=<FILE-NAME>&userName=<USERNAME>&pwd=<PASSWORD>&sourceURL=<SOURCE-URL>&targetFileName=<TARGET-FILENAME>'