文档

DATASOURCE::ECS::Instances

更新时间:

DATASOURCE::ECS::Instances类型用于查询ECS实例的详细信息。

语法

{
  "Type": "DATASOURCE::ECS::Instances",
  "Properties": {
    "InnerIpAddresses": List,
    "ResourceGroupId": String,
    "PrivateIpAddresses": List,
    "InstanceChargeType": String,
    "InstanceTypeFamily": String,
    "InstanceNetworkType": String,
    "Filters": List,
    "AdditionalAttributes": List,
    "ImageId": String,
    "PublicIpAddresses": List,
    "RdmaIpAddresses": String,
    "InstanceIds": List,
    "InstanceType": String,
    "Ipv6Address": List,
    "Tags": List,
    "Status": String,
    "KeyPairName": String,
    "IoOptimized": Boolean,
    "ZoneId": String,
    "InstanceId": String,
    "HpcClusterId": String,
    "VSwitchId": String,
    "SecurityGroupId": String,
    "InternetChargeType": String,
    "InstanceName": String,
    "EipAddresses": List,
    "VpcId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InnerIpAddresses

List

经典网络类型实例的内网IP地址。

当InstanceNetworkType取值为classic时,该参数有效。

最多支持100个IP地址,多个IP地址间用半角逗号(,)分隔。

取值示例:["10.1.1.1", "10.1.2.1", … "10.1.10.1"]

ResourceGroupId

String

实例所在的资源组ID。

PrivateIpAddresses

List

VPC网络类型实例的私有IP地址。

当InstanceNetworkType取值为vpc时,该参数有效。

最多支持100个IP地址,多个IP地址间用半角逗号(,)分隔。

取值示例:["172.16.1.1", "172.16.2.1", … "172.16.10.1"]

InstanceChargeType

String

实例的计费方式。

取值:

  • PostPaid:按量付费。

  • PrePaid:包年包月。

InstanceTypeFamily

String

实例的规格族。

InstanceNetworkType

String

实例的网络类型。

取值:

  • classic:经典网络。

  • vpc:专有网络VPC。

Filters

List

查询资源时的过滤条件。

更多信息,请参见Filters属性

AdditionalAttributes

List

其他属性值。

取值:

  • META_OPTIONS:实例元数据。

  • DDH_CLUSTER:专有宿主机集群。

  • NETWORK_PRIMARY_ENI_IP:主网卡辅助IP地址。

ImageId

String

镜像ID。

PublicIpAddresses

List

实例的公网IP地址。

最多支持100个IP地址,多个IP地址间用半角逗号(,)分隔。

取值示例:["192.0.2.0", "192.0.2.1**", … "192.0.2.10"]

RdmaIpAddresses

String

HPC实例的RDMA网络IP地址。

InstanceIds

List

实例ID列表。

最多支持100个实例ID,多个实例ID之间用半角逗号(,)分隔。

InstanceType

String

实例的规格。

Ipv6Address

List

弹性网卡的IPv6地址。

最多支持100个IP地址,多个地址之间用半角逗号(,)分隔。

Tags

List

实例的标签。

最多支持20个标签。

更多信息,请参见Tags属性

Status

String

实例的状态。

取值:

  • Pending:创建中。

  • Running:运行中。

  • Starting:启动中。

  • Stopping:停止中。

  • Stopped:已停止。

KeyPairName

String

实例使用的SSH密钥对名称。

IoOptimized

Boolean

是否为I/O优化型实例。

取值:

  • true:I/O优化。

  • false:非I/O优化。

ZoneId

String

可用区ID。

InstanceId

String

实例ID。

HpcClusterId

String

实例所在的HPC集群ID。

VSwitchId

String

交换机ID。

SecurityGroupId

String

安全组ID。

InternetChargeType

String

公网带宽计费方式。

取值:

  • PayByBandwidth:按固定带宽计费。

  • PayByTraffic:按使用流量计费。

InstanceName

String

实例的名称。

EipAddresses

List

实例的弹性公网IP地址。

当InstanceNetworkType取值为vpc时,该参数有效。

最多支持100个IP地址,多个IP地址间用半角逗号(,)分隔。

VpcId

String

专有网络ID。

Filters语法

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

Filters属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

查询资源时的过滤键。

取值:CreationStartTime,表示创建开始时间。

同时设置Key和Value可以查询在指定时间点后创建的资源信息。

Value

String

查询资源时的过滤值。

采用UTC+0时区,格式为:yyyy-MM-ddTHH:mmZ

Tags语法

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

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

实例的标签键。

Value

String

实例的标签值。

返回数据(Fn::GetAtt)

  • InstanceIds:实例ID列表。

  • Instances:实例详情列表。

属性名称

类型

描述

约束

InstanceIds

List

实例ID列表。

Instances

List

实例详情列表。

SerialNumber

String

实例的序列号。

Status

String

实例的状态。

DeploymentSetId

String

部署集ID。

SpotStrategy

String

抢占式实例的抢占策略。

取值:

  • NoSpot:正常按量付费实例。

  • SpotWithPriceLimit:设置上限价格的抢占式实例。

  • SpotAsPriceGo:系统自动出价,最高按量付费价格。

DeviceAvailable

Boolean

实例是否可以挂载数据盘。

取值:

  • true:可以。

  • false:不可以。

Description

String

实例的描述。

InstanceNetworkType

String

实例的网络类型。

取值:

  • classic:经典网络。

  • vpc:专有网络VPC。

InstanceName

String

实例的名称。

OSNameEn

String

实例操作系统的英文名称。

SpotPriceLimit

Number

实例的每小时最高价格。

当返回的SpotStrategy取值为SpotWithPriceLimit时,该参数有效。

Memory

Number

内存大小。

单位:MiB。

OSName

String

实例的操作系统名称。

ImageId

String

镜像ID。

GPUSpec

String

实例规格附带的GPU类型。

StoppedMode

String

实例停机后是否继续收费。

取值:

  • KeepCharging:停机后继续收费,为您继续保留库存资源。

  • StopCharging:停机后不收费。停机后,将释放实例对应的资源,例如:vCPU、内存和公网IP等资源。

  • Not-applicable:本实例不支持停机不收费功能。

GPUAmount

Number

实例规格附带的GPU数量。

HostName

String

实例的主机名。

InstanceId

String

实例ID。

InternetMaxBandwidthOut

Number

公网出带宽最大值。

单位:Mbit/s。

InternetMaxBandwidthIn

Number

公网入带宽最大值。

单位:Mbit/s。

InstanceType

String

实例的规格。

InstanceChargeType

String

实例的计费方式。

取值:

  • PrePaid:包年包月。

  • PostPaid:按量付费。

IoOptimized

Boolean

是否为I/O优化型实例。

取值:

  • true:I/O优化。

  • false:非I/O优化。

Cpu

Number

vCPU的数量。

ResourceGroupId

String

实例所属资源组ID。

InternetChargeType

String

网络计费类型。

取值:

  • PayByBandwidth:按固定带宽计费。

  • PayByTraffic:按使用流量计费。

ZoneId

String

可用区ID。

InstanceTypeFamily

String

实例规格族。

OSType

String

实例的操作系统类型。

取值:

  • windows

  • linux

NetworkInterfaces

List

实例包含的弹性网卡列表。

Tags

List

实例的标签列表。

SecurityGroupIds

List

实例所属安全组列表。

PublicIpAddress

List

实例的公网IP地址。

InnerIpAddress

List

经典网络类型实例的内网IP地址。

EipAddress

List

实例的弹性公网IP地址。

DedicatedHostAttribute

List

专有宿主机的相关参数。

EcsCapacityReservationAttr

List

ECS的容量预留相关参数。

DedicatedInstanceAttribute

List

专有宿主机实例的属性。

OperationLocks

List

实例的锁定原因。

PrivateIpAddress

List

私有IP地址列表。

VpcId

String

专有网络VPC ID。

VswitchId

String

交换机ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      InstanceIds:
        Type: Json
        Default:
          - i-bp17f03tk0f4bi86***
    Resources:
      NetworkInterfaces:
        Type: DATASOURCE::ECS::Instances
        Properties:
          InstanceIds:
            Ref: InstanceIds
    Outputs:
      Images:
        Value:
          Fn::GetAtt:
            - NetworkInterfaces
            - InstanceIds
      ImageIds:
        Value:
          Fn::GetAtt:
            - NetworkInterfaces
            - Instances
                        
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "InstanceIds": {
          "Type": "Json",
          "Default": [
            "i-bp17f03tk0f4bi86***"
          ]
        }
      },
      "Resources": {
        "NetworkInterfaces": {
          "Type": "DATASOURCE::ECS::Instances",
          "Properties": {
            "InstanceIds": {
              "Ref": "InstanceIds"
            }
          }
        }
      },
      "Outputs": {
        "Images": {
          "Value": {
            "Fn::GetAtt": [
              "NetworkInterfaces",
              "InstanceIds"
            ]
          }
        },
        "ImageIds": {
          "Value": {
            "Fn::GetAtt": [
              "NetworkInterfaces",
              "Instances"
            ]
          }
        }
      }
    }
  • 本页导读 (1)
文档反馈