• Key Management Service

kms
  1. Help Center
  2. Key Management Service
  3. API Reference
  4. APIs
  5. Querying the Quota of a User

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.

NOTE:

The quota does not include Default Master Keys.

URI

  • URI format

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

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

Requests

None

Responses

Response parameters

Parameter

Type

Mandatory

Description

quotas

JSONObject

Yes

Quota list

resources

JSONArray

Yes

Resource quota list

type

string

Yes

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

integer

Yes

Used quota

quota

integer

Yes

Total quota

Examples

  • 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 1 lists the normal status code returned by the response.
Table 1 Status codes

Status Code

Status

Description

200

OK

Request processed successfully.

Exception status code. For details, see Status Codes.