Filesystems/{filesystemName}/filesets/{filesetName}/snapshotCopy/{snapshotName}/path/{sourcePath}: PUT

Copies a directory from a source path relative to a snapshot, to a target path on a fileset.

Availability

Available on all IBM Storage Scale editions.

Description

The PUT filesystems/{filesystemName}/filesets/{filesetName}/snapshotCopy/{snapshotName}/path/{sourcePath} request copies a directory from a source path relative to a snapshot, to a target path on a fileset. For more information about the fields in the data structures that are returned, see the topics mmchfileset command, mmcrfileset command, and mmlsfileset command.

Request URL

https://<IP or host name of API server>:port/scalemgmt/v2/filesystems/{filesystemName}/snapshotCopy/{snapshotName}/path/{sourcePath}
where:
filesystems/filesystemName/filesets/{filesetName}
Specifies the fileset to which the snapshot belongs. Required.
snapshotCopy
Action to be performed on the snapshot. Required.
snapshotName
Name of the snapshot to be copied. Required.
path/sourcePath
Source path relative to a snapshot. Required.

Request headers

Accept: application/json

Request parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of request parameters
Parameter name Description and applicable keywords Required/optional
filesystemName The file system name. You can also use keywords such as :all:, :all_local:, or :all_remote: Required.
filesetName The fileset name. This is the path of the fileset. Optional.
snapshotName Name of the snapshot to be copied. Required.
path/{sourcePath} Source path relative to a snapshot. Required.

Request data

{    
"targetFilesystem": "File system name",
"targetFileset": "Fileset name",
"targetPath": "Directory path",
"nodeclassName": "Name of the node class",
"force": "True | False",
"operation": "sync | verify",
"check": ["attributes to compare"]
}
"targetFilesystem": "File system name"
The name of the file system where the snapshot is located.
"targetFileset": "Fileset name"
The name of the fileset where the snapshot is located. This is optional.
"targetPath": "Directory path"
The name of the file system where the snapshot is located.
"nodeclassName": "Name of the node class"
The name of the node class.
"force": "File system name"
Specifies whether the cp command is used with --force option.
Start of change"operation": "operation type"End of change
Start of changeSpecifies operation type like sync copy or verify default is copy.End of change
Start of change"check": "attributes to compare"End of change
Start of changeSpecifies a list of additional attributes to compare. Currently supported values are {acl and compression} and default is all.End of change

Response data

{
    "status": {
      "code":ReturnCode",
      "message":"ReturnMessage"
   },
   jobs: [
      {
         "result":"", 
           { 
             "commands":"String",
             "progress":"String,
             "exitCode":"Exit code",
             "stderr":"Error",
             "stdout":"String",
           },
         "request":" ",
           {
             "type":"{GET | POST | PUT | DELETE}",
             "url":"URL",
             "data":""",
           }
         "jobId":"ID",
         "submitted":"Time",
         "completed":Time",
         "status":"Job status",
         }   
        ],
   }
For more information about the fields in the following data structures, see the links at the end of this topic.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"jobs":
An array of elements that describe jobs. Each element describes one job.
"result"
"commands":"String'
Array of commands that are run in this job.
"progress":"String'
Progress information for the request.
"exitCode":"Exit code"
Exit code of command. Zero is success and nonzero denotes failure.
"stderr":"Error"
CLI messages from stderr.
"stdout":"String"
CLI messages from stdout.
"request"
"type":"{GET | POST | PUT | DELETE}"
HTTP request type.
"url":"URL"
The URL through which the job is submitted.
"data":" "
Optional.
"jobId":"ID",
The unique ID of the job.
"submitted":"Time"
The time at which the job was submitted.
"completed":Time"
The time at which the job was completed.
"status":"RUNNING | COMPLETED | FAILED"
Status of the job.

Examples

The following example shows how to copy a snapshot that belongs to the file system gpfs0 and fileset fset1. Snapshot name is snap1 and the relative source path is mydir1.

Request data:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json' 
-d '{
  "targetFilesystem": "gpfs0", \
"targetPath":"mydir", \
"nodeclassName": "cesNodes", \
"force": true}' 'https://198.51.100.1:443/scalemgmt/v2/filesystems/fs1/filesets/root/snapshotCopy/snap2/path/dir1'
Response data:
Note: In the JSON data that is returned, the return code indicates whether the command is successful. The response code 200 indicates that the command successfully retrieved the information. Error code 400 represents an invalid request and 500 represents internal server error.
{
  "jobs" : [ {
    "jobId" : 1000000000027,
    "status" : "COMPLETED",
    "submitted" : "2020-09-29 22:05:03,274",
    "completed" : "2020-09-29 22:05:09,542",
    "runtime" : 6268,
    "request" : {
      "type" : "PUT",
      "url" : "/scalemgmt/v2/filesystems/fs1/filesets/root/snapshotCopy/snap2/path/dir1"
    },
    "result" : {
      "progress" : [ ],
      "commands" : [ "tscp --snapshot 'fs1:root:snap2' --source 'dir1' --target '/mnt/gpfs0/mydir' --nodeclass 'cesNodes' --force " ],
      "stdout" : [ ],
      "stderr" : [ ],
      "exitCode" : 0
    },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully."
  }
}

See also