DATASOURCE::SWAS::Instances

更新时间:
复制为 MD 格式

DATASOURCE::SWAS::Instances类型用于查询指定地域下,一个或多个实例的详细信息。

语法

{
  "Type": "DATASOURCE::SWAS::Instances",
  "Properties": {
    "InstanceName": String,
    "InstanceIds": List,
    "PlanType": String,
    "ResourceGroupId": String,
    "RefreshOptions": String,
    "Status": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InstanceName

String

轻量应用服务器实例名称。

InstanceIds

List

轻量应用服务器的实例 ID列表。

PlanType

String

套餐类型。

可能值:

  • NORMAL:通用型。

  • CAPACITY:容量型。

  • PREVIOUS:上一代。

  • MULTI_IP:多公网 IP 型。

  • INTERNATIONAL:国际型。

ResourceGroupId

String

轻量应用服务器所属的资源组 ID。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

Status

String

实例状态。

可能值:

  • Pending:准备中。

  • Starting:启动中。

  • Running:运行中。

  • Stopping:停止中。

  • Stopped:停止。

  • Resetting:重置中。

  • Upgrading:升级中。

  • Disabled:不可用。

返回值

Fn::GetAtt

  • Instances:轻量应用服务器详情信息组成列表。

  • InstanceIds:轻量应用服务器ID列表。

属性名称

类型

描述

约束

InstanceIds

List

轻量应用服务器ID列表。

Instances

List

轻量应用服务器详情信息组成列表。

DisableReason

String

资源被禁用的原因。

Status

String

实例状态。

ResourceGroupId

String

轻量应用服务器所属的资源组 ID。

InstanceId

String

轻量应用服务器的实例 ID。

PlanId

String

套餐 ID。

ResourceSpec

Map

资源规格。

示例:

{
        "DiskCategory": "ESSD",
        "Cpu": 2,
        "Bandwidth": 200,
        "DiskSize": 60,
        "Memory": 2,
        "Flow": 818
      }

DdosStatus

String

DDos 状态。

Image

Map

镜像的说明信息。

示例:

{
        "OsType": "windows",
        "ImageName": "test-custom-1686536882356",
        "ImageVersion": "V3.5",
        "ImageType": "system",
        "ImageIconUrl": "https://img.alicdn.com/imgextra/i3/O****1vdh9651ReKqWNMI2I_!!6000000002136****-24-24.svg",
        "ImageContact": "https://selfs****e.console.aliyun.com/ticket/createIndex"
      }

BusinessStatus

String

服务器状态。

PublicIpAddress

String

轻量应用服务器的公网 IP。

InstanceName

String

轻量应用服务器实例名称。

InnerIpAddress

String

内网 IP 地址。

NetworkAttributes

List

网络返回信息。

示例:

[
        {
          "PublicIpAddress": "116.62.XX.XX",
          "PrivateIpAddress": "72.25.XX.XX",
          "PeakBandwidth": 200,
          "PublicIpDdosStatus": "normal"
        }
      ]

Uuid

String

实例的 UUID。

Combination

String

是否为组合套餐。

ChargeType

String

实例的计费方式。

ExpiredTime

String

到期时间。

CreationTime

String

创建时间。

ImageId

String

镜像 ID。

PlanType

String

套餐类型,

Disks

List

轻量对应磁盘信息的数组。

[
        {
          "CreationTime": "2023-02-24T02:20:10Z",
          "Status": "In_use",
          "Device": "/dev/xvda",
          "Size": 50,
          "DiskName": "SystemDisk",
          "DiskChargeType": "PrePaid",
          "DiskType": "system",
          "Category": "ESSD",
          "DiskId": "d-bp14wq0149cpp2x****",
          "RegionId": "cn-hangzhou",
          "Remark": "remark",
          "DiskTags": [
            {
              "Key": "TestKey",
              "Value": "TestValue"
            }
          ],
          "ResourceGroupId": "rg-aek2bti7cf7****"
        }
      ]

RegionId

String

轻量应用服务器所属的地域 ID。

Tags

List

实例的标签列表。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceIds:
    Type: Json
    Description:
      en: The IDs of instances.
    Required: false
    MinLength: 1
    MaxLength: 100
Resources:
  Instances:
    Type: DATASOURCE::SWAS::Instances
    Properties:
      InstanceIds:
        Ref: InstanceIds
Outputs:
  Instances:
    Description: The list of instances.
    Value:
      Fn::GetAtt:
        - Instances
        - Instances
  InstanceIds:
    Description: The list of instance IDs.
    Value:
      Fn::GetAtt:
        - Instances
        - InstanceIds
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceIds": {
      "Type": "Json",
      "Description": {
        "en": "The IDs of instances."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 100
    }
  },
  "Resources": {
    "Instances": {
      "Type": "DATASOURCE::SWAS::Instances",
      "Properties": {
        "InstanceIds": {
          "Ref": "InstanceIds"
        }
      }
    }
  },
  "Outputs": {
    "Instances": {
      "Description": "The list of instances.",
      "Value": {
        "Fn::GetAtt": [
          "Instances",
          "Instances"
        ]
      }
    },
    "InstanceIds": {
      "Description": "The list of instance IDs.",
      "Value": {
        "Fn::GetAtt": [
          "Instances",
          "InstanceIds"
        ]
      }
    }
  }
}