tencent cloud

Cloud File Storage

CreateAutoSnapshotPolicy

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-03-24 17:02:11

1. API Description

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

This API is used to create a scheduled snapshot policy.

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: CreateAutoSnapshotPolicy.
Version Yes String Common Params. The value used for this API: 2019-07-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Hour Yes String Snapshot repeat time point. value range: 0-23 hr.
PolicyName No String Policy name, limited to 64 characters, only supports input of chinese, letters, numbers, _, or -.
DayOfWeek No String Snapshot repeat date, monday to sunday. 1 represents monday, 7 represents sunday. choose one from three: DayOfMonth, IntervalDays.
AliveDays No Integer Specifies the snapshot retention duration in days. the default value is 0 (permanent).
DayOfMonth No String Snapshot monthly recurrence, select a day from the 1st to the 31st of each month, and a snapshot will be automatically created on that day. for example, 1 represents the 1st. choose one of the three: DayOfWeek, IntervalDays.
IntervalDays No Integer Interval days. choose one of the three with DayOfWeek and DayOfMonth.
ResourceTags.N No Array of TagInfo Snapshot policy tag.

3. Output Parameters

Parameter Name Type Description
AutoSnapshotPolicyId String Snapshot policy ID
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 Creating a Snapshot Policy

Input Example

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

{
    "Hour": "1",
    "PolicyName": "abd",
    "DayOfWeek": "1",
    "AliveDays": 1,
    "ResourceTags": [
        {
            "TagKey": "u90e8u95e8",
            "TagValue": "u4e91u4ea7u54c1u4e00u90e8"
        }
    ]
}

Output Example

{
    "Response": {
        "AutoSnapshotPolicyId": "asp-fglw8r91",
        "RequestId": "0c37adaf-f6bc-4fca-b387-454ea93127e1"
    }
}

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
AuthFailure.UnauthorizedOperation Request unauthorized.
InternalError Internal error.
InvalidParameter Invalid parameter.
InvalidParameter.InvalidAlivedDays The snapshot retention period is invalid.
InvalidParameter.InvalidParamDayofWeek The scheduled day of the week parameter is invalid.
InvalidParameter.InvalidParamHour The value of the scheduled hour parameter is incorrect.
InvalidParameter.InvalidSnapshotPolicyName The file system snapshot policy name is invalid.
InvalidParameter.MissingPolicyParam The policy parameter is missing.
InvalidParameter.SnapshotPolicyNameLimitExceeded The file system snapshot policy name exceeds the limit.
InvalidParameterValue The parameter value is incorrect.
InvalidParameterValue.AutoPolicyNotFound Auto scale-out policy does not exist.
InvalidParameterValue.InvalidAliveDays Invalid AliveDays valueerror.
InvalidParameterValue.InvalidDestinationRegions Snapshot cross-region replication parameter is not supported in this region.
InvalidParameterValue.InvalidParamDayOfMonth Invalid value of DayOfMonth.
InvalidParameterValue.InvalidParamDayOfWeek Invalid parameter, DayOfWeek.
InvalidParameterValue.InvalidParamIntervalDays Invalid value of IntervalDays.
InvalidParameterValue.InvalidSnapPolicyStatus Invalid snapshot policy status.
InvalidParameterValue.InvalidSnapshotName Invalid snapshot name.
InvalidParameterValue.InvalidSnapshotPolicyName Invalid snapshot policy name.
InvalidParameterValue.MissingSnapNameOrAliveDay Missing required parameter Snapshot Name or aliveDays.
InvalidParameterValue.SnapshotNameLimitExceeded Snapshot name exceeds limit. name length not exceeding 64 characters.
InvalidParameterValue.SnapshotPolicyNameLimitExceeded Snapshot policy name exceeds the 64-character limit.
UnsupportedOperation.OutOfService Your account is in arrears. Please top up and try again.
UnsupportedOperation.UnauthorizedCfsQcsRole The CFS role was not authorized.
UnsupportedOperation.UnverifiedUser Unverified user.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan