
# 查询桌面池列表 - ListDesktopPools
#### 功能介绍
该接口用于查询桌面池列表。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/Workspace/doc?api=ListDesktopPools)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-workspace/workspace_09_0128.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                         | 访问级别 | 资源类型（\*为必须）    | 条件键 | 别名 | 依赖的授权项                                                                                                                                                                                                                         |
  |:---|:---|:---|:---|:---|:---|
  | workspace:desktopPools:list | List | desktopPool \* | -   | -  | - ims:images:list  - workspace:sites:get   |
     
  
 
#### URI
GET /v2/{project_id}/desktop-pools
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID。 |
   
表2Query参数 
| 参数                    | 是否必选 | 参数类型    | 描述                            |
|:---|:---|:---|:---|
| name                  | 否    | String  | 桌面池名称。                        |
| type                  | 否    | String  | 桌面池类型，DYNAMIC：动态池，STATIC：静态池。 |
| enterprise_project_id | 否    | String  | 企业项目ID。                       |
| offset                | 否    | Integer | 用于分页查询，查询的起始记录序号，从0开始。        |
| limit                 | 否    | Integer | 用于分页查询，取值范围0-1000，默认值1000。    |
| in_maintenance_mode   | 否    | Boolean | 按照维护状态过滤。                     |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数            | 参数类型                                                                                        | 描述     |
|:---|:---|:---|
| total_count   | Integer                                                                                     | 总数。    |
| desktop_pools | Array of [SimpleDesktopPoolInfo] objects | 桌面池信息。 |
   
 表4SimpleDesktopPoolInfo 
| 参数                            | 参数类型                                                                                | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|:---|:---|:---|
| id                            | String                                                                              | 桌面池ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| name                          | String                                                                              | 桌面池名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| type                          | String                                                                              | 桌面池类型。DYNAMIC：动态池，STATIC：静态池。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| description                   | String                                                                              | 桌面池描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| created_time                  | String                                                                              | 创建时间，格式为：UTC格式，例如"2022-05-11T11:45:42.000Z"。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| charging_mode                 | String                                                                              | 计费模式，0：包周期，1：按需。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| desktop_count                 | Integer                                                                             | 桌面池总桌面数量。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| desktop_used                  | Integer                                                                             | 桌面池绑定用户的桌面个数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| availability_zone             | String                                                                              | 可用区。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| subnet_id                     | String                                                                              | 子网ID（已废弃，多个仅取第一个）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| subnet_ids                    | Array of strings                                                                    | 桌面池子网ID列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| product                       | [ProductInfo] object                       | 产品信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| image_id                      | String                                                                              | 镜像ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| image_name                    | String                                                                              | 镜像名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| image_os_type                 | String                                                                              | 镜像OS类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| image_os_version              | String                                                                              | 镜像OS版本。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| image_os_platform             | String                                                                              | 镜像OS平台。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| image_product_code            | String                                                                              | 镜像的productCode（specCode）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| image_cloud_service_type      | String                                                                              | 镜像的cloudServiceType                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| image_resource_type           | String                                                                              | 镜像的resourceType。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| root_volume                   | [VolumeInfo] object                         | 系统盘。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| data_volumes                  | Array of [VolumeInfo] objects               | 数据盘列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| security_groups               | Array of [SecurityGroupInfo] objects | 桌面安全组。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| disconnected_retention_period | Integer                                                                             | 动态池桌面断连多少分钟内，保留用户与桌面的绑定关系，超时后自动解绑。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| enable_autoscale              | Boolean                                                                             | 桌面池是否开启弹性伸缩类型，为false则表示不开启弹性伸缩，为true则表示开启弹性伸缩。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| autoscale_policy              | [AutoscalePolicy] object               | 弹性伸缩策略。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| user_reset_policy             | [UserResetPolicy] object               | 用户重置策略。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| status                        | String                                                                              | 桌面池状态。 - STEADY：稳态   - TEMPORARY：临时态   - EXIST_FROZEN：存在冻结桌面   - UNKNOWN：未知态    |
| enterprise_project_id         | String                                                                              | 企业项目ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| in_maintenance_mode           | Boolean                                                                             | 桌面池是否处于管理员维护模式。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| desktop_name_policy_id        | String                                                                              | 策略id，用于指定生成桌面名称策略。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| tags                          | Array of [Tag] objects                             | 标签列表                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ou_name                       | String                                                                              | OU名称                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| vpc_id                        | String                                                                              | VPC ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| isolation_num                 | Integer                                                                             | 统计无法连接桌面数量。适用于桌面池详情查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| domain                        | String                                                                              | 桌面池分配的域。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表5ProductInfo 
| 参数                  | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|
| product_id          | String  | 产品ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| flavor_id           | String  | 产品规格ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| type                | String  | 产品类型。 - BASE：表示产品基础套餐，套餐镜像中不包括除操作系统之外的其他商业软件，私有镜像场景只能使用此类套餐。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| cpu                 | String  | CPU。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| memory              | String  | 内存。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| descriptions        | String  | 产品描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| charge_mode         | String  | 周期套餐标识，0表示包周期，1表示按需。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| architecture        | String  | 产品架构。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| is_gpu              | Boolean | 是否是GPU类型的规格。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| package_type        | String  | 套餐类型。 - ultimate：尊享版   - enterprise：企业版   - general: 通用办公版   - workstation: 云工作站   - dedicated: 专属办公版   - solver: 解算版   - agile: 敏捷办公版    |
| system_disk_type    | String  | 系统盘类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| system_disk_size    | String  | 系统盘大小。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| contain_data_disk   | Boolean | 套餐计费是否包含了数据盘,off-不包含。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| resource_type       | String  | 资源类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| cloud_service_type  | String  | 云服务类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| volume_product_type | String  | 磁盘产品类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| status              | String  | 默认在售状态，normal代表正常，sellout代表售空，abandon代表下线。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   
 表6VolumeInfo 
