Queries all aliases that are bound to a specified customer master key (CMK).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesListAliasesByKeyId

The operation that you want to perform. Set the value to ListAliasesByKeyId.

KeyIdStringYes1234abcd-12ab-34cd-56ef-12345678****

The globally unique ID of the CMK.

PageNumberIntegerNo1

The number of the page to return.

Valid values: an integer that is greater than 0.

Default value: 1.

PageSizeIntegerNo10

The number of entries to return on each page.

Valid values: 0 to 101.

Default value: 10

Response parameters

ParameterTypeExampleDescription
RequestIdString1b57992c-834b-4811-a889-f8bac1ba0353

The ID of the request, which is used to locate and troubleshoot issues.

PageNumberInteger1

The page number of the returned page.

PageSizeInteger10

The number of entries returned per page.

TotalCountInteger1

The total number of returned CMKs.

AliasesArray of Alias

An array that consists of aliases.

Alias
KeyIdString08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4****

The CMK to which an alias is bound.

AliasArnStringacs:kms:cn-hangzhou:123456:alias/ExampleAlias1

The Alibaba Cloud Resource Name (ARN) of the alias.

AliasNameStringalias/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 codeError codeError messageDescription
400InvalidParameterThe specified parameter is not valid.The error message returned because an invalid value is specified for the parameter.
404InvalidAccessKeyId.NotFoundThe 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.