Queries all aliases that are bound to a specified customer master key (CMK).
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListAliasesByKeyId | The operation that you want to perform. Set the value to ListAliasesByKeyId. |
KeyId | String | Yes | 1234abcd-12ab-34cd-56ef-12345678**** | The globally unique ID of the CMK. |
PageNumber | Integer | No | 1 | The number of the page to return. Valid values: an integer that is greater than 0. Default value: 1. |
PageSize | Integer | No | 10 | The number of entries to return on each page. Valid values: 0 to 101. Default value: 10 |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 1b57992c-834b-4811-a889-f8bac1ba0353 | The ID of the request, which is used to locate and troubleshoot issues. |
PageNumber | Integer | 1 | The page number of the returned page. |
PageSize | Integer | 10 | The number of entries returned per page. |
TotalCount | Integer | 1 | The total number of returned CMKs. |
Aliases | Array of Alias | An array that consists of aliases. | |
Alias | |||
KeyId | String | 08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4**** | The CMK to which an alias is bound. |
AliasArn | String | acs:kms:cn-hangzhou:123456:alias/ExampleAlias1 | The Alibaba Cloud Resource Name (ARN) of the alias. |
AliasName | String | alias/ExampleAlias1 | The ID of the alias. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListAliasesByKeyId
&KeyId=1234abcd-12ab-34cd-56ef-12345678****
&PageNumber=1
&PageSize=10
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListAliasesByKeyIdResponse>
<RequestId>1b57992c-834b-4811-a889-f8bac1ba0353</RequestId>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
<TotalCount>1</TotalCount>
<Aliases>
<KeyId>08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4****</KeyId>
<AliasArn>acs:kms:cn-hangzhou:123456:alias/ExampleAlias1</AliasArn>
<AliasName>alias/ExampleAlias1</AliasName>
</Aliases>
</ListAliasesByKeyIdResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "1b57992c-834b-4811-a889-f8bac1ba0353",
"PageNumber" : 1,
"PageSize" : 10,
"TotalCount" : 1,
"Aliases" : [ {
"KeyId" : "08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4****",
"AliasArn" : "acs:kms:cn-hangzhou:123456:alias/ExampleAlias1",
"AliasName" : "alias/ExampleAlias1"
} ]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter | The specified parameter is not valid. | The error message returned because an invalid value is specified for the parameter. |
404 | InvalidAccessKeyId.NotFound | The Access Key ID provided does not exist in our records. | The error message returned because the specified AccessKey ID does not exist. |
For a list of error codes, see Service error codes.