Updated on 2026-09-21 GMT+08:00

Querying the Alias Associated with a Key

Function

This API is used to query all aliases associated with a key.

Calling Method

For details, see Calling APIs.

URI

GET /v1.0/{project_id}/kms/aliases

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

The value returned by the IAM API is used, which contains 32 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

key_id

No

String

Definition

Key ID

Constraints

  • The value must be a 36-byte ID.

  • The value must match the regular expression ^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$.

Range

N/A

Default Value

N/A

limit

No

String

Definition

Number of returned records

Constraints

The value of limit must be a number.

Range

1-100

Default Value

N/A

marker

No

String

Definition

Name of the last key on each page is used as a pagination tag. If this parameter is left blank, the first page is queried.

Constraints

Parameters marker and limit must be used together. If the number of records returned on the last page is less than the value of limit, the query ends.

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

Obtain the value by calling the IAM API for obtaining the user token.

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

aliases

Array of AliasEntity objects

Definition

All aliases associated with the key

Range

N/A

page_info

PageInfo object

Definition

Pagination information

Range

N/A

Table 5 AliasEntity

Parameter

Type

Description

domain_id

String

Definition

Tenant domain ID

Range

N/A

key_id

String

Definition

Key ID

Range

N/A

alias

String

Definition

Alias

Range

N/A

alias_urn

String

Definition

Alias resource locator

Range

N/A

create_time

String

Definition

Creation time

Range

N/A

update_time

String

Definition

Update time

Range

N/A

Table 6 PageInfo

Parameter

Type

Description

next_marker

String

Definition

Marker for querying the next page

Range

N/A

current_count

Integer

Definition

Number of records returned on this page

Range

N/A

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "aliases" : [ {
    "domain_id" : "3bab8e245e854f68af5967c00dd43127",
    "key_id" : "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
    "alias" : "kms-1234",
    "alias_urn" : "kms:cn-north-7:3bab8e245e854f68af5967c00dd43127:alias:kms-1234",
    "create_time" : "2024-04-01T00:00:00Z",
    "update_time" : "2024-04-01T00:00:00Z"
  } ],
  "page_info" : {
    "next_marker" : "",
    "current_count" : 1
  }
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.