All Products
Search
Document Center

:ListAliases

Last Updated:Apr 08, 2025

Queries all Key Management Service (KMS) key aliases in the current region and account.

Debugging

You can run this interface in OpenAPI Explorer without needing to calculate signatures. After running it, OpenAPI Explorer can automatically generate SDK code samples.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

ListAliases

The operation to perform. Set the value to ListAliases.

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 maximum number of results to return per page. Valid values: 0 to 100.

Default value: 20.

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 number of the page to return.

PageSize

Integer

10

The maximum number of results to return per page.

TotalCount

Integer

1

The total number of returned aliases.

Aliases

Array of Alias

The key alias.

Alias

KeyId

String

key-hzz6****

The customer master key (CMK) ID with the specified alias.

AliasArn

String

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

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

AliasName

String

alias/ExampleAlias1

The alias.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListAliases
&PageNumber=1
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListAliasesResponse>
    <RequestId>1b57992c-834b-4811-a889-f8bac1ba0353</RequestId>
    <PageNumber>1</PageNumber>
    <PageSize>10</PageSize>
    <TotalCount>1</TotalCount>
    <Aliases>
        <KeyId>key-hzz6****</KeyId>
        <AliasArn>acs:kms:cn-hangzhou:123456:alias/ExampleAlias1</AliasArn>
        <AliasName>alias/ExampleAlias1</AliasName>
    </Aliases>
</ListAliasesResponse>

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" : "key-hzz6****",
    "AliasArn" : "acs:kms:cn-hangzhou:123456:alias/ExampleAlias1",
    "AliasName" : "alias/ExampleAlias1"
  } ]
}

Error code

HttpCode

Error code

Error message

Description

400

InvalidParameter

The specified parameter is not valid.

The specified parameter is invalid.

For more error codes, see Service error codes.