文档首页/ 云桌面 Workspace/ API参考/ 云桌面API/ 连接记录/ 查询桌面登录状态 - ListInstancesStatus
更新时间:2026-01-07 GMT+08:00
分享

查询桌面登录状态 - ListInstancesStatus

功能介绍

该接口用于查询桌面登录状态。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项
  • 如果使用身份策略授权,需具备如下身份策略权限。

    授权项

    访问级别

    资源类型(*为必须)

    条件键

    别名

    依赖的授权项

    workspace:desktops:getConnectStatus

    Read

    -

    -

    -

    -

URI

GET /v2/{project_id}/connections/status

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID。

请求参数

响应参数

状态码:200

表2 响应Body参数

参数

参数类型

描述

statics

Array of InstanceStatusStatistics objects

统计信息。

表3 InstanceStatusStatistics

参数

参数类型

描述

static_name

String

统计对象名称(虚拟机组名称、桌面组名称)。

running_num

Integer

运行数目(运行中、启动中、故障迁移中、迁移中)。

stop_num

Integer

关机数目(关机中、已关机)。

hibernate_num

Integer

休眠数目(休眠中、已休眠)。

other_num

Integer

其他(未知、删除失败、删除中)。

attached_num

Integer

已分配数目。

unattached_num

Integer

未分配数目。

cannot_attach_num

Integer

不可分配数目(分配失败、解分配失败、解分配成功)。

in_process_num

Integer

处理中(分配中、解分配中)。

in_use_num

Integer

使用中数目。

unregistered_num

Integer

未注册数目。

ready_num

Integer

空闲数目。

disconnected_num

Integer

断开连接数目。

unknown_num

Integer

未知数目。

状态码:400

表4 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

error_detail

String

错误详情。

encoded_authorization_message

String

加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。

状态码:401

表5 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

error_detail

String

错误详情。

encoded_authorization_message

String

加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。

状态码:403

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

error_detail

String

错误详情。

encoded_authorization_message

String

加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。

状态码:404

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

error_detail

String

错误详情。

encoded_authorization_message

String

加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。

状态码:500

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

error_detail

String

错误详情。

encoded_authorization_message

String

加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。

请求示例

GET /v2/0bec5db98280d2d02fd6c00c2de791ce/connections/status

响应示例

状态码:200

查询计算机登录状态响应。

{
  "statics" : [ {
    "static_name" : "string",
    "running_num" : 2147483647,
    "stop_num" : 2147483647,
    "hibernate_num" : 2147483647,
    "other_num" : 2147483647,
    "attached_num" : 2147483647,
    "unattached_num" : 2147483647,
    "cannot_attach_num" : 2147483647,
    "in_process_num" : 2147483647,
    "in_use_num" : 2147483647,
    "unregistered_num" : 2147483647,
    "ready_num" : 2147483647,
    "disconnected_num" : 2147483647,
    "unknown_num" : 2147483647
  } ]
}

状态码

状态码

描述

200

查询计算机登录状态响应。

400

由于包含语法错误,当前请求无法被服务器理解。

401

鉴权失败。

403

没有操作权限。

404

找不到资源。

500

服务内部错误,具体返回错误码请参见错误码说明。

错误码

请参见错误码

相关文档