| 参数                 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| id                 | String  | 批量操作磁盘的磁盘集合id。                                                                                                                                                                                                                                                                                                                                                                                 |
| type               | String  | 桌面数据盘对应的磁盘类型，需要与系统所提供的磁盘类型相匹配。 - SAS：高IO。   - SSD：超高IO。    |
| size               | Integer | 磁盘容量，单位GB。                                                                                                                                                                                                                                                                                                                                                                                     |
| iops               | Integer | iops，云硬盘每秒进行读写的操作次数。                                                                                                                                                                                                                                                                                                                                                                           |
| throughput         | Integer | 吞吐量，云硬盘每秒成功传送的数据量，即读取和写入的数据量。                                                                                                                                                                                                                                                                                                                                                                  |
| resource_spec_code | String  | 规格。                                                                                                                                                                                                                                                                                                                                                                                            |
| kms_id             | String  | kms密钥Id                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表7SecurityGroupInfo 
| 参数   | 参数类型   | 描述     |
|:---|:---|:---|
| id   | String | 安全组ID。 |
| name | String | 安全组名称。 |
   
 表8AutoscalePolicy 
| 参数                      | 参数类型    | 描述                                             |
|:---|:---|:---|
| autoscale_type          | String  | 弹性伸缩类型，ACCESS_CREATED：接入时创建，AUTO_CREATED：弹性伸缩。 |
| max_auto_created        | Integer | 最大自动创建桌面数。                                     |
| min_idle                | Integer | 预留空闲桌面数。                                       |
| once_auto_created       | Integer | 一次自动创建桌面的数量(已弃用)。                              |
| min_retention           | Integer | 最小桌面数。                                         |
| idle_retention_duration | Integer | 空闲桌面保留时长（分钟）。                                  |
| auto_isolation_enable   | Boolean | 自动故障隔离开关。                                      |
| auto_isolation_max_num  | Integer | 自动隔离桌面数量上限，默认上限1000。                           |
   
 表9UserResetPolicy 
| 参数                  | 参数类型    | 描述                     |
|:---|:---|:---|
| enable              | Boolean | 开关                     |
| reset_count_per_day | Integer | 用户每天自动重试次数,重置次数每天0点刷新。 |
   
 表10Tag 
| 参数    | 参数类型   | 描述                                                                                                   |
|:---|:---|:---|
| key   | String | 标签的键，不能为空，最大长度128个unicode字符。大小写字母，数字，可以包含中划线"-"，下划线"_"，不能包含以下字符"=","\*","\<","\>","\\",",","\|","/"。 |
| value | String | 标签的值，最大长度43个unicode字符。大小写字母，数字，可以包含中划线"-"，下划线"_"，不能包含以下字符"=","\*","\<","\>","\\",",","\|","/"。       |
   
**状态码：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接口进行解密。 |
   
