Associating Key Alias
Function
This API is used to associate an alias.
You can associate an existing alias to another key.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/kms/alias/associate
| 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 |
Request 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| alias | Yes | String | Definition Alias to be associated Constraints N/A Range N/A Default Value N/A |
| target_key_id | Yes | String | Definition ID of the key to be associated Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| 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 |
Example Requests
Associate kms-1234 to the bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e key.
{
"target_key_id" : "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
"alias" : "kms-1234"
} Example Responses
Status code: 200
Request succeeded.
{
"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"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
Error Codes
See Error Codes.