Queries existing automatic snapshot policies 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 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 current list of regions.

AutoSnapshotPolicyId String No sp-bp67acfmxazb4ph****

The ID of the automatic snapshot policy.

AutoSnapshotPolicyName String No TestName

The name of the automatic snapshot policy.

PageNumber Integer No 1

The number of the page to return.

Page start from page 1.

Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Maximum value: 100.

Default value: 10.

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://.

ResourceGroupId String No rg-aek2kkmhmhs****

The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.

Note Resources in the default resource group are displayed in the response regardless of how this parameter is set.

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 to create automatic snapshots.

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 array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

CreationTime String 2019-12-10T16:00Z

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 your account has overdue payments.
AutoSnapshotPolicyName String testAutoSnapshotPolicyName

The name of the automatic snapshot policy.

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

The ID of the automatic snapshot policy.

RetentionDays Integer 7

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

  • -1: The automatic snapshot is retained until it is deleted.
  • 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 for general users.
RepeatWeekdays String ["6"]

The days of the week on which to create automatic snapshots. Valid values: 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 to which the automatic snapshot policy is applied.

ResourceGroupId String rg-aek2kkmhmhs****

The ID of the resource group.

Tags Array of Tag

The tags of the automatic snapshot policy.

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

http(s)://ecs.aliyuncs.com/?Action=DescribeAutoSnapshotPolicyEx
&RegionId=cn-hangzhou
&AutoSnapshotPolicyId=sp-bp67acfmxazb4ph****
&AutoSnapshotPolicyName=p-23f2i9s4t
&PageNumber=1
&PageSize=1
&Tag=[{"Key":"TestKey","Value":"TestValue"}]
&ResourceGroupId=rg-aek2kkmhmhs****
&Common request parameters

Sample success responses

XML format

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

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

JSON format

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

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

Error codes

HTTP status code Error codes Error message Description
400 InvalidRegionId.NotFound The specified RegionId does not exist. The error message returned because the specified RegionId parameter is invalid.
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 parameter does not correspond to the specified Tag.N.Value parameter.
400 InvalidTagCount The specified tags are beyond the permitted range. The error message returned because the number of specified tags has exceeded the upper limit.

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