You can call this operation to query the automatic snapshot policies that you have created.

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 DescribeAutoSnapshotPolicyEx

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

RegionId String Yes cn-hangzhou

The region ID of the automatic snapshot policy. You can call the DescribeRegions operation to query the most recent region list

AutoSnapshotPolicyId String No sp-bp67acfmxazb4ph***

The ID of the automatic snapshot policy.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1.

Default value: 1.

PageSize Integer No 1

The number of entries to return on each page.

Valid values: 1 to 100.

Default value: 10.

Tag.N.Key String No Test

The key of tag N of the snapshot. Valid values of N: 1 to 20. It cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun.

Tag.N.Value String No Test

The value of tag N of the snapshot. Valid values of N: 1 to 20. It can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs:.

Response parameters

Parameter Type Example Description
AutoSnapshotPolicies Array

An array consisting of AutoSnapshotPolicy data.

AutoSnapshotPolicy
AutoSnapshotPolicyId String FinanceJoshua

The ID of the automatic snapshot policy.

AutoSnapshotPolicyName String sp-bp67acfmxazb4ph***

The name of the automatic snapshot policy.

CreationTime String 2014-04-21T12:08:52Z

The time when the auto snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

DiskNums Integer 1

The number of disks to which the automatic snapshot policy is applied.

RegionId String cn-hangzhou

The ID of the region to which the automatic snapshot policy belongs.

RepeatWeekdays String ["6"]

The days of a week on which automatic snapshots are created. Valid values: 1 to 7, corresponding to the days of a week, where 1 indicates Monday. One or more days can be specified.

RetentionDays Integer 30

The retention period of the automatic snapshot. Unit: days. Valid values:

  • -1: The automatic snapshot is retained permanently.
  • 1-65536: The automatic snapshot is retained for the specified number of days.
Status String Normal

The status of the automatic snapshot policy. Valid values:

  • Normal: The automatic snapshot policy is normal.
  • Expire: The automatic snapshot policy cannot be used because the account has overdue payments.
Tags Array

An array consisting of Tag data.

Tag
TagKey String Test

The tag key of the snapshot.

TagValue String Test

The tag value of the snapshot.

TimePoints String ["4", "19"]

The points in time at which automatic snapshots were created.

The least interval that snapshots can be taken at is one hour. Valid values: 0 to 23, corresponding to 24 hours in the range of 00:00 to 23:00. 1 indicates 01:00. You can specify multiple points in time.

The parameter is a JSON-formatted array: ["0", "1", ... "23". You can specify a maximum of 24 points in time. Separate multiple points in time with commas (,).

VolumeNums Integer 2

The number of extended volumes on which this policy is enabled.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 1

The number of entries returned per page.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

TotalCount Integer 2

The total number of automatic snapshot policies.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeAutoSnapshotPolicyEx
&RegionId=cn-hangzhou
&AutoSnapshotPolicyId=sp-bp67acfmxazb4ph***
&PageNumber=1
&PageSize=1
&<Common request parameters>

Sample success responses

XML format

<DescribeAutoSnapshotPolicyResponse>
      <PageNumber>1</PageNumber>
      <TotalCount>2</TotalCount>
      <AutoSnapshotPolicies>
            <AutoSnapshotPolicy>
                  <CreationTime>2019-01-22 11:38:08</CreationTime>
                  <Status>Normal</Status>
                  <DiskNums>1</DiskNums>
                  <AutoSnapshotPolicyName>SnapshotPolicyUserManual</AutoSnapshotPolicyName>
                  <RegionId>cn-hangzhou</RegionId>
                  <VolumeNums>2</VolumeNums>
                  <RetentionDays>30</RetentionDays>
                  <TimePoints>["0"]</TimePoints>
                  <AutoSnapshotPolicyId>sp-bp67acfmxazb4ph***</AutoSnapshotPolicyId>
                  <RepeatWeekdays>["7"]</RepeatWeekdays>
                  <Tags>
                        <Tag>
                              <TagKey>Test</TagKey>
                              <TagValue>Test</TagValue>
                        </Tag>
                  </Tags>
            </AutoSnapshotPolicy>
      </AutoSnapshotPolicies>
      <PageSize>1</PageSize>
      <RequestId>CC323EDF-BBB7-420F-BCD1-D9B9D2E9D424</RequestId>
</DescribeAutoSnapshotPolicyResponse>

JSON format

{
    "PageNumber": 1,
    "TotalCount": 2,
    "AutoSnapshotPolicies": {
        "AutoSnapshotPolicy": [
            {
                "CreationTime": "2019-01-22 11:38:08",
                "Status": "Normal",
                "DiskNums": 1,
                "AutoSnapshotPolicyName": "SnapshotPolicyUserManual",
                "RegionId": "cn-hangzhou",
                "VolumeNums": 2,
                "RetentionDays": 30,
                "TimePoints": "[\"0\"]",
                "AutoSnapshotPolicyId": "sp-bp67acfmxazb4ph***",
                "RepeatWeekdays": "[\"7\"]",
                "Tags": {
                    "Tag": [
                        {
                            "TagKey": "Test",
                            "TagValue": "Test"
                        }
                    ]
                }
            }
        ]
    },
    "PageSize": 1,
    "RequestId": "CC323EDF-BBB7-420F-BCD1-D9B9D2E9D424"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidRegionId.NotFound The specified RegionId does not exist. The error message returned because the specified RegionId parameter does not exist.
400 InvalidTag.Mismatch The specified Tag.n.Key and Tag.n.Value are not match. The error message returned because the specified Tag.N.Key and Tag.N.Value parameters do not match.
400 InvalidTagCount The specified tags are beyond the permitted range. The error message returned because the maximum number of the specified tags has been reached.

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