Filesystems/{filesystemName}/filesets/{filesetName}quotadefaults: POST

Sets or changes default quota limits at file system level.

Availability

Available on all IBM Storage Scale editions.

Description

The POST filesystems/filesystemName/filesets/{filesetName}quotadefaults request sets or changes default quota limits for a fileset. For more information about the fields in the data structures that are returned, see the topics mmsetquota command and mmrepquota command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/filesystems/filesystemName
/filesets/filesetName/quotadefaults
where
filesystems/filesystemName/filesets/filesetName
Specifies that you need to set or change default quota for the particular fileset. Required.
quotadefaults
Specifies that you need to set or change the default quota details. 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. Required.
filesetName The fileset name. This is the path of the fileset. 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


      { 
                " quotaType":"USR | GROUP | FILESET",
                "blockSoftLimit":"Soft limit for capacity",
                "blockHardLimit":"Hard limit for capacity",
                "filesSoftLimit":"Soft limit for inodes",
                "filesHardLimit":"Hard limit for inodes",
}
For more information about the fields in the following data structures, see the links at the end of this topic.
" quotaType":"USR | GROUP | FILESET"
Specify whether the quota is enabled for user, group, or fileset.
"blockSoftLimit":"Soft limit for capacity"
Soft limit set for the capacity usage. Limit can be specified in KiB, MiB, GiB, or TiB. Default is KiB.
"blockHardLimit":"Hard limit for capacity"
Hard limit set for the capacity usage. When hard limit is reached, users cannot perform data writes. Limit can be specified in KiB, MiB, GiB, or TiB. Default is KiB.
"filesSoftLimit":"Soft limit for inodes"
Soft limit set for inode space. Limit can be specified in KiB, MiB, GiB, or TiB. Default is KiB.
"filesHardLimit":"Hard limit for inodes"
Hard limit set for inodes. Limit can be specified in KiB, MiB, GiB, or TiB. Default is KiB.

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, 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 set or change default quota for the file system gpfs0 and fileset fset1.

Now, use the following request to set the quota defaults:
curl -k -u admin:admin001 -X POST --header 'content-type:application/json' --header 'accept:application/json' 
"https://localhost:47443/scalemgmt/v2/filesystems/mari/filesets/fset1/quotadefaults" 
-d '{"quotaType": "GRP", "blockSoftLimit": "10M", "blockHardLimit": "1G", "filesSoftLimit": "100K", "filesHardLimit": "1M"}'
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" : "RUNNING",
    "submitted" : "2019-02-20 14:28:23,747",
    "completed" : "N/A",
    "runtime" : 0,
    "request" : {
      "type" : "POST",
      "url" : "/scalemgmt/v2/filesystems/mari/filesets/fset1/quotadefaults"
    },
    "result" : { },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 202,
    "message" : "The request was accepted for processing."
  }
}{
  "jobs" : [ {
    "jobId" : 1000000000009,
    "status" : "RUNNING",
    "submitted" : "2019-02-20 14:28:23,747",
    "completed" : "N/A",
    "runtime" : 0,
    "request" : {
      "type" : "POST",
      "url" : "/scalemgmt/v2/filesystems/mari/filesets/fset1/quotadefaults"
    },
    "result" : { },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 202,
    "message" : "The request was accepted for processing."
  }
}

Use the GET filesystems/gpfs0/quotadefaults request to see how the quota defaults are set:

Request: curl -k -u admin:admin001 -X GET -H content-type:application/json "https://localhost:443/scalemgmt/v2/filesystems/mari/filesets/fset1/quotadefaults"
{
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully."
  },
  "quotaDefaults" : [ {
    "deviceName" : "mari",
    "filesetId" : 2,
    "filesetName" : "fset1",
    "quotaType" : "USR",
    "blockSoftLimit" : 0,
    "blockHardLimit" : 0,
    "filesSoftLimit" : 0,
    "filesHardLimit" : 0,
    "entryType" : "DEFAULT_ON"
  }, {
    "deviceName" : "mari",
    "filesetId" : 2,
    "filesetName" : "fset1",
    "quotaType" : "GRP",
    "blockSoftLimit" : 12288,
    "blockHardLimit" : 1048576,
    "filesSoftLimit" : 102400,
    "filesHardLimit" : 1048576,
    "entryType" : "DEFAULT_ON"
  } ]
}