**状态码：500**
表15响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
#### 请求示例
```
GET /v2/bcae3e673fd04716a3b9dacdf58ca336/desktop-pools
```
#### 响应示例
**状态码：200**
查询桌面池列表响应。
```
{
  "total_count" : 2,
  "desktop_pools" : [ {
    "id" : "ca689892-25f2-4c68-88cb-56be3565f3f5",
    "name" : "POOL1",
    "type" : "STATIC",
    "description" : "",
    "created_time" : "2023-01-04T07:10:56.696Z",
    "charging_mode" : "1",
    "desktop_count" : 1,
    "desktop_used" : 0,
    "availability_zone" : "cn-north-4a",
    "subnet_id" : "6bf585f4-5ccf-4e50-93a4-1b1069ed53c3",
    "subnet_ids" : [ "6bf585f4-5ccf-4e50-93a4-1b1069ed53c3" ],
    "product" : {
      "product_id" : "workspace.x86.ultimate.large2",
      "flavor_id" : "s6.large.2",
      "type" : "BASE",
      "cpu" : "2",
      "memory" : "4096",
      "descriptions" : "尊享办公|2核|4GB内存。",
      "charge_mode" : "1",
      "architecture" : "x86",
      "is_gpu" : false,
      "package_type" : "ultimate",
      "system_disk_type" : "SAS",
      "system_disk_size" : "80",
      "contain_data_disk" : false,
      "resource_type" : "hws.resource.type.workspace.desktop",
      "cloud_service_type" : "hws.service.type.vdi",
      "volume_product_type" : "workspace",
      "status" : "normal"
    },
    "image_id" : "97575518-50c9-45f1-85a1-884c6efeaec2",
    "image_name" : "WKS_WIN1064_UserImage",
    "image_os_type" : "Windows",
    "image_os_version" : "Windows 10 64bit",
    "image_os_platform" : "Windows",
    "root_volume" : {
      "id" : "ce665b9f-1dd3-4698-893c-08e9b8f70ac5",
      "type" : "SAS",
      "size" : 80
    },
    "data_volumes" : [ {
      "id" : "1ac3c662-1c97-4309-abbf-cca3db9f05e2",
      "type" : "SAS",
      "size" : 10
    } ],
    "tags" : [ ],
    "ou_name" : "",
    "vpc_id" : "fe30128b-9184-4b05-9395-b3dedb1a1d41"
  }, {
    "id" : "2c2be3fb-0013-48d5-a081-0731f3473997",
    "name" : "POOL2",
    "type" : "DEDICATED",
    "created_time" : "2023-01-04T07:10:53.554Z",
    "charging_mode" : "0",
    "desktop_count" : 2,
    "desktop_used" : 1,
    "availability_zone" : "cn-north-4a",
    "subnet_id" : "w9iks7f4-5ccf-4e50-93a4-1b10w9k853c3",
    "subnet_ids" : [ "w9iks7f4-5ccf-4e50-93a4-1b10w9k853c3", "27uw8k94-109l-w9sm-77s9-20wlw9k8009j" ],
    "product" : {
      "product_id" : "workspace.x86.ultimate.large2",
      "flavor_id" : "s6.large.2",
      "type" : "BASE",
      "cpu" : "2",
      "memory" : "4096",
      "descriptions" : "尊享办公|2核|4GB内存。",
      "charge_mode" : "1",
      "architecture" : "x86",
      "is_gpu" : false,
      "package_type" : "ultimate",
      "system_disk_type" : "SAS",
      "system_disk_size" : "80",
      "contain_data_disk" : false,
      "resource_type" : "hws.resource.type.workspace.desktop",
      "cloud_service_type" : "hws.service.type.vdi",
      "volume_product_type" : "workspace",
      "status" : "normal",
      "sub_product_list" : [ ]
    },
    "root_volume" : {
      "id" : "lmo05b9f-28ok-4698-893c-9s0ij8f70ac5",
      "type" : "SAS",
      "size" : 80
    },
    "data_volumes" : [ {
      "id" : "7wka9662-1c97-4309-ab0f-cca3db9f05e2",
      "type" : "SAS",
      "size" : 80
    }, {
      "id" : "1ac3c662-9si8-4309-9wkp-cca3db9f2jwl",
      "type" : "SAS",
      "size" : 80
    } ],
    "tags" : [ {
      "key" : "test",
      "value" : "testValue"
    } ],
    "ou_name" : "ouName",
    "vpc_id" : "w7shb382-9184-w8ub-9395-126hw71a1d41"
  } ]
}
```
#### 状态码
| 状态码 | 描述                      |
|:---|:---|
| 200 | 查询桌面池列表响应。              |
| 400 | 由于包含语法错误，当前请求无法被服务器理解。  |
| 401 | 鉴权失败。                   |
| 403 | 没有操作权限。                 |
| 404 | 找不到资源。                  |
| 500 | 服务内部错误，具体返回错误码请参见错误码说明。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-workspace/ErrorCode.html)。
