# 询价 (/products/qvm/order/3-make-an-inquiry)



最近更新时间: 2021-06-03 11:32:18

# 请求路径 [#请求路径]

> `POST` /v1/cm/price

# 请求参数 [#请求参数]

| 名称     | 类型         | 位置   | 必须 | 描述 |
| ------ | ---------- | ---- | -- | -- |
| infos  | Enquiry\[] | body | 是  |    |
| 询价请求列表 |            |      |    |    |

|

### Enquiry [#enquiry]

| 名称                                       | 类型     | 描述 |
| ---------------------------------------- | ------ | -- |
| region\_id                               | string |    |
| 地域 ID。您可以调用 DescribeRegions 查看最新的七牛云地域列表 |        |    |

|
\| cost\_charge\_type | string | 付费方式:

* PostPaid: 按需计费 - PrePaid: 预付费

|
\| cost\_charge\_mode | string | 计费方式

* PayByBandwidth: 按照带宽计费 - PayByTraffic: 按照流量计费 - PayByDisk: 按磁盘使用计费 - PayByInstance: 按主机规格使用计费 - PayBySlbSpec: 按 SLB 实例规格计费 - PayByRedis: 按 Redis 实例规格计费 - PayByMongo: 按 Mongo 实例规格计费 - PayByVRouterInterface: 按 VRouterInterface 实例规格计费 - PayBy95: 按增强型95计费 - PayByRds: 按 RDS 实例规格计费 - PayByVpn: 按 vpn 规格计费 - PayByNATGatewaySpec: 按 高速通道 规格计费 - PayByNewBgpIp: 安全产品新BGP - PayByBgpIp: 安全产品高防 - PayByWaf: 安全产品WAF - PayByPolarDB: 按 PolarDB 节点规格计费

|
\| cost\_period\_unit | string | 计费单位
Hour, Day, Week, Month, Year |
\| cost\_period | integer | 计费周期 |
\| cost\_period | integer | 计费周期 |
\| order\_type | string | 订单类型

* create: 新建 - renew: 续费 - upgrade: 升配 - replace\_system\_disk: 更换系统盘 - to\_prepaid\_disk: 按需磁盘转包月 - renew\_with\_spec: 续费变配

|
\| amount | integer | 数量 |
\| info\_items | EnquiryItem\[] |  |

### EnquiryItem [#enquiryitem]

| 名称             | 类型     | 描述   |
| -------------- | ------ | ---- |
| resource\_type | string | 资源类型 |

* instance: 主机 - disk: 磁盘 - ip: 弹性公网IP - snapshot: 快照 - common\_bandwidth：共享带宽

|
\| resource\_id | string | 资源 ID，升配询价时必填 |
\| expire\_time | int64 | 过期时间，unix时间戳，升配询价时必填 |
\| item\_info | EnquiryItemInfo | 资源价格相关参数
"ratio": 20 ，共享带宽 增强型95 必填 |

## 请求 Body 示例 [#请求-body-示例]

```
{
  "infos": [
    {
      "region_id": "cn-shanghai",
      "order_type": "create",
      "amount": 1,
      "cost_period_unit": "Day",
      "cost_period": 1,
      "cost_charge_type": "PostPaid",
      "cost_charge_mode": "PayBy95",
      "info_items": [
        {
          "resource_type": "common_bandwidth",
          "item_info": {
            "bandwidth": 200,
            "ratio": 20
          }
        }
      ]
    }
  ]
}
```

### 主机 EnquiryItemInfo [#主机-enquiryiteminfo]

| 名称             | 类型     | 描述                                                                                                                                                                                       |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| instance\_type | string | 实例规格，您可以通过以下接口查询 \[实例/查看实例规格详情列表]\(/products/qvm/openapi-ecs/4-openapi-ecs-describe-instance-type) \[实例/查看可用资源列表]\(/products/qvm/openapi-ecs/5-openapi-ecs-describe-available-resources) |

### 云硬盘 EnquiryItemInfo [#云硬盘-enquiryiteminfo]

| 名称       | 类型  | 描述         |
| -------- | --- | ---------- |
| size     | int | 云盘大小，单位 GB |
| category | int |            |
| 云盘种类     |     |            |

