Copying a Key to a Specified Region
Function
Copy the key in the current region to the target region.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/kms/keys/{key_id}/replicate
| 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 |
| key_id | Yes | String | Definition ID of the key to be copied Constraints
Range N/A 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 |
|---|---|---|---|
| key_id | Yes | String | Definition Key ID Constraints
Range N/A Default Value N/A |
| replica_region | Yes | String | Definition Code of the new primary region to which the key belongs, for example, cn-north-4 Constraints N/A Range N/A Default Value N/A |
| key_alias | Yes | String | Definition Alias of the copied new key Constraints N/A Range N/A Default Value N/A |
| key_description | No | String | Definition Description of the copied new key Constraints N/A Range N/A Default Value N/A |
| enterprise_project_id | No | String | Definition Enterprise multi-project ID of the copied new key Constraints
If you do not have the permission to create resources under the default enterprise multi-project (ID: 0), an error will be reported. Range N/A Default Value N/A |
| replica_project_id | Yes | String | Definition Project ID of the copied new key Constraints N/A Range N/A Default Value N/A |
| tags | No | Array of TagItem objects | Definition Tag list, which is the value pairs of tag keys and values. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| key_id | String | Definition Key ID ^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$. Range N/A |
| domain_id | String | User domain ID |
| region | String | Definition Code of the new primary region to which the key belongs, for example, cn-north-4 Range N/A |
Example Requests
{
"key_id" : "826314dd-1b5b-4037-b976-5f9b7a17df46",
"replica_region" : "cn-north-4",
"key_alias" : "replica_key_alias",
"replica_project_id" : "2b31ed520xxxxxxebedb6e57xxxxxxxx"
} Example Responses
Status code: 200
Request succeeded.
{
"key_id" : "8e85c00f-f7d0-47c9-ac96-548f977d16ba",
"domain_id" : "3bab8e245e854f68af5967c00dd43127",
"region" : "cn-north-4"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
Error Codes
See Error Codes.