tencent cloud

문서Key Management Service

Deleting Key

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-07-30 16:45:13
AI 번역

Overview

The feature for scheduled key deletion consists of two APIs, which are distributed as follows:
API Name
API Description
Description
ScheduleKeyDeletion
Add a scheduled deletion task.
The KeyId and PendingWindowInDays parameters are required for this API operation.
CancelKeyDeletion
Cancel a scheduled deletion task.
The KeyId parameter is required for this API operation.
Note:
When a key is disabled, you can schedule its deletion time using the ScheduleKeyDeletion API. After the specified time is reached, the key is automatically cleaned up.
The examples in this document use the Tencent Cloud command-line tool TCCLI. Subsequently, you can make calls using any supported programming language.

Examples

Sample Scheduled Deletion Task

We now perform a deletion operation on the specified CMK that has been disabled, with the deletion scheduled to occur after 7 days.

Inputs

tccli kms ScheduleKeyDeletion --region ap-guangzhou --KeyId 5xxxxx-xxxx-xxxx-xxxx-52xxxxx4 --PendingWindowInDays 7

Output

If the setup is successful, the scheduled deletion ID and timestamp are returned in the response.
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09",
"RequestId": "2bd72d85-f9dd-4465-ae51-beebff54f540",
"DeletionDate": 1572512542
}

Sample Cancel Deletion Scheduled Task

We now cancel the scheduled deletion task for the specified CMK. In the example workflow, the CMK refers to the one created above.

Inputs

tccli kms CancelKeyDeletion --region ap-guangzhou --KeyId 5xxxxx-xxxx-xxxx-xxxx-52xxxxx

Output

If the operation is successful, the response contains the CMK ID for which the scheduled deletion was successfully canceled.
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09",
"RequestId": "c85473c6-e18d-4a09-9eac-03958dd4714d"
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백