All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::AutoSnapshotPolicies

Last Updated:Oct 28, 2024

DATASOURCE::ECS::AutoSnapshotPolicies is used to query automatic snapshot policies.

Syntax

{
  "Type": "DATASOURCE::ECS::AutoSnapshotPolicies",
  "Properties": {
    "ResourceGroupId": String,
    "AutoSnapshotPolicyId": String,
    "Tags": List,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

AutoSnapshotPolicyId

String

No

Yes

The ID of the automatic snapshot policy.

None.

Tags

List

No

Yes

The tags of the automatic snapshot policy.

You can add up to 20 tags.

For more information, see Tags properties.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Return values (Fn::GetAtt)

  • AutoSnapshotPolicyIds: the IDs of the automatic snapshot policies.

  • AutoSnapshotPolicies: details of the automatic snapshot policies.

Property

Type

Description

Constraint

AutoSnapshotPolicyIds

List

The IDs of the automatic snapshot policies.

None.

AutoSnapshotPolicies

List

Details of the automatic snapshot policies.

None.

TimePoints

String

The points in time at which automatic snapshots are created.

The time is displayed in UTC+8.

Valid values: 0 to 23. The values correspond to the 24 on-the-hour points in time from 00:00:00 to 23:00:00.

Unit: hour.

For example, a value of ["1","3","5"] specifies that automatic snapshots are created at 01:00:00, 03:00:00, and 05:00:00.

Status

String

The state of the automatic snapshot policy.

Valid values:

  • Normal: The automatic snapshot policy works as expected.

  • Expire: The automatic snapshot policy cannot be used because your account has an overdue payment.

AutoSnapshotPolicyName

String

The name of the automatic snapshot policy.

None.

AutoSnapshotPolicyId

String

The ID of the automatic snapshot policy.

None.

RetentionDays

Number

The retention period of automatic snapshots.

Valid values:

  • -1: Automatic snapshots are retained until they are deleted.

  • 1 to 65536: Automatic snapshots are retained for the specified number of days. After the retention period of automatic snapshots ends, the automatic snapshots are automatically deleted.

Unit: day.

DiskNums

Number

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

None.

RepeatWeekdays

String

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

Valid values: 1 to 7.

Unit: day.

Cycle: week.

For example, a value of ["1","3","5"] specifies that automatic snapshots are created on every Monday, Wednesday, and Friday.

VolumeNums

Number

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

None.

ResourceGroupId

String

The ID of the resource group.

None.

Tags

List

The tags of the automatic snapshot policy.

None.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "AutoSnapshotPolicies1": {
      "Type": "DATASOURCE::ECS::AutoSnapshotPolicies",
      "Properties": {
        "AutoSnapshotPolicyId": "sp-bp1acz3malct92k6****"
      }
    }
  },
  "Outputs": {
    "AutoSnapshotPolicyIds": {
      "Value": {
        "Fn::GetAtt": [
          "AutoSnapshotPolicies1",
          "AutoSnapshotPolicyIds"
        ]
      }
    },
    "AutoSnapshotPolicies": {
      "Value": {
        "Fn::GetAtt": [
          "AutoSnapshotPolicies1",
          "AutoSnapshotPolicies"
        ]
      }
    }
  }
}