查询云办公主机包含桌面信息
功能介绍
查询云办公主机包含桌面信息,提供给console使用。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v2/{project_id}/hosts/{host_id}/servers
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID。 |
|
host_id |
是 |
String |
云办公主机id。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
否 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
servers |
Array of servers objects |
计算机列表。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
type |
String |
类型,render-desktop表示渲染桌面,wdh-desktop表示专属主机桌面。 |
|
created |
String |
创建时间。 |
|
desktop_id |
String |
桌面id。 |
|
computer_name |
String |
机器名称。 |
|
status |
String |
机器状态。 |
|
tenant_id |
String |
租户id。 |
|
updated |
String |
更新时间。 |
|
task_state |
String |
任务状态。 |
|
image_id |
String |
镜像id。 |
|
image_name |
String |
镜像名称。 |
|
vcpu |
Integer |
CPU核数。 |
|
memory |
Integer |
内存大小, 单位MB。 |
|
ip_addresses |
Array of strings |
ip地址。 |
|
availability_zone |
String |
区域。 |
|
process |
Integer |
桌面任务进度, 取值范围0-100以及null,null表示该桌面无任务,0-100表明该任务进度的百分比。 |
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码,失败时返回。 |
|
error_msg |
String |
错误描述。 |
|
error_detail |
String |
错误详情。 |
|
encoded_authorization_message |
String |
加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
状态码:401
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码,失败时返回。 |
|
error_msg |
String |
错误描述。 |
|
error_detail |
String |
错误详情。 |
|
encoded_authorization_message |
String |
加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
状态码:404
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码,失败时返回。 |
|
error_msg |
String |
错误描述。 |
|
error_detail |
String |
错误详情。 |
|
encoded_authorization_message |
String |
加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码,失败时返回。 |
|
error_msg |
String |
错误描述。 |
|
error_detail |
String |
错误详情。 |
|
encoded_authorization_message |
String |
加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
请求示例
无
响应示例
状态码:200
云办公主机下的桌面列表信息,用于跳转到具体的桌面详情。
{
"servers" : [ {
"type" : "render-desktop",
"created" : "2012-09-07T16:56:37Z",
"desktop_id" : "05184ba3-00ba-4fbc-b7a2-03b62b884931",
"computer_name" : "new-server-test",
"status" : "ACTIVE",
"tenant_id" : "openstack",
"updated" : "2012-09-07T16:56:37Z",
"task_state" : "",
"image_id" : "1ce5800a-e487-4c1b-b264-3353a39e2b4b",
"ip_addresses" : [ "172.16.112.218", "192.168.0.215" ],
"availability_zone" : "cn-north-7c"
} ]
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
云办公主机下的桌面列表信息,用于跳转到具体的桌面详情。 |
|
400 |
由于包含语法错误,当前请求无法被服务器理解。 |
|
401 |
鉴权失败。 |
|
404 |
找不到资源。 |
|
500 |
服务器内部错误。 |
错误码
请参见错误码。