
# 批量包周期桌面切换镜像询价 - EstimateChangeImages
#### 功能介绍
批量包周期桌面切换镜像(由不收费镜像变更至收费镜像)询价。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/Workspace/doc?api=EstimateChangeImages)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-workspace/workspace_09_0128.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                           | 访问级别  | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项          |
  |:---|:---|:---|:---|:---|:---|
  | workspace:orders:batchInquiry | Write | -           | -   | -  | ims:images:list |
     
  
 
#### URI
POST /v2/{project_id}/periodic/inquiry/change-image
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID。 |
   
#### 请求参数
表2请求Body参数 
| 参数                | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|:---|
| desktop_pool_id   | 否    | String           | 桌面池ID。当desktop_pool_id与desktop_ids同时存在时，取desktop_ids的值，两者不可同时为空。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| desktop_ids       | 否    | Array of strings | 包周期桌面ID列表。 不可同时存在普通桌面和池桌面ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| promotion_plan_id | 否    | String           | 促销计划ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| handle_type       | 否    | String           | 处理类型 - ONLY_FOR_EXPAND：仅对新扩容桌面生效   - FOR_EXPAND_AND_IDLE：对新扩容桌面与空闲桌面生效   - FOR_EXPAND_AND_ALL：对新扩容桌面与已有全部桌面生效    |
| image_spec_code   | 否    | String           | 云市场镜像的specCode，即将停用。image_spec_code与image_id同时存在时取image_id的值，两者不可同时为空。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| image_id          | 否    | String           | 云市场镜像ID，建议使用image_id。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| image_type        | 否    | String           | 镜像类型。仅重建系统盘/更换镜像使用 - private：私有镜像。   - gold：公共镜像。                                                                                                                                                                                                          |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                           | 参数类型                                                                                                  | 描述        |
|:---|:---|:---|
| currency                     | String                                                                                                | 币种，比如CNY。 |
| cloud_service_rating_results | Array of [CloudServiceRatingResult] objects | 询价结果。     |
   
 表4CloudServiceRatingResult 
| 参数                               | 参数类型                                                                                                          | 描述                     |
|:---|:---|:---|
| order_request_id                 | String                                                                                                        | 下单请求体中的orderRequestId。 |
| official_website_rating_result   | [OfficialWebsiteRatingResult] object             | 结果。                    |
| optional_discount_rating_results | Array of [OptionalDiscountRatingResult] objects | 优惠询价结果。                |
   
 表5OfficialWebsiteRatingResult 
| 参数                               | 参数类型                                                                            | 描述                                                            |
|:---|:---|:---|
| amount                           | Number                                                                          | 订单总额，即最终优惠后的订单金额(预留实例只包含预付部分)。                                |
| official_website_amount          | Number                                                                          | 官网价(预留实例只包含预付部分)。                                             |
| original_amount                  | Number                                                                          | 订单原总额，即优惠前订单总额(预留实例只包含预付部分)。                                  |
| official_website_discount_amount | Number                                                                          | 官网价优惠额(预留实例只包含预付部分)。                                          |
| optional_discount_amount         | Number                                                                          | 可选折扣优惠额(预留实例只包含预付部分)。                                         |
| discount_amount                  | Number                                                                          | 总优惠额(预留实例只包含预付部分)。                                            |
| per_amount                       | Number                                                                          | 总分期金额(批量询价的商品分期周期类型一致，才会有总分期金额，分期周期类型不一致，该信息没有)。              |
| per_discount_amount              | Number                                                                          | 总分期金额的优惠额(perDiscountAmount = perOriginalAmount - perAmount)。 |
| per_original_amount              | Number                                                                          | 总分期金额原价。                                                      |
| per_period_type                  | Integer                                                                         | 分期周期类型 2:月 4:小时。                                              |
| measure_id                       | Integer                                                                         | 度量单位。                                                         |
| product_rating_results           | Array of [ProductResult] objects | 产品询价结果。                                                       |
   
 表6OptionalDiscountRatingResult 
