tencent cloud

APIs

DokumentasiAPIsCloud Block StorageSnapshot APIsModifyAutoSnapshotPolicyAttribute

ModifyAutoSnapshotPolicyAttribute

Download
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-05-12 19:37:22

1. API Description

Domain name for API request: cbs.intl.tencentcloudapi.com.

This API (ModifyAutoSnapshotPolicyAttribute) is used to modify the attributes of an automatic snapshot policy.

  • You can use this API to modify the attributes of a scheduled snapshot policy, including the execution policy, name, and activation.
  • When modifying the number of days for retention, you must ensure that there is no clash with the permanent retention attribute. Otherwise, the entire operation will fail and a specific error code will be returned.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyAutoSnapshotPolicyAttribute.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
AutoSnapshotPolicyId Yes String Specifies the scheduled snapshot policy ID. query via the describeautosnapshotpolicies API (https://www.tencentcloud.com/document/product/362/33556?from_cn_redirect=1).
IsActivated No Boolean Whether the periodic snapshot policy is activated. false means inactive, true means active. defaults to true.
IsPermanent No Boolean Indicates whether snapshots created by the regular snapshot policy are retained permanently. false means the snapshots are not retained permanently, true means permanent retention. defaults to false.
AutoSnapshotPolicyName No String The name of the scheduled snapshot policy to be created. If it is left empty, the default is 'Not named'. The maximum length cannot exceed 60 bytes.
Policy.N No Array of Policy The policy for executing the scheduled snapshot.
RetentionDays No Integer Number of days to retain the snapshots created according to this scheduled snapshot policy. If this parameter is specified, IsPermanent cannot be specified as TRUE; otherwise, they will conflict with each other.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Enabling an Automatic Snapshot Policy

This example shows you how to enable an automatic snapshot policy

Input Example

POST / HTTP/1.1
Host: cbs.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyAutoSnapshotPolicyAttribute
<Common request parameters>

{
    "AutoSnapshotPolicyId": "asp-01928374",
    "IsActivated": true
}

Output Example

{
    "Response": {
        "RequestId": "88a4815c-4a09-4948-b0c9-fa6fdefe8e4a"
    }
}

Example2 Changing Scheduled Snapshot Policy Attributes

This example shows you how to modify the scheduled snapshot policy named data_disk_auto_snapshot and set IsPermanent to true, so that snapshots created by the regular snapshot policy are retained permanently.

Input Example

POST / HTTP/1.1
Host: cbs.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyAutoSnapshotPolicyAttribute
<Common request parameters>

{
    "AutoSnapshotPolicyId": "asp-nqu08k2l",
    "AutoSnapshotPolicyName": "data_disk_auto_snapshot",
    "IsPermanent": true
}

Output Example

{
    "Response": {
        "RequestId": "384c1fa8-6973-9623-b6bf-5a1fa9a7ad88"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidAccount.InsufficientBalance Insufficient account balance
InvalidAutoSnapshotPolicyId.NotFound AutoSnapshotPolicyId entered does not exist.
InvalidParameter Incorrect parameter.
MissingParameter Missing parameter.
UnsupportedOperation.StateError The resource does not support this operation in this status.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan