Filesystems/{filesystemName}/filesets/{filesetName}/cos/directory: POST

Creates a directory that is related to a corresponding bucket.

Availability

Available on all IBM Storage Scale editions.

Description

The POST Filesystems/{filesystemName}/filesets/{filesetName}/cos/directory request creates a directory that is related to a corresponding bucket. 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/directory
where
filesystems/{filesystemName}/filesets/{filesetName}/cos/directory
Specifies the fileset in which the directory needs to be created.

Request headers


Accept: application/json

Parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of parameters
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

{
  "dir": "Directory name",
  "bucket": "Name of the bucket",
  "endpoint": "URL of the object store",
  "accessKey": "Access key",
  "secretKey": "Secret key"
}
For more information about the fields in the following data structures, see the links at the end of this topic.
"dir": "Directory name"
Name of the directory name or full path inside a file system, where you need to link the fileset. If you skip this parameter, the fileset name is used as the directory name.
"bucket": "Name of the bucket"
Name of the bucket that is related to your fileset. You can skip this parameter if your fileset has the same name as your bucket.
"endpoint": "URL of the object store"
URL to your object store. Use server's hostname or IP or name of the map.
"accessKey": "Access key"
Access key for your bucket. Use together with Secret key.
"secretKey": "Secret key"
Secret key for your bucket. Use together with Access key.

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 creates a directory that is related to a corresponding bucket.

Request data:
curl -k -u admin:admin001 -X POST --header 'content-type:application/json' --header 'accept:application/json' -d '{ \ 
   "dir": "mydir", \ 
   "bucket": "mybucket", \ 
   "endpoint": "http://s3store.com:8080", \ 
   "accessKey": "ACCESS_KEY", \ 
   "secretKey": "SECRET_KEY" \ 
 }' 'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/filesets/mfset1/cos/directory'
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" : 1000000000014,
    "status" : "COMPLETED",
    "submitted" : "2020-09-29 16:42:39,680",
    "completed" : "2020-09-29 16:42:39,957",
    "runtime" : 277,
    "request" : {
      "data" : {
        "accessKey" : "****",
        "bucket" : "mybucket",
        "dir" : "mydir",
        "endpoint" : "http://s3store.com:8080",
        "secretKey" : "****"
      },
      "type" : "POST",
      "url" : "/scalemgmt/v2/filesystems/gpfs0/filesets/mfset1/cos/directory"
    },
    "result" : {
      "progress" : [ ],
      "commands" : [ "mmafmcosaccess 'gpfs0' 'mfset1' 'mydir' set --bucket 'mybucket' --endpoint 'http://s3store.com:8080'  --akey ****  --skey **** " ],
      "stdout" : [ ],
      "stderr" : [ ],
      "exitCode" : 0
    },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully."
  }
}