Queries all CMKs of the current Alibaba Cloud account in the current region.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListKeys |
The operation that you want to perform. Set the value to ListKeys. |
PageNumber | Integer | No | 1 |
The number of the page to return. Pages start from page 1. Default value: 1. |
PageSize | Integer | No | 10 |
The number of entries to return on each page. Valid values: 1 to 100. Default value: 10. |
Filters | String | No | [{"Key":"KeyState", "Values":["Enabled","Disabled"]}] |
The CMK filter. The filter consists of one or more key-values pairs. You can specify a maximum of 10 key-values pairs.
The logical relationship between different keys is AND, and the logical relationship between multiple values in the same key is OR. Example:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Keys | Array of Key |
The CMK. |
|
Key | |||
KeyArn | String | acs:kms:cn-hangzhou:123456:key/80e9409f-78fa-42ab-84bd-83f40c81**** |
The Alibaba Cloud Resource Name (ARN) of the CMK. |
KeyId | String | 08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4**** |
The ID of the CMK. |
PageNumber | Integer | 1 |
The page number of the returned page. |
PageSize | Integer | 10 |
The number of entries returned per page. |
RequestId | String | 1050b8f1-b264-496d-a782-6299cbaf15f8 |
The ID of the request. |
TotalCount | Integer | 3 |
The total number of CMKs. |
Examples
Sample requests
https://kms.cn-hangzhou.aliyuncs.com/?Action=ListKeys
&PageNumber=1
&PageSize=10
&Filters=[{"Key":"KeyState", "Values":["Enabled","Disabled"]}]
&<Common request parameters>
Sample success responses
XML
format
<KMS>
<Keys>
<Key>
<KeyId>80e9409f-78fa-42ab-84bd-83f40c81****</KeyId>
<KeyArn>acs:kms:cn-hangzhou:123456:key/80e9409f-78fa-42ab-84bd-83f40c81****</KeyArn>
</Key>
<Key>
<KeyId>8fbb1226-a06f-4c57-8887-daa5b627****</KeyId>
<KeyArn>acs:kms:cn-hangzhou:123456:key/8fbb1226-a06f-4c57-8887-daa5b627****</KeyArn>
</Key>
</Keys>
<TotalCount>3</TotalCount>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
<RequestId>bc29ec35-3373-48d1-8202-520fd78d****</RequestId>
</KMS>
JSON
format
{
"Keys": {
"Key": [
{
"KeyId": "80e9409f-78fa-42ab-84bd-83f40c81****",
"KeyArn": "acs:kms:cn-hangzhou:123456:key/80e9409f-78fa-42ab-84bd-83f40c81****"
},
{
"KeyId": "8fbb1226-a06f-4c57-8887-daa5b627****",
"KeyArn": "acs:kms:cn-hangzhou:123456:key/8fbb1226-a06f-4c57-8887-daa5b627****"
}
],
"TotalCount": 3,
"PageNumber": 1,
"PageSize": 10,
"RequestId": "bc29ec35-3373-48d1-8202-520fd78d****"
}
Error codes
For a list of error codes, visit the API Error Center.