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:
|
Usage | String | No | Yes | Specifies whether the snapshot is used to create custom images or disks. | Valid values:
|
Category | String | No | Yes | The snapshot type. | Valid values:
|
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:
|
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:
|
SourceDiskType | String | No | Yes | The type of the source disk. | Valid values:
|
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:
|
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 |
Key | String | Yes | No | The filter key that is used to query resources. | Valid values:
|
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 |
Key | String | Yes | No | The tag key of the snapshot. | The tag key must be 1 to 128 characters in length, and cannot contain |
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: |
Snapshots | List | Details of the snapshots. | None. |
Status | String | The status of the snapshot. | Valid values:
|
Progress | String | The progress of the snapshot creation. | Unit: percentage. Example: |
Usage | String | Indicates whether the snapshot is used to create custom images or disks. | Valid values:
|
Description | String | The description. | None. |
Category | String | The snapshot type. | Valid values:
|
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:
|
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:
|
SourceDiskType | String | The type of the source disk. | Valid values:
|
Tags | List | The tags. | Example: |
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"
]
}
}
}
}