| 参数                                   | 参数类型                                                                            | 描述                                                                                                                                                      |
|:---|:---|:---|
| discount_id                          | String                                                                          | 折扣优惠Id。                                                                                                                                                 |
| amount                               | Number                                                                          | 订单总额，即最终优惠后的订单金额(预留实例只包含预付部分)。                                                                                                                          |
| official_website_amount              | Number                                                                          | 官网价(预留实例只包含预付部分)。                                                                                                                                       |
| original_amount                      | Number                                                                          | 订单原总额，即优惠前订单总额(预留实例只包含预付部分)。                                                                                                                            |
| official_website_discount_amount     | Number                                                                          | 官网价优惠额(预留实例只包含预付部分)。                                                                                                                                    |
| optional_discount_amount             | Number                                                                          | 可选折扣优惠额(预留实例只包含预付部分)。                                                                                                                                   |
| discount_amount                      | Number                                                                          | 总优惠额(预留实例只包含预付部分)。                                                                                                                                      |
| per_amount                           | Number                                                                          | 总分期金额(批量询价的商品分期周期类型一致，才会有总分期金额，分期周期类型不一致，该信息没有)。                                                                                                        |
| per_discount_amount                  | Number                                                                          | 总分期金额的优惠额(perDiscountAmount = perOriginalAmount - perAmount)。                                                                                           |
| per_original_amount                  | Number                                                                          | 总分期金额原价。                                                                                                                                                |
| per_official_website_amount          | Number                                                                          | 总分期金额的官网价(批量询价的商品分期周期类型一致，才会有总分期金额的官网价，分期周期类型不一致，该信息没有)。                                                                                                |
| per_official_website_discount_amount | Number                                                                          | 总分期金额的官网价官网价优惠额，即： perOfficialWebsiteDiscountAmount =perOriginalAmount-perOfficialWebsiteAmount (批量询价的商品分期周期类型一致，才会有总分期金额的官网价，分期周期类型不一致，该信息没有)。         |
| per_optional_discount_amount         | Number                                                                          | 总分期金额的可选折扣优惠额，如商务折扣、伙伴折扣、促销折扣和折扣券选用时的优惠额 perOptionalDiscountAmount= perOfficialWebsiteAmount- perAmount (批量询价的商品分期周期类型一致，才会有总分期金额的官网价，分期周期类型不一致，该信息没有)。 |
| per_period_type                      | Integer                                                                         | 分期周期类型 2:月 4:小时。                                                                                                                                        |
| measure_id                           | Integer                                                                         | 度量单位。                                                                                                                                                   |
| discount_type                        | Integer                                                                         | 折扣优惠类型。                                                                                                                                                 |
| discount_name                        | String                                                                          | 折扣名称。                                                                                                                                                   |
| best_offer                           | Integer                                                                         | 是否为最优折扣0：不是最优折扣；为缺省值。1：是最优折扣；最优折扣：在商务折扣、伙伴折扣和促销折扣中选择（优惠金额相等则按此顺序排优先级），折扣券不参与最优折扣的计算。                                                                    |
| same_ratio_flag                      | Integer                                                                         | sameRatioFlag。                                                                                                                                          |
| discount_ratio                       | Number                                                                          | sameRatioFlag为1时有值，表示该折扣的折扣率。                                                                                                                           |
| promotion_info                       | String                                                                          | 折扣优惠基本信息；调用者在确定好折扣优惠后、下单时，使用此字段值，填入到订购/变更接口中的promotionInfo字段。                                                                                           |
| product_rating_results               | Array of [ProductResult] objects | 产品询价结果。                                                                                                                                                 |
   
 表7ProductResult 
| 参数                                   | 参数类型    | 描述                                                                                                      |
|:---|:---|:---|
| id                                   | String  | 对应请求体中的ID。                                                                                              |
| product_id                           | String  | 产品ID。                                                                                                   |
| amount                               | Number  | 总额，即最终优惠后的金额(预留实例只包含预付部分)。                                                                              |
| discount_amount                      | Number  | 优惠额(预留实例只包含预付部分)。                                                                                       |
| original_amount                      | Number  | 原总额，即优惠前总额(预留实例只包含预付部分)。                                                                                |
| official_website_amount              | Number  | 官网价（非所有接口有该字段）(预留实例只包含预付部分)。                                                                            |
| official_website_discount_amount     | Number  | 官网价优惠额（非所有接口有该字段）(预留实例只包含预付部分)。                                                                         |
| optional_discount_amount             | Number  | 可选折扣优惠额(预留实例只包含预付部分)，如商务折扣、伙伴折扣、促销折扣和折扣券选用时的优惠额（非所有接口有该字段）。                                             |
| per_amount                           | Number  | 总分期金额(批量询价的商品分期周期类型一致，才会有总分期金额，分期周期类型不一致，该信息没有)。                                                        |
| per_discount_amount                  | Number  | 总分期金额的优惠额(perDiscountAmount = perOriginalAmount - perAmount)。                                           |
| per_original_amount                  | Number  | 总分期金额原价。                                                                                                |
| per_official_website_amount          | Number  | 分期金额的官网价。                                                                                               |
| per_official_website_discount_amount | Number  | 分期金额的官网价官网价优惠额，即：perOfficialWebsiteDiscountAmount =perOriginalAmount-perOfficialWebsiteAmount。          |
| per_optional_discount_amount         | Number  | 分期金额的可选折扣优惠额，如商务折扣、伙伴折扣、促销折扣和折扣券选用时的优惠额 perOptionalDiscountAmount= perOfficialWebsiteAmount- perAmount。 |
| per_period_type                      | Integer | 分期周期类型 2:月 4:小时。                                                                                        |
| measure_id                           | Integer | 度量单位。                                                                                                   |
| extend_params                        | String  | 扩展参数。                                                                                                   |
   
