All Products
Search
Document Center

Key Management Service:RestoreSecret

更新時間:May 16, 2024

Restores a secret that is scheduled to be deleted.

The operation can be used to restore a secret that is scheduled to be deleted only during the scheduled deletion window. If you set ForceDeleteWithoutRecovery to true when you delete a secret, the secret is immediately deleted and cannot be restored.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

RestoreSecret

The operation that you want to perform. Set the value to RestoreSecret.

SecretName

String

Yes

secret001

The Alibaba Cloud Resource Name (ARN) of the secret or secret resource.

Note

When you access a secret within another Alibaba Cloud account, you must enter the ARN of the secret. The ARN is in the acs:kms:${region}:${account}:secret/${secret-name} format.

Response parameters

Parameter

Type

Example

Description

SecretName

String

secret001

The secret name.

RequestId

String

e4885adf-548f-4ca5-8075-f540bbd3a55f

The ID of the request, which is used to locate and troubleshoot issues.

Examples

Sample requests

http(s)://[Endpoint]/?Action=RestoreSecret
&SecretName=secret001
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RestoreSecretResponse>
    <SecretName>secret001</SecretName>
    <RequestId>e4885adf-548f-4ca5-8075-f540bbd3a55f</RequestId>
</RestoreSecretResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "SecretName" : "secret001",
  "RequestId" : "e4885adf-548f-4ca5-8075-f540bbd3a55f"
}

Error codes

For a list of error codes, see Service error codes.