Creates an automatic snapshot policy.

Usage notes

  • The snapshot feature is in public preview and is provided free of charge. Apsara File Storage NAS Service Level Agreement (SLA) is not guaranteed in public preview.
  • Only advanced Extreme NAS file systems support this feature.
  • You can create a maximum of 100 automatic snapshot policies in each region for an Alibaba Cloud account.
  • If an auto snapshot is being created when the scheduled time for a new auto snapshot arrives, the creation of the new snapshot is skipped. This occurs if the file system stores a large volume of data. For example, you have scheduled auto snapshots to be created at 09:00:00, 10:00:00, 11:00:00, and 12:00:00 for a file system. The system starts to create an auto snapshot at 09:00:00 and does not complete the process until 10:20:00. The process takes 80 minutes because the file system has a large volume of data. In this case, the system does not create an auto snapshot at 10:00:00, but creates an auto snapshot at 11:00:00.
  • A maximum of 128 auto snapshots can be created for a file system. If the upper limit is reached, the earliest auto snapshot is deleted. This rule does not apply to manual snapshots.
  • If you modify the retention period of an automatic snapshot policy, the modification applies only to subsequent snapshots, but not to the existing snapshots.
  • If an auto snapshot is being created for a file system, you cannot create a manual snapshot for the file system. You must wait after the auto snapshot is created.
  • You can only apply automatic snapshot policies to a file system that is in the Running state.
  • All auto snapshots are named in the auto_yyyyMMdd_X format, where: auto indicates that the snapshot is created based on an automatic snapshot policy. yyyyMMdd indicates the date on which the snapshot is created. y indicates the year. M indicates the month. d indicates the day. X indicates the ordinal number of the snapshot on the current day. For example, auto_20201018_1 indicates the first auto snapshot that was created on October 18, 2020.
  • After an automatic snapshot 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.

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.

RepeatWeekdays String Yes 1,2,3

The days of a week on which auto snapshots are created.

Cycle: week.

Valid values: 1 to 7. The values from 1 to 7 indicate the seven days in a week from Monday to Sunday.

If you want to create multiple auto snapshots within a week, you can specify multiple days from Monday to Sunday and separate the days with commas (,). You can specify a maximum of seven days.

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

The points in time at which auto snapshots are created.

Unit: hours.

Valid values: 0 to 23. The values from 0 to 23 indicate a total of 24 hours from 00:00 to 23:00. For example, the value 1 indicates 01:00.

If you want to create multiple auto snapshots within a day, you can specify multiple points in time and separate the points in time with commas (,). You can specify a maximum of 24 points in time.

RetentionDays Integer No 30

The retention period of auto snapshots.

Unit: days.

Valid values:

  • -1 (default): Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
  • 1 to 65536: Auto snapshots are retained for the specified days. After the retention period of auto snapshots expires, the auto snapshots are automatically deleted.
AutoSnapshotPolicyName String No FinanceJoshua

The name of the automatic snapshot policy.

Limits:

  • The name must be 2 to 128 characters in length.
  • The name must start with a letter.
  • The name can contain digits, colons (:), underscores (_), and hyphens (-). It cannot start with http:// or https://.
  • By default, this parameter is empty.
FileSystemType String Yes extreme

The type of the file system.

Valid value: extreme, which indicates Extreme NAS file systems.

Response parameters

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

The request ID.

AutoSnapshotPolicyId String sp-extreme-233e6****

The ID of the automatic snapshot policy.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateAutoSnapshotPolicy
&FileSystemType=extreme
&RepeatWeekdays=1,2,3
&TimePoints=0,1,… 23
&<Common request parameters>

Sample success responses

XML format

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

<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
<AutoSnapshotPolicyId>sp-extreme-233e6****</AutoSnapshotPolicyId>

JSON format

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

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "AutoSnapshotPolicyId" : "sp-extreme-233e6****"
}

Error codes

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