Copy Application Snapshot (v1)

REST Resource

POST /interop/rest/v1/services/{servicename}/copysnapshot

Table 2-218 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 2-219 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, targetURL.

Form Yes None

Table 2-220 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"
}