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

    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

instance_num

Yes

Integer

Number of non-default CMKs

Examples

  • Example request

    None

  • Example response

    {
        "instance_num": 15
    }
    

    or

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

Status Codes

Table 3 lists the normal status code returned by the response.

Table 3 Status codes

Status Code

Status

Description

200

OK

Request processed successfully.

Exception status code. For details, see Status Codes.