Copy Application Snapshot (v1)
Use this API to copy a snapshot 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 snapshot is to be copied.
Required Roles
Service Administrator
Any predefined role and the Migrations – Administer granular role
REST Resource
POST /interop/rest/v1/services/{servicename}/copysnapshot
Table 9-59 Tasks for Copy Application Snapshot
| Task | Request | REST Resource |
|---|---|---|
Trigger copysnapshot |
POST | /interop/rest/{api_version}/services/{servicename}/copysnapshot |
Retrieve copysnapshot status
|
GET | /interop/rest/{api_version}/services/{servicename}/copysnapshot/777 |
Request
Supported Media Types: application/x-www-form-urlencoded
Response
Supported Media Types: application/x-www-form-urlencoded
Table 9-60 Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
serviceName |
Name of the service, such as PBCS | Path | Yes | None |
snapshotName |
Name of the snapshot to be copied | Form | Yes | None |
userName |
User with access to the source instance | Form | Yes | None |
fpwd |
The Base64-encoded password for the source user. |
Form | Yes | None |
sourceURL |
The URL of the source instance Note: This API also supports the previous name of this
parameter, |
Form | Yes | None |
Table 9-61 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 of the copy snapshot
|
data |
Parameters as key value pairs passed in the request |
Example of Response Body
{
"status": -1,
"items": null,
"links": [
{
"rel": "self",
"href": "https://<BASE-URL>/interop/rest/v1/services/<SERVICE_TYPE>/copysnapshot",
"data": null,
"action": "POST"
},
{
"rel": "Job Status",
"href": "https://<BASE-URL>/interop/rest/v1/services/<SERVICE_TYPE>/copysnapshot/<JOB_ID>",
"data": null,
"action": "GET"
}
],
"details": null
}cURL Sample
funcCopySnapshot() {
url=$SERVER_URL/interop/rest/v1/services/PBCS/copysnapshot
snapshotName="SNAPSHOT NAME"
srcUserName="USER NAME"
targetURL="https://<BASE-URL>";
srcDomain=""
fpwd="BASE64-ENCODED PASSWORD"
if [ "X" == "X$ srcDomain " ]; then
param="snapshotName=$snapshotName&userName=$srcUserName &fpwd=$fpwd&sourceURL=$targetURL"
else
param="snapshotName=$snapshotName&userName=$srcUserName &fpwd=$fpwd&targetURL=$sourceURL&dom=$srcDomain"
fi
funcExecuteRequest "POST" $url $param "application/x-www-form-urlencoded"
output=`cat response.txt`
status=`echo $output | jq '.status'`
if [ $status == -1 ]; then
echo "Started Copysnapshot"
funcGetStatus "GET"
else
error=`echo $output | jq '.details'`
echo "Error occurred. " $error
fi
funcRemoveTempFiles "respHeader.txt" "response.txt"
}