Creates an automatic snapshot policy. After a policy is created, you can call the ApplyAutoSnapshotPolicy operation to apply the policy to a file system and call the ModifyAutoSnapshotPolicy operation to modify the policy.

Precautions

  • You can use an Alibaba Cloud account to create a maximum of 100 automatic snapshot policies in each region.
  • If an automatic snapshot is to be created when the previous automatic snapshot is still being created, the new snapshot creation is canceled. This may occur if the file system stores a large volume of data. For example, you have scheduled automatic snapshots to be created at 09:00, 10:00, 11:00, and 12:00. An automatic snapshot starts to be created at 09:00. The creation is completed at 10:20. The process requires 80 minutes because the file system has a large volume of data. The task scheduled for 10:00 will be skipped. The automatic snapshot for 11:00 will be taken as scheduled.
  • A file system has a maximum of 128 automatic snapshots. If the number of automatic snapshots exceeds the maximum limit, the earliest automatic snapshots are deleted. This rule does not apply to manual snapshots.
  • If your account has sufficient funds, manual snapshots can be retained for persistent storage. If your account is overdue for longer than 15 days, the manual snapshots will be deleted.
  • Changes to the snapshot retention period of an automatic snapshot policy apply only to automatic snapshots created after the change. The retention period for previous automatic snapshots is not affected.
  • If an automatic snapshot is being created, you cannot create a manual snapshot for a file system until the automatic snapshot is created.
  • You cannot apply automatic snapshot policies to an abnormal file system.
  • A unified naming format of auto_yyyyMMdd_X applies to all automatic snapshots. In the naming format, auto indicates the snapshot is an automatic snapshot rather than a manual snapshot. yyyyMMdd: indicates the date when the snapshot is created. yyyy stands for a four-digit year, MM stands for a two-digit month, and dd stands for a two-digit day of the month. X indicates an ordinal number for the snapshot. For example, auto_20140418_1 indicates the name of the first automatic snapshot that was created on April 18, 2014.

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 CreateAutoSnapshotPolicy

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

FileSystemType String Yes extreme

The type of file system. Valid value: extreme.

RepeatWeekdays String Yes 1,2,3

The days when the automatic snapshot policy recurs within a week. Unit: days. Valid values: 1 to 7. For example, 1 indicates Monday.

If you want to create multiple automatic snapshots a week, you can specify multiple days from Monday to Sunday. You can specify a maximum of seven days. Separate multiple days with commas (,).

TimePoints String Yes 0,1,...,23

The points in time when the automatic snapshot policy recurs. Unit: points in time. Valid values: 0 to 23, indicating 24 points in time that range from 00:00 to 23:00. For example, 1 indicates 01:00.

If you want to create multiple automatic snapshots a day, you can specify multiple points in time. You can specify a maximum of 24 points in time. Separate multiple points in time with commas (,).

RetentionDays Integer No 30

The retention period of an automatic snapshot. Unit: days. Default value: -1. Valid values:

  • -1: specifies that an automatic snapshot is created for persistent storage. If the number of automatic snapshots exceeds the maximum limit, the automatic snapshot is automatically deleted.
  • 1~65536: specifies the number of days to retain an automatic snapshot. If the retention period expires, the automatic snapshot is automatically deleted.
AutoSnapshotPolicyName String No FinanceJoshua

The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter but cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-). Default value: null.

Response parameters

Parameter Type Example Description 
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

AutoSnapshotPolicyId String sp-extreme-233e6ylv0

The ID of the automatic snapshot policy.

Examples

Sample requests

GET https://nas.cn-hangzhou.aliyuncs.com/?Action=CreateAutoSnapshotPolicy
&FileSystemType=extreme
&RepeatWeekdays=1,2,3
&TimePoints=0,1,2,3,4
&<Common request parameters>
...

Sample success responses

JSON format

{
  "RequestId": "12FA778B-C8D3-4D2B-88AD-C10ED0326C57",
  "AutoSnapshotPolicyId": "sp-extreme-6i0brwewjt0gfylh0"
}

Error codes

For a list of error codes, visit the API Error Center.