描述实例信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeInstances

系统规定参数。取值:DescribeInstances。

PageNumber Long 1

页码。

PageSize Long 10

每页的实例个数。

ClusterId String gws-xxx

列出指定集群 id 中的所有实例。

说明 如果此参数未指定,则列出所有集群中的实例。
InstanceId String i-xxx

列出实例 id 的信息。

说明 如果此参数未指定,则列出所有实例。
UserUid Long 12345

列出分配给指定用户 id 的所有实例。

说明 如果此参数未指定,则列出所有用户的实例。
UserName String user01

列出分配给指定用户的所有实例。

说明 如果此参数未指定,则列出所有用户的实例。

返回数据

名称 类型 示例值 描述
Instances Array of Instance

实例信息列表。

AppList Array of App

应用列表。

说明 工作模式为桌面模式时,此列表为空
AppArgs String c:\temp.txt

应用的运行参数。

AppName String notepad

应用名称。

AppPath String c:\windows\system32\nodepad.exe

应用的运行路径。

ClusterId String gws-xxx

集群 id

CreateTime String 2019-10-12T07:35Z

创建时间。

DomainName String abc.com

实例所在的集群所关联的用户 AD。当集群未做 AD 关联或集群不支持 AD 关联时,此值为空。

ExpireTime String 2099-12-31T15:59Z

过期时间。

HostName String c0-i01-xx-t6

主机名称,实例创建时自动生成。不可更改,否则会导致实例状态“未注册”

ImageId String m-xxx

实例创建时所使用的镜像 id。

InstanceChargeType String PostPaid

计费方式:

  • PrePaid:包年包月
  • PostPaid:按量付费
InstanceId String i-xxx

实例 id

InstanceType String ecs.g6.large

实例类型。

IsBoundUser Boolean true

当前调用者是否已分配给当前实例

  • true:是
  • false:否
MaxBandwidthIn Long 100

公网入带宽最大值,单位为 Mbps

MaxBandwidthOut Long 100

公网出带宽最大值,单位为 Mbps

Name String c0-i01-xx-t6-2c8g

实例名称,用户可以自行设置

Status String Stopped

实例状态:

  • Creating:创建中
  • Starting:启动中
  • Stopping:停止中
  • Stopped:已停止
  • Initializing:初始化
  • Unregistered:未注册
  • Registered:已注册
  • InUse:使用中
  • Missing:丢失
  • Cloning:镜像制作中
StoppedMode String 停止

实例停止时的计费状态。

  • KeepCharging:收费中,例如用户通过 Windows 内部关机
  • StopCharging:停止收费
  • Not-applicable:不适用。例如包年包月实例
UserName String user-xxx

分配的用户名。

说明 实例未分配给指定用户时,此值为空。
UserUid Long 1234

分配的用户 id

说明 实例未分配给指定用户时,此值为空。
WorkMode String Application

工作模式

  • Desktop:桌面模式
  • Application:应用模式
PageNumber Long 1

页码。

PageSize Long 10

每页行数。

RequestId String XXX-XXX

请求 id

TotalCount Long 1

实例总数。

示例

请求示例

http(s)://[Endpoint]/?Action=DescribeInstances
&<公共请求参数>

正常返回示例

XML格式

<Instances>
    <Status>Stopped</Status>
    <MaxBandwidthOut>100</MaxBandwidthOut>
    <MaxBandwidthIn>100</MaxBandwidthIn>
    <UserName>user-xxx</UserName>
    <DomainName>abc.com</DomainName>
    <ClusterId>gws-xxx</ClusterId>
    <InstanceId>i-xxx</InstanceId>
    <InstanceChargeType>PostPaid</InstanceChargeType>
    <StoppedMode>停止</StoppedMode>
    <CreateTime>2019-10-12T07:35Z</CreateTime>
    <IsBoundUser>true</IsBoundUser>
    <Name>c0-i01-xx-t6-2c8g</Name>
    <UserUid>1234</UserUid>
    <ImageId>m-xxx</ImageId>
    <ExpireTime>2099-12-31T15:59Z</ExpireTime>
    <InstanceType>ecs.g6.large</InstanceType>
    <WorkMode>Application</WorkMode>
    <HostName>c0-i01-xx-t6</HostName>
    <AppList>
        <AppArgs>c:\temp.txt</AppArgs>
        <AppPath>c:\windows\system32\nodepad.exe</AppPath>
        <AppName>notepad</AppName>
    </AppList>
</Instances>
<TotalCount>1</TotalCount>
<PageSize>10</PageSize>
<RequestId>XXX-XXX</RequestId>
<PageNumber>1</PageNumber>

JSON格式

{
    "Instances": {
        "Status": "Stopped",
        "MaxBandwidthOut": 100,
        "MaxBandwidthIn": 100,
        "UserName": "user-xxx",
        "DomainName": "abc.com",
        "ClusterId": "gws-xxx",
        "InstanceId": "i-xxx",
        "InstanceChargeType": "PostPaid",
        "StoppedMode": "停止",
        "CreateTime": "2019-10-12T07:35Z",
        "IsBoundUser": true,
        "Name": "c0-i01-xx-t6-2c8g",
        "UserUid": 1234,
        "ImageId": "m-xxx",
        "ExpireTime": "2099-12-31T15:59Z",
        "InstanceType": "ecs.g6.large",
        "WorkMode": "Application",
        "HostName": "c0-i01-xx-t6",
        "AppList": {
            "AppArgs": "c:\\temp.txt",
            "AppPath": "c:\\windows\\system32\\nodepad.exe",
            "AppName": "notepad"
        }
    },
    "TotalCount": 1,
    "PageSize": 10,
    "RequestId": "XXX-XXX",
    "PageNumber": 1
}

错误码

访问错误中心查看更多错误码。