Queries the created automatic snapshot policies that meet the specified query conditions in a region.

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.

Maximum value: 100.

Default value: 10.

ResourceGroupId String No rg-aek2kkmhmhs****

The ID of the resource group to which the automatic snapshot policy belongs.

Tag.N.Key String No TestKey

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

Tag.N.Value String No TestValue

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

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries returned per page.

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

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

TotalCount Integer 1

The total number of automatic snapshot policies.

AutoSnapshotPolicies Array of AutoSnapshotPolicy

Details about the automatic snapshot policies.

AutoSnapshotPolicy
TimePoints String ["1"]

The points in time of the day at which automatic snapshots are created.

The time is displayed in UTC+8. Unit: hours. Valid values are 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. 1 indicates 01:00:00. Multiple points in time can be specified.

The parameter value is a JSON-formatted array such as ["0", "1",... "23"] . The array can contain a maximum of 24 points in time separated by commas (,).

CreationTime String 2021-09-01 15:30:01

The time when the automatic 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.

Status String Normal

The state of the automatic snapshot policy. Valid values:

  • Normal: The automatic snapshot policy is normal.
  • Expire: The automatic snapshot policy cannot be used because you have overdue payments in your account.
AutoSnapshotPolicyName String testAutoSnapshotPolicyName

The name of the automatic snapshot policy.

TargetCopyRegions String test
Note This parameter is in invitational preview and unavailable.
CopiedSnapshotsRetentionDays Integer 0
Note This parameter is in invitational preview and unavailable.
AutoSnapshotPolicyId String sp-bp67acfmxazb4ph****

The ID of the automatic snapshot policy.

RetentionDays Integer 7

The retention period of the automatic snapshot. Valid values:

  • -1: The automatic snapshot is permanently retained.
  • 1 to 65536: The automatic snapshot is retained for the specified number of days.
RegionId String cn-hangzhou

The region ID of the automatic snapshot policy.

DiskNums Integer 1

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

EnableCrossRegionCopy Boolean false
Note This parameter is in invitational preview and unavailable.
RepeatWeekdays String ["6"]

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

VolumeNums Integer 2

The number of extended volumes on which the policy is applied.

ResourceGroupId String rg-aek2kkmhmhs****

The ID of the resource group to which the automatic snapshot policy belongs.

Tags Array of Tag

Details about tags of the automatic snapshot policies.

Tag
TagValue String TestValue

The tag value of the automatic snapshot policy.

TagKey String TestKey

The tag key of the automatic snapshot policy.

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

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

<DescribeAutoSnapshotPolicyExResponse>
    <TotalCount>1</TotalCount>
    <PageSize>10</PageSize>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <PageNumber>1</PageNumber>
    <AutoSnapshotPolicies>
        <AutoSnapshotPolicy>
            <Status>Normal</Status>
            <TimePoints>["1"]</TimePoints>
            <VolumeNums>2</VolumeNums>
            <ResourceGroupId>rg-aek2kkmhmhs****</ResourceGroupId>
            <AutoSnapshotPolicyId>sp-bp67acfmxazb4ph****</AutoSnapshotPolicyId>
            <RetentionDays>7</RetentionDays>
            <RepeatWeekdays>["6"]</RepeatWeekdays>
            <DiskNums>1</DiskNums>
            <CopiedSnapshotsRetentionDays>-1</CopiedSnapshotsRetentionDays>
            <EnableCrossRegionCopy>false</EnableCrossRegionCopy>
            <CreationTime>2021-09-01 15:30:01</CreationTime>
            <RegionId>cn-hangzhou</RegionId>
            <AutoSnapshotPolicyName>testAutoSnapshotPolicyName</AutoSnapshotPolicyName>
            <Tags>
                <Tag>
                    <TagKey>TestKey</TagKey>
                    <TagValue>TestValue</TagValue>
                </Tag>
            </Tags>
        </AutoSnapshotPolicy>
    </AutoSnapshotPolicies>
</DescribeAutoSnapshotPolicyExResponse>

JSON format

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

{
  "TotalCount" : 1,
  "PageSize" : 10,
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber" : 1,
  "AutoSnapshotPolicies" : {
    "AutoSnapshotPolicy" : [ {
      "Status" : "Normal",
      "TimePoints" : "[\"1\"]",
      "VolumeNums" : 2,
      "ResourceGroupId" : "rg-aek2kkmhmhs****",
      "AutoSnapshotPolicyId" : "sp-bp67acfmxazb4ph****",
      "RetentionDays" : 7,
      "RepeatWeekdays" : "[\"6\"]",
      "DiskNums" : 1,
      "CopiedSnapshotsRetentionDays" : -1,
      "EnableCrossRegionCopy" : false,
      "CreationTime" : "2021-09-01 15:30:01",
      "RegionId" : "cn-hangzhou",
      "AutoSnapshotPolicyName" : "testAutoSnapshotPolicyName",
      "Tags" : {
        "Tag" : [ {
          "TagKey" : "TestKey",
          "TagValue" : "TestValue"
        } ]
      }
    } ]
  }
}

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 correspond to each other.
400 InvalidTagCount The specified tags are beyond the permitted range. The error message returned because the number of specified tags has reached the upper limit.

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