Creating a Key Alias
Function
Associate a new alias for the specified key.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/kms/aliases
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Key ID |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | 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. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key_id | Yes | String | Key ID |
| alias | Yes | String | Alias. The alias of an account in the same region must be unique. |
Response Parameters
Status code: 201
| Parameter | Type | Description |
|---|---|---|
| domain_id | String | Account ID |
| key_id | String | Key ID |
| alias | String | Alias |
| alias_urn | String | Alias resource locator |
| create_time | String | Creation time |
| update_time | String | Update time |
Example Requests
Associate a new alias kms-1234 with the bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e key.
{
"key_id" : "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
"alias" : "kms-1234"
} Example Responses
Status code: 201
The alias is created.
{
"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 |
|---|---|
| 201 | The alias is created. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.