资源池一取值范围：

* cloud：普通云盘 - cloud\_efficiency：高效云盘 - cloud\_ssd：SSD 云盘 - cloud\_essd：ESSD 云盘

资源池二取值范围：

* H\_ESSD：极速型 SSD - H\_SSD：超高 IO - H\_GPSSD：通用型 SSD - H\_SAS：高 IO - H\_SATA：普通 IO

|
\| performance\_level | string |

云盘种类为 ESSD 云盘时必填，指定云盘的性能等级。取值范围：

* PL1（默认）：单盘最高随机读写 IOPS 5 万 - PL2：单盘最高随机读写 IOPS 10 万 - PL3：单盘最高随机读写 IOPS 100 万 有关如何选择 ESSD 性能等级，请参见 ESSD 云盘。

|

### 弹性公网 IP EnquiryItemInfo [#弹性公网-ip-enquiryiteminfo]

| 名称        | 类型     | 描述           |
| --------- | ------ | ------------ |
| bandwidth | int    | 带宽大小，单位 Mbps |
| isp       | string |              |
| 线路类型      |        |              |

资源池一取值范围：

* BGP：多线BGP - BGP\_PRO：精品BGP，目前仅香港地域支持

资源池二取值范围：

* 5\_bgp：多线BGP

|

## 请求 Body 示例 [#请求-body-示例-1]

```json
{
  "infos": [
    {
      "region_id": "cn-qingdao",
      "order_type": "create",
      "amount": 1,
      "cost_charge_mode": "PayByInstance",
      "cost_charge_type": "PrePaid",
      "cost_period": 1,
      "cost_period_unit": "Month",
      "info_items": [
        {
          "resource_type": "instance",
          "item_info": {
            "instance_type": "ecs.se1ne.2xlarge"
          }
        },
        {
          "resource_type": "disk",
          "item_info": {
            "category": "cloud_efficiency",
            "size": 40
          }
        }
      ]
    }
  ]
}
```

# 返回值 [#返回值]

| 名称          | 类型                   | 描述    |
| ----------- | -------------------- | ----- |
| request\_id | string               | 请求 ID |
| data        | EnquiryResultItem\[] | 价格信息  |

### EnquiryResultItem \< EnquiryItem [#enquiryresultitem--enquiryitem]

| 名称            | 类型                   | 描述     |
| ------------- | -------------------- | ------ |
| atomic\_items | EnquiryAtomicItem\[] | 计费单元列表 |

### EnquiryAtomicItem [#enquiryatomicitem]

| 名称          | 类型      | 描述          |
| ----------- | ------- | ----------- |
| amount      | int     | 本计费单元实际计费数量 |
| price       | float64 | 本计费单元总价格    |
| price\_item | stirng  | 计费单元 key    |

## 返回值示例 [#返回值示例]

```json
{
  "data": {
    "infos": [
      {
        "amount": 1,
        "info_items": [
          {
            "resource_type": "instance",
            "item_info": {
              "instance_type": "ecs.se1ne.2xlarge"
            }
          },
          {
            "resource_type": "disk",
            "item_info": {
              "category": "cloud_efficiency",
              "size": 40
            }
          }
        ],
        "atomic_items": [
          {
            "price_item": "qvm:instance:ecs.se1ne.2xlarge:for_trade:1month",
            "product_item": "qvm:instance:ecs.se1ne.2xlarge",
            "amount": 1,
            "price": 1321.26,
            "resource_type": "instance"
          },
          {
            "price_item": "qvm:disk:cloud_efficiency:for_trade:1month",
            "product_item": "qvm:disk:cloud_efficiency",
            "amount": 4,
            "price": 13.3,
            "resource_type": "disk"
          }
        ],
        "cost_charge_type": "PrePaid",
        "cost_charge_mode": "PayByInstance",
        "cost_period_unit": "Month",
        "cost_period": 1,
        "cost_seconds": 0,
        "order_type": "create",
        "region_id": "cn-qingdao"
      }
    ]
  },
  "request_id": "ScKvEWjlTG6Ba1kW"
}
```