**状态码：400**
表8响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：409**
表9响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：500**
表10响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码，失败时返回。                                                   |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
#### 请求示例
```
{
  "desktop_pool_id" : "string",
  "desktop_ids" : [ "string" ],
  "promotion_plan_id" : "string",
  "image_spec_code" : "string",
  "image_id" : "string"
}
```
#### 响应示例
**状态码：200**
包周期桌面池批量询价响应体。
```
{
  "currency" : "string",
  "cloud_service_rating_results" : [ {
    "order_request_id" : "string",
    "official_website_rating_result" : {
      "amount" : 0,
      "official_website_amount" : 0,
      "original_amount" : 0,
      "official_website_discount_amount" : 0,
      "optional_discount_amount" : 0,
      "discount_amount" : 0,
      "per_amount" : 0,
      "per_discount_amount" : 0,
      "per_original_amount" : 0,
      "per_period_type" : 0,
      "measure_id" : 0,
      "product_rating_results" : [ {
        "id" : "string",
        "product_id" : "string",
        "amount" : 0,
        "discount_amount" : 0,
        "original_amount" : 0,
        "official_website_amount" : 0,
        "official_website_discount_amount" : 0,
        "optional_discount_amount" : 0,
        "per_amount" : 0,
        "per_discount_amount" : 0,
        "per_original_amount" : 0,
        "per_official_website_amount" : 0,
        "per_official_website_discount_amount" : 0,
        "per_optional_discount_amount" : 0,
        "per_period_type" : 0,
        "measure_id" : 0,
        "extend_params" : "string"
      } ]
    },
    "optional_discount_rating_results" : [ {
      "discount_id" : "string",
      "amount" : 0,
      "official_website_amount" : 0,
      "original_amount" : 0,
      "official_website_discount_amount" : 0,
      "optional_discount_amount" : 0,
      "discount_amount" : 0,
      "per_amount" : 0,
      "per_discount_amount" : 0,
      "per_original_amount" : 0,
      "per_official_website_amount" : 0,
      "per_official_website_discount_amount" : 0,
      "per_optional_discount_amount" : 0,
      "per_period_type" : 0,
      "measure_id" : 0,
      "discount_type" : 0,
      "discount_name" : "string",
      "best_offer" : 0,
      "same_ratio_flag" : 0,
      "discount_ratio" : 0,
      "promotion_info" : "string",
      "product_rating_results" : [ {
        "id" : "string",
        "product_id" : "string",
        "amount" : 0,
        "discount_amount" : 0,
        "original_amount" : 0,
        "official_website_amount" : 0,
        "official_website_discount_amount" : 0,
        "optional_discount_amount" : 0,
        "per_amount" : 0,
        "per_discount_amount" : 0,
        "per_original_amount" : 0,
        "per_official_website_amount" : 0,
        "per_official_website_discount_amount" : 0,
        "per_optional_discount_amount" : 0,
        "per_period_type" : 0,
        "measure_id" : 0,
        "extend_params" : "string"
      } ]
    } ]
  } ]
}
```
#### 状态码
| 状态码 | 描述                     |
|:---|:---|
| 200 | 包周期桌面池批量询价响应体。         |
| 400 | 由于包含语法错误，当前请求无法被服务器理解。 |
| 409 | 操作冲突。                  |
| 500 | 服务器内部错误。               |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-workspace/ErrorCode.html)。
