
# 批量检查加域 - BatchCheckDesktopRejoinDomain
#### 功能介绍
该接口用于批量检查桌面是否支持重新加入AD域。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/Workspace/doc?api=BatchCheckDesktopRejoinDomain)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-workspace/workspace_09_0128.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                                       | 访问级别  | 资源类型（\*为必须） | 条件键                                                                                                                                                                                                                                                                                                                                                                                                                                               | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | workspace:desktops:batchCheckRejoinDomain | Write | desktop \*  | - g:ResourceTag/\<tag-key\>   - g:EnterpriseProjectId    | -  | -      |
     
  
 
#### URI
POST /v2/{project_id}/desktops/batch-rejoin-domain/check
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID。 |
   
#### 请求参数
表2请求Body参数 
| 参数          | 是否必选 | 参数类型             | 描述      |
|:---|:---|:---|:---|
| desktop_ids | 是    | Array of strings | 桌面ID列表。 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数          | 参数类型                                                                                                                   | 描述      |
|:---|:---|:---|
| total_count | Integer                                                                                                                | 检查总数。   |
| desktops    | Array of [BatchCheckRejoinDomainResult] objects | 检查结果列表。 |
   
 表4BatchCheckRejoinDomainResult 
| 参数            | 参数类型                                                                       | 描述                                                                                                                                                                             |
|:---|:---|:---|
| desktop_id    | String                                                                     | 桌面ID。                                                                                                                                                                          |
| desktop_name  | String                                                                     | 桌面名称。                                                                                                                                                                          |
| image_name    | String                                                                     | 镜像名称。                                                                                                                                                                          |
| domain_status | Integer                                                                    | 加域状态。\|- 1 正常。 2 脱域。 3 未上报。 |
| rejoin_able   | Boolean                                                                    | 是否可以加域。                                                                                                                                                                        |
| product       | [ProductInfo] object | 产品信息。                                                                                                                                                                          |
| error_code    | String                                                                     | 错误码。                                                                                                                                                                           |
| error_msg     | 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代表下线。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   
**状态码：400**
表6响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：401**
表7响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：403**
表8响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：404**
表9响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：409**
表10响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：500**
表11响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
#### 请求示例
```
POST /v2/29dfe82ada564ac2b927e1ff036d9a9b/desktops/batch-rejoin-domain/check
{
  "desktop_ids" : [ "acbxxx0695-4b5c-a9a2-8xxxxd7f4998", "acbxxx0695-4b5c-a9a2-8xxxxd7f4999" ]
}
```
#### 响应示例
**状态码：200**
正常。
```
{
  "total_count" : 100,
  "desktops" : [ {
    "desktop_id" : "acbxxx0695-4b5c-a9a2-8xxxxd7f4999",
    "desktop_name" : "test-desktop2",
    "image_name" : "test-image2",
    "domain_status" : 2,
    "rejoin_able" : true,
    "error_code" : "XXXX",
    "error_msg" : "xxxx"
  } ]
}
```
#### 状态码
| 状态码 | 描述                      |
|:---|:---|
| 200 | 正常。                     |
| 400 | 由于包含语法错误，当前请求无法被服务器理解。  |
| 401 | 鉴权失败。                   |
| 403 | 没有操作权限。                 |
| 404 | 找不到资源。                  |
| 409 | 操作冲突。                   |
| 500 | 服务内部错误，具体返回错误码请参见错误码说明。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-workspace/ErrorCode.html)。
