
# 批量查询桌面网络 - ShowDesktopNetworks
#### 功能介绍
查询桌面vpc、子网、privateIp、EIP、安全组。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/Workspace/doc?api=ShowDesktopNetworks)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-workspace/workspace_09_0128.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                                    | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  |:---|:---|:---|:---|:---|:---|
  | workspace:desktops:listDesktopNetworks | List | desktop \*  | -   | -  | - vpc:vpcs:get  - vpc:subnets:get  - vpc:networks:get  - vpc:ports:get  - vpc:securityGroups:get  - eip:publicIps:list   |
     
  
 
#### URI
GET /v2/{project_id}/desktops/networks
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID。 |
   
表2Query参数 
| 参数          | 是否必选 | 参数类型             | 描述                  |
|:---|:---|:---|:---|
| desktop_ids | 否    | Array of strings | 桌面id列表，最小为1，最大为100。 |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数       | 参数类型                                                                                         | 描述        |
|:---|:---|:---|
| networks | Array of [DesktopNetworkResult] objects | 桌面网络信息列表。 |
   
 表4DesktopNetworkResult 
| 参数            | 参数类型                                                                       | 描述      |
|:---|:---|:---|
| computer_name | String                                                                     | 桌面名称。   |
| computer_id   | String                                                                     | 桌面ID。   |
| computer_ip   | String                                                                     | 桌面IP。   |
| network_infos | Array of [NetworkInfo] objects | 桌面网络信息。 |
   
 表5NetworkInfo 
| 参数              | 参数类型                                                                                   | 描述          |
|:---|:---|:---|
| vpc_info        | [Vpc] object                                       | vpc信息。      |
| subnet_info     | [DesktopSubnet] object                   | 子网信息。       |
| port_info       | [Port] object                                     | 私有IP信息。     |
| public_ip_info  | [PublicIp] object                             | 弹性IP信息。     |
| security_groups | Array of [SecurityGroupInfo] objects | 桌面绑定的安全组列表。 |
   
 表6Vpc 
| 参数   | 参数类型   | 描述         |
|:---|:---|:---|
| id   | String | 桌面所在vpcId。 |
| name | String | 桌面所在vpc名称。 |
| cidr | String | 桌面所在vpc网段。 |
   
 表7DesktopSubnet 
| 参数   | 参数类型   | 描述        |
|:---|:---|:---|
| id   | String | 桌面所在子网Id。 |
| name | String | 桌面所在子网名称。 |
| cidr | String | 桌面所在子网网段。 |
   
 表8Port 
| 参数         | 参数类型   | 描述        |
|:---|:---|:---|
| id         | String | 私有IP唯一标识。 |
| ip_address | String | 私有IP地址。   |
   
 表9PublicIp 
| 参数                | 参数类型   | 描述        |
|:---|:---|:---|
| id                | String | 弹性IP唯一标识。 |
| public_ip_address | String | 弹性IP地址。   |
   
 表10SecurityGroupInfo 
| 参数   | 参数类型   | 描述     |
|:---|:---|:---|
| id   | String | 安全组ID。 |
| name | String | 安全组名称。 |
   
**状态码：400**
表11响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：401**
表12响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：403**
表13响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：404**
表14响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：409**
表15响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：500**
表16响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
正常。
```
{
  "networks" : [ {
    "computer_name" : "string",
    "computer_id" : "string",
    "computer_ip" : "string",
    "network_infos" : [ {
      "vpc_info" : {
        "id" : "string",
        "name" : "string",
        "cidr" : "string"
      },
      "subnet_info" : {
        "id" : "string",
        "name" : "string",
        "cidr" : "string"
      },
      "port_info" : {
        "id" : "string",
        "ip_address" : "string"
      },
      "public_ip_info" : {
        "id" : "string",
        "public_ip_address" : "string"
      },
      "security_groups" : [ {
        "id" : "string",
        "name" : "string"
      } ]
    } ]
  } ]
}
```
#### 状态码
| 状态码 | 描述                      |
|:---|:---|
| 200 | 正常。                     |
| 400 | 由于包含语法错误，当前请求无法被服务器理解。  |
| 401 | 鉴权失败。                   |
| 403 | 没有操作权限。                 |
| 404 | 找不到资源。                  |
| 409 | 操作冲突。                   |
| 500 | 服务内部错误，具体返回错误码请参见错误码说明。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-workspace/ErrorCode.html)。
