All Products
Search
Document Center

File Storage NAS:DescribeDirQuotas

最終更新日:Dec 19, 2024

Queries the directory quotas of a file system.

Operation description

Only General-purpose NAS file systems support the directory quota feature.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
nas:DescribeDirQuotaslist
*FileSystem
acs:nas:{#regionId}:{#accountId}:filesystem/{#filesystemId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
FileSystemIdstringYes

The ID of the file system.

1ca404****
PathstringNo

The absolute path of a directory.

If you do not specify this parameter, all directories for which quotas are created are returned.

/data/sub1
PageSizeintegerNo

The number of entries per page. Default value: 10.

Valid values: 1 to 100.

1
PageNumberintegerNo

The page number.

Pages start from page 1. Default value: 1.

1

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of directories.

1
DirQuotaInfosarray<object>

The queried directory quotas.

DirQuotaInfoobject
Statusstring

The status of the quota created for the directory. Valid values: Initializing and Normal. The Initializing state indicates that the quota is being created. The Normal state indicates that the quota is created.

Normal
Pathstring

The absolute path of a directory.

/data/sub1
DirInodestring

The inode number of the directory.

1123
UserQuotaInfosarray<object>

The information about quotas for all users.

UserQuotaInfoobject
FileCountReallong

The total number of files that a user has created in the directory.

5100
UserTypestring

The type of user. Valid values: Uid, Gid, and AllUsers.

  • If Uid or Gid is returned, a value is returned for UserId.
  • If AllUsers is returned, UserId is empty.
Uid
FileCountLimitlong

The maximum number of files that a user can create in the directory.

10000
UserIdstring

The ID of the user that you specify to create a quota for the directory. The value depends on the value of the UserType parameter. Valid values: Uid and Gid.

500
SizeLimitlong

The maximum size of files that a user can create in the directory. Unit: GiB.

1024
QuotaTypestring

The type of the quota. Valid values: Accounting and Enforcement.

Accounting
SizeReallong

The total size of files that a user has created in the directory. Unit: GiB.

800
SizeRealInBytelong

The total size of files that a user has created in the directory. Unit: bytes.

858995833870
RequestIdstring

The request ID.

5BC5CB97-9F28-42FE-84A4-0CD0DF42****
PageSizeinteger

The number of entries per page.

1
PageNumberinteger

The page number.

1

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "DirQuotaInfos": [
    {
      "Status": "Normal",
      "Path": "/data/sub1",
      "DirInode": "1123",
      "UserQuotaInfos": [
        {
          "FileCountReal": 5100,
          "UserType": "Uid",
          "FileCountLimit": 10000,
          "UserId": "500",
          "SizeLimit": 1024,
          "QuotaType": "Accounting",
          "SizeReal": 800,
          "SizeRealInByte": 858995833870
        }
      ]
    }
  ],
  "RequestId": "5BC5CB97-9F28-42FE-84A4-0CD0DF42****",
  "PageSize": 1,
  "PageNumber": 1
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-16The response structure of the API has changedView Change Details