Filesystems/{filesystemName}/filesets/{filesetName}/cos/download: POST
Downloads files from object store.
Availability
Available on all IBM Storage Scale editions.
Description
The POST Filesystems/{filesystemName}/filesets/{filesetName}/cos/download request downloads a directory from object store. For more information about the fields in the data structures that are returned, see mmafmcosaccess command.
Request URL
https://<IP address or host name of API server>:<port>/scalemgmt/v2/filesystems/{filesystemName}/filesets/{filesetName}/cos/download
where- filesystems/{filesystemName}/filesets/{filesetName}/cos/download
- Specifies the action to be performed.
Request headers
Accept: application/json
Parameters
The following parameters can be used in the request URL to customize the
request:
Parameter name | Description and applicable keywords | Required/optional |
---|---|---|
filesetName | The fileset name. This is the path of the fileset. | Required. |
filesystemName | The file system name. You can also use keywords such as :all:, :all_local:, or :all_remote: | Required. |
body | Body of the request that contains the required parameters to be passed on to the IBM Storage Scale system to perform the requested operation. | Required. |
Request data
{
"path": "Path",
"objectList": "List of files",
"all": "true | false",
"useMetadata": "true | false",
"useData": "true | false",
"useNoSubdir": "true | false",
"prefix": "Prefix",
"uid": "User ID",
"gid": "Group ID",
"permission": "Access permissions"
}
For more information about the fields in the following data structures, see the links at the end of
this topic.- "path": "Path"
- Path to a dedicated directory in a fileset. You can skip this parameter to use default link path of your fileset.
- "objectList": "List of files"
- List of files to be downloaded from Cloud Object Storage.
- "all": "true | false"
- Whether to download all files from Cloud Object Storage.
- "useMetadata": "true | false"
- Whether to download only metadata.
- "useData": "true | false"
- Whether to download data.
- "useNoSubdir": "true | false"
- Whether to create a subdirectory, if '/' is in object name.
- "prefix": "Prefix"
- Prefix of object names to download.
- "uid": "User ID"
- User ID of the fileset owner.
- "gid": "Group ID"
- Group ID of the fileset owner.
- "permission": "Access permissions"
- Access permission in octal format.
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. A nonzero value 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 download files from object store.
Request data:
curl -k -u admin:admin001 -X POST --header 'content-type:application/json' --header 'accept:application/json' -d '{ \
"path": "/fs1/myfset/mydirectory", \
"objectList": "[file1, file2]", \
"all": true, \
"useMetadata": false, \
"useData": true, \
"useNoSubdir": true, \
"prefix": "hpt", \
"uid": "1050", \
"gid": "1050", \
"permission": "0770" \
}' 'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/filesets/mfset1/cos/download
The request URL with no field or filter parameter returns only the
details that uniquely identify the object.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" : 1000000000015,
"status" : "FAILED",
"submitted" : "2020-09-29 16:52:23,236",
"completed" : "2020-09-29 16:52:25,515",
"runtime" : 2279,
"request" : {
"data" : {
"all" : true
},
"type" : "POST",
"url" : "/scalemgmt/v2/filesystems/gpfs0/filesets/mfset1/cos/download"
},
"result" : {
"progress" : [ ],
"commands" : [ "mmafmcosctl 'gpfs0' 'mfset1' '/mnt/gpfs0/mfset1' download --all " ],
"stdout" : [ ],
"stderr" : [ "EFSSG0053C Failed to execute command: Queued\t Failed\t TotalData\n \t \t (approx in Bytes)\n 20\t 0\t 1153433600\n\nNot all Objects are queued for Download.\n\nmmafmcosctl: Fileset fileset1 is not an AFM fileset.\nAFM: tspcacheu failed, rc 2 code 0\nmmafmcosctl: Command failed. Examine previous error messages to determine cause.\n." ],
"exitCode" : 8
},
"pids" : [ ]
} ],
"status" : {
"code" : 200,
"message" : "The request finished successfully."
}
}