Filesystems/{filesystemName}/directory/{path}: POST

Creates a directory inside a file system.

Availability

Available on all IBM Storage Scale editions.

Description

The POST filesystems/{filesystemName}/directory/{path} request creates directory inside a file system.

Request URL

https://IP address or host name of API server:port/scalemgmt/v2/filesystems/filesystemName/directory/path
where:
filesystemName
Specifies the name of the file system to which the directory belongs. Required.
path
Specifies the path of the directory. 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 where the directory is going to be created. Required.
path The directory path relative to the file system's mount point. 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

{
"user": "User name",
"uid": "User ID",
"group": "Group name",
"gid": "Group ID"
"permission": Permissions
"recursive":  false}
"user": "User name"
The name of the owning user.
"uid": "User ID"
The ID of the owning user.
"group": "Group name"
The name of the owning user group.
"gid": "Group ID"
The ID of the owning user group.
"permission": Access permissions
The number of permissions that are set by using the CLI command chmod. If nothing is specified, then no action is allowed. The default value is 771.
"recursive": true | false
Specifies whether the directory is created recursively within the entire file system or within the specific directory that is defined in the endpoint path. The recursive parameter is always displayed as false for this request.

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":{
               "gid": Group ID,
          "group": "Group name",
          "permissions": Number of permissions,
          "recursive": true | false,
          "uid": User ID,
          "user": "user name"
         
           }
         "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.
"jobs":
An array of elements that describe jobs. Each element describes one job.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"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":" "
"user":"User name"
Name of the owner.
"uid":"User ID"
Unique identifier of the owner.
"group":"Group name"
Name of the user group that owns the file or directory.
"gid":"Group ID"
Unique identifier of the user group that owns the file or directory.
"permissions":"Number of permissions"
The number of permissions that are set by using the CLI command chmod.
"recursive": true | false
Specifies whether the directory is created recursively within the entire file system or only in the specific directory that is defined in the endpoint path. The recursive parameter is always displayed as false for this request.
"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 create a directory inside the file system gpfs0.

Request data:
curl -k -u admin:admin001 -X POST --header 'content-type:application/json' --header 'accept:application/json' 
-d '{ 
   "user": "testuser55", 
   "uid": 1234, 
   "group": "mygroup", 
   "gid": 4711,
   "permissions": 777 
}' 'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/directory/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": 1000000000001,
      "status": "COMPLETED",
      "submitted": "2021-07-08 09:00:53,498",
      "completed": "2021-07-08 10:00:00,440",
      "runtime": 12,
      "request": {
        "data": {
          "gid": 4711,
          "group": "mygroup",
          "permissions": 700,
          "recursive": false,
          "uid": 1234,
          "user": "testuser55"
        },
        "type": "POST",
        "url": "/scalemgmt/v2/filesystems/gpfs0/directory/mydir"
      },
      "result": {},
      "pids": []
    }
  ],
  "status": {
    "code": 202,
    "message": "The request finished successfully."
  }
}