Filesystems/{filesystemName}/directoryCopy/{sourcePath}: PUT

Copies a directory on a GPFS file system.

Availability

Available on all IBM Storage Scale editions.

Description

The PUT filesystems/{filesystemName}/directoryCopy/{sourcePath} request copies a directory on a particular file system. For more information about the fields in the data structures that are returned, see the topics mmcrfs command, mmchfs command, and mmlsfs command.

Request URL

https://<IP or host name of API server>:port/scalemgmt/v2/filesystems/{filesystemName}/directoryCopy/{sourcePath}
where:
filesystems/filesystemName
Specifies the name of the file system to which the directory belongs. Required.
directoryCopy
Action to be performed on the directory. Required.
sourcePath
Path of the directory to be copied. 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.
sourcePath Path of the directory to be copied. 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 directory is located.
"targetFileset": "Fileset name"
The name of the fileset where the directory is located. This is optional.
"targetPath": "Directory path"
The name of the file system where the directory 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.
"operation": "operation type"
Specifies operation type like sync copy or verify default is copy.
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 directory that belongs to the file system gpfs0.

Request data:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json' 
-d '{
  "targetFilesystem": "gpfs0", \ 
   "targetFileset": "fset1", \ 
   "targetPath": "mydir", \ 
   "nodeclassName": "cesNodes", \ 
   "force": true \ 
}' 'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/directoryCopy/mydir'
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" : 1000000000009,
    "status" : "COMPLETED",
    "submitted" : "2020-09-29 15:39:55,452",
    "completed" : "2020-09-29 15:39:58,675",
    "runtime" : 3223,
    "request" : {
      "type" : "PUT",
      "url" : "/scalemgmt/v2/filesystems/gpfs0/directoryCopy/mydir"
    },
    "result" : {
      "progress" : [ ],
      "commands" : [ "tscp --source '/mnt/gpfs0/mydir' --target '/mnt/gpfs0/fset1/mydir' --nodeclass 'cesNodes' --force " ],
      "stdout" : [ ],
      "stderr" : [ ],
      "exitCode" : 0
    },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully."
  }
}

See also