DATASOURCE::ECS::ManagedInstances is used to query managed instances.

Syntax

{
  "Type": "DATASOURCE::ECS::ManagedInstances",
  "Properties": {
    "InstanceName": String,
    "InstanceId": List,
    "OsType": String,
    "ActivationId": String,
    "InstanceIp": String,
    "Tags": List
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
InstanceNameStringNoYesThe name of the managed instance. None.
InstanceIdListNoYesThe ID of the managed instance.
{'Length': {'Max': 50}}
OsTypeStringNoYesThe OS type of the managed instance. Valid values:
  • windows
  • linux
ActivationIdStringNoYesThe ID of the activation code. None.
InstanceIpStringNoYesThe private or public IP address of the managed instance. None.
TagsListNoYesThe tags of the managed instance.
{'Length': {'Max': 20}}

Tags syntax

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

Tags properties

PropertyTypeRequiredEditableDescriptionConstraint
ValueStringNoNoThe value of the tag.The tag value can be up to 128 characters in length, and cannot contain http:// or https://.
KeyStringYesNoThe key of the tag.The tag key can be up to 64 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

Return values

Fn::GetAtt

  • Instances: details of the managed instances.
  • InstanceIds: the IDs of the managed instances.
PropertyTypeDescriptionConstraint
InstanceIdsListThe IDs of the managed instances. None.
InstancesListDetails of the managed instances. None.
LastInvokedTimeStringThe time when the Cloud Assistant task was last executed. None.
ConnectedBooleanIndicates whether the managed instance is connected. Valid values:
  • true: The managed instance is connected and you can manage the instance by using Cloud Assistant.
  • false: The managed instance is not connected because the managed instance is stopped or because the Cloud Assistant client is not installed correctly.
HostnameStringThe hostname of the managed instance. None.
InstanceIdStringThe ID of the managed instance. None.
ActivationIdStringThe ID of the activation code. None.
IntranetIpStringThe private IP address of the managed instance. None.
AgentVersionStringThe version number of the Cloud Assistant client. None.
RegistrationTimeStringThe time when the managed instance was registered. None.
InstanceNameStringThe name of the managed instance. None.
OsTypeStringThe OS type of the managed instance. None.
OsVersionStringThe version information about the OS. None.
InvocationCountNumberThe number of times that Cloud Assistant tasks were executed on the managed instance. None.
MachineIdStringThe machine code of the managed instance. None.
TagsMapThe tags of the managed instance. Sample value:
[{"TagKey": "ccc","TagValue": "bbb"}]

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      ExtensionDataSource:
        Type: DATASOURCE::ECS::ManagedInstances
        Properties:
          InstanceName: TestEcs
          OsType: linux
    Outputs:
      Instances:
        Description: The list of managed instances.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - Instances
      InstanceIds:
        Description: The list of managed instance ids.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - InstanceIds
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::ECS::ManagedInstances",
          "Properties": {
            "InstanceName": "TestEcs",
            "OsType": "linux"
          }
        }
      },
      "Outputs": {
        "Instances": {
          "Description": "The list of managed instances.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Instances"
            ]
          }
        },
        "InstanceIds": {
          "Description": "The list of managed instance ids.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "InstanceIds"
            ]
          }
        }
      }
    }