Updated on 2025-12-10 GMT+08:00

Rotating a Key

Function

This API is used to rotate the key of an encryption cluster.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/clusters/{cluster_id}/rotate-key

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

cluster_id

Yes

String

Definition

Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

master_key_id

No

String

Definition

KMS key ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

master_key_name

String

Definition

KMS key name.

Range

N/A

cluster_id

String

Definition

Cluster ID.

Range

N/A

rotate_key_time

String

Definition

Rotation time.

Range

N/A

Example Requests

Rotate a KMS key (ID is 0f3196c8-5c23-469f-84da-92ecd2499dce).

POST https://{Endpoint}/v1/05f2cff45100d5112f4bc00b794ea08e/clusters/9f76c502-fc9c-4a52-8656-65d0da6e3d57/rotate-key

{
  "master_key_id" : "0f3196c8-5c23-469f-84da-92ecd2499dce"
}

Example Responses

Status code: 200

The key rotation request is successful.

{
  "master_key_name" : "KMS-1abd-1016",
  "cluster_id" : "9f76c502-fc9c-4a52-8656-65d0da6e3d57",
  "rotate_key_time" : "2025-05-14 08:02:59"
}

Status Codes

Status Code

Description

200

The key rotation request is successful.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

500

Internal server error.

503

Service unavailable.