Filesystems/{filesystemName}/filesets/{filesetName}/cos/upload: POST
Uploads files to object store.
Availability
Available on all IBM Storage Scale editions.
Description
The POST Filesystems/{filesystemName}/filesets/{filesetName}/cos/upload request uploads files to 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/upload
where- filesystems/{filesystemName}/filesets/{filesetName}/cos/upload
- 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",
}
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 uploaded to Cloud Object Storage.
- "all": "true | false"
- Whether to upload all files to Cloud Object Storage.
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 upload files to 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, \
}' 'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/filesets/mfset1/cos/upload
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" : 1000000000017,
"status" : "FAILED",
"submitted" : "2020-09-29 20:45:50,393",
"completed" : "2020-09-29 20:45:50,899",
"runtime" : 506,
"request" : {
"data" : {
"all" : true,
"path" : "cosdir1"
},
"type" : "POST",
"url" : "/scalemgmt/v2/filesystems/gpfs0/filesets/fileset1/cos/upload"
},
"result" : {
"progress" : [ ],
"commands" : [ "mmafmcosctl 'gpfs0' 'fileset1' 'cosdir1' upload --all " ],
"stdout" : [ ],
"stderr" : [ "EFSSG0053C Failed to execute command:\nmmafmcosctl: Fileset fileset1 is not an AFM fileset.\nmmafmcosctl: cosdir1 is not a valid path for the fileset fileset1\nmmafmcosctl: Command failed. Examine previous error messages to determine cause.\n." ],
"exitCode" : 8
},
"pids" : [ ]
} ],
"status" : {
"code" : 200,
"message" : "The request finished successfully."
}
}