All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::Snapshots

Last Updated:Nov 21, 2024

DATASOURCE::ECS::Snapshots is used to query all snapshots of an Elastic Compute Service (ECS) instance or a disk.

Syntax

{
  "Type": "DATASOURCE::ECS::Snapshots",
  "Properties": {
    "Status": String,
    "Usage": String,
    "Category": String,
    "KMSKeyId": String,
    "ResourceGroupId": String,
    "InstanceId": String,
    "Encrypted": Boolean,
    "SnapshotLinkId": String,
    "SnapshotIds": List,
    "SnapshotName": String,
    "Filters": List,
    "SnapshotType": String,
    "SourceDiskType": String,
    "Tags": List,
    "DiskId": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Status

String

No

Yes

The status of the snapshot.

Valid values:

  • progressing: The snapshot is being created.

  • accomplished: The snapshot is created.

  • failed: The snapshot failed to be created.

  • all (default): all snapshot states.

Usage

String

No

Yes

Specifies whether the snapshot is used to create custom images or disks.

Valid values:

  • image: The snapshot is used to create custom images.

  • disk: The snapshot is used to create disks.

  • image_disk: The snapshot is used to create custom images and data disks.

  • none: The snapshot is not used.

Category

String

No

Yes

The snapshot type.

Valid values:

  • Standard: standard snapshot

  • Flash: local snapshot

KMSKeyId

String

No

Yes

The ID of the Key Management Service (KMS) key that is used for the data disk.

None.

ResourceGroupId

String

No

Yes

The ID of the resource group.

If you use this property to filter resources, up to 1,000 resources that belong to the specified resource group can be returned.

InstanceId

String

No

Yes

The instance ID.

None.

Encrypted

Boolean

No

Yes

Specifies whether the snapshot is encrypted.

Valid values:

  • true

  • false (default)

SnapshotLinkId

String

No

Yes

The ID of the snapshot chain.

None.

SnapshotIds

List

No

Yes

The IDs of the snapshots.

You can specify up to 100 snapshot IDs. Separate multiple IDs with commas (,).

SnapshotName

String

No

Yes

The snapshot name.

None.

Filters

List

No

Yes

The filter keys and filter values that are used to query resources.

You can specify up to two sets of filter keys and filter values.

For more information, see Filters properties.

SnapshotType

String

No

Yes

The type of snapshot creation.

Valid values:

  • auto: automatic creation

  • user: manual creation

  • all (default): all creation types

SourceDiskType

String

No

Yes

The type of the source disk.

Valid values:

  • system: system disk

  • Data: data disk

Tags

List

No

Yes

The tags of the snapshot.

You can add up to 20 tags.

For more information, see Tags properties.

DiskId

String

No

Yes

The disk ID.

None.

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.

Filters syntax

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

Filters properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The filter value that is used to query resources.

The value must be a point in time in UTC+0.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format.

Key

String

Yes

No

The filter key that is used to query resources.

Valid values:

  • CreationStartTime

  • CreationEndTime

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The tag value of the snapshot.

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

Key

String

Yes

No

The tag key of the snapshot.

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

Return values (Fn::GetAtt)

  • SnapshotIds: the IDs of the snapshots.

  • Snapshots: details of the snapshots.

Property

Type

Description

Constraint

SnapshotIds

List

The IDs of the snapshots.

Example: ["s-bp67acfmxazb4p****", "s-bp67acfmxazb5p****", … "s-bp67acfmxazb6p****"].

Snapshots

List

Details of the snapshots.

None.

Status

String

The status of the snapshot.

Valid values:

  • progressing: The snapshot is being created.

  • accomplished: The snapshot is created.

  • failed: The snapshot failed to be created.

Progress

String

The progress of the snapshot creation.

Unit: percentage.

Example: 100%.

Usage

String

Indicates whether the snapshot is used to create custom images or disks.

Valid values:

  • image: The snapshot is used to create custom images.

  • disk: The snapshot is used to create disks.

  • image_disk: The snapshot is used to create custom images and data disks.

  • none: The snapshot is not used.

Description

String

The description.

None.

Category

String

The snapshot type.

Valid values:

  • Standard: standard snapshot

  • Flash: local snapshot

KMSKeyId

String

The ID of the KMS key that is used for the data disk.

None.

ProductCode

String

The product code of the Alibaba Cloud Marketplace image.

None.

Encrypted

Boolean

Indicates whether the snapshot is encrypted.

Valid values:

  • true

  • false

SnapshotName

String

The snapshot name.

None.

SourceDiskId

String

The ID of the source disk.

This property is retained even after the source disk of the snapshot is released.

SourceStorageType

String

The type of the source disk.

None.

SnapshotId

String

The snapshot ID.

None.

SnapshotSN

String

The serial number of the snapshot.

None.

SourceDiskSize

String

The size of the source disk.

Unit: GiB.

SnapshotType

String

The type of snapshot creation.

Valid values:

  • auto: automatic creation

  • user: manual creation

SourceDiskType

String

The type of the source disk.

Valid values:

  • system: system disk

  • Data: data disk

Tags

List

The tags.

Example: [{'Value': 'value_test', 'Key': 'test123'}].

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SnapshotName": {
      "Type": "String",
      "Description": "The name of the snapshot.",
      "Default": "auto_20150730_3"
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ECS::Snapshots",
      "Properties": {
        "SnapshotName": {
          "Ref": "SnapshotName"
        }
      }
    }
  },
  "Outputs": {
    "SnapshotIds": {
      "Description": "the list of snapshot ids.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SnapshotIds"
        ]
      }
    },
    "Snapshots": {
      "Description": "the list of snapshots.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Snapshots"
        ]
      }
    }
  }
}