• Key Management Service

kms
  1. Help Center
  2. Key Management Service
  3. API Reference
  4. APIs
  5. Querying the Number of Instances

Querying the Number of Instances

Function

This API is used to query the number of instances, that is, the number of CMKs created.

NOTE:

Default Master Keys are automatically created by services and are not included in this query.

URI

  • URI format

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

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

Requests

None

Responses

Response parameters

Parameter

Type

Mandatory

Description

instance_num

integer

Yes

Number of non-default CMKs

Examples

Example response
{ 
    "instance_num": 15
}

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.