Updated on 2022-08-23 GMT+08:00

Querying the Quota of a User

Function

This API is used to query the quota of a user, that is, the allocated total number of CMKs that can be created by a user and the number of CMKs that has been created by the user.

The quota does not include Default Master Keys.

URI

  • URI format

    GET /v1.0/{project_id}/kms/user-quotas

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

Requests

None

Responses

Table 2 Response parameters

Parameter

Mandatory

Type

Description

quotas

Yes

Object

Quota list. For details, see Table 3.

Table 3 quotas field description

Parameter

Mandatory

Type

Description

resources

Yes

Array of objects

Resource quota list. For details, see Table 4.

Table 4 resources field description

Parameter

Mandatory

Type

Description

type

Yes

String

Quota type.

Enumerated values:

  • CMK indicates a Customer Master Key.
  • grant_per_CMK indicates the number of grants that can be created on a CMK.

used

Yes

Integer

Used quota

quota

Yes

Integer

Total quota

Examples

  • Example request

    None

  • Example response
    {
        "quotas": {
            "resources": [
                {
                    "type": "CMK",
                    "used": 15,
                    "quota": 20
                },
                {
                    "type": "grant_per_CMK",
                    "used": 15,
                    "quota": 100
                }
    
            ]
        }
    }

    or

    {
        "error": {
            "error_code": "KMS.XXXX",
            "error_msg": "XXX"
        }
    }

Status Codes

Table 5 lists the normal status code returned by the response.
Table 5 Status codes

Status Code

Status

Description

200

OK

Request processed successfully.

Exception status code. For details, see Status Codes.