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