查询实例套餐价格
所有文档

          云服务器 BCC

          查询实例套餐价格

          查询实例资源套餐规格对应的价格。

          请求结构

          POST /v{version}/instance/price HTTP/1.1
          Host: bcc.bj.baidubce.com
          Authorization: authorization string
          {
              "specId": specId,
              "spec": spec,
              "paymentTiming": paymentTiming,
              "zoneName": zoneName,
              "purchaseCount": purchaseCount,
              "purchaseLength": purchaseLength
          }

          请求头域

          除公共头域外,无其它特殊头域。

          请求参数

          参数名称 类型 是否必需 参数位置 描述
          version String URL参数 API版本号
          specId String RequestBody参数 实例规格族
          spec String RequestBody参数 实例套餐规格
          paymentTiming String RequestBody参数 付费方式,包括Postpaid(后付费),Prepaid(预付费)两种。
          zoneName String RequestBody参数 可用区名称
          purchaseCount int RequestBody参数 查询在指定实例套餐规格下,任意数量实例的总价格,必须为大于0的整数,可选参数,缺省为1
          reservationLength int RequestBody参数 时长,[1,2,3,4,5,6,7,8,9,12,24,36],单位:月

          返回头域

          除公共头域,无其它特殊头域。

          返回参数

          参数名称 类型 描述
          price List<SpecIdPrices> 实例套餐规格对应价格信息

          请求示例

          POST /v2/instance/price HTTP/1.1
          Host: bcc.bj.baidubce.com
          ContentType: application/json
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
          {
              "purchaseCount": 1,
              "purchaseLength": 1,
              "specId": "lgn1",
              "paymentTiming": "Prepaid",
              "zoneName": "cn-bj-b"
          } 
          或 
          {
              "purchaseCount": 1,
              "purchaseLength": 1,
              "spec": "bcc.lgn1.c12m40.1p40",
              "paymentTiming": "Prepaid",
              "zoneName": "cn-bj-b"
          } 

          返回示例

          HTTP/1.1 200 OK
          x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
          Date: Wed, 03 Dec 2014 06:42:19 GMT
          Content-Type: application/json;charset=UTF-8
          Server: BWS
          
          {
            "price": [
              {
                "specId": "lgn1",
                "specPrices": [
                  {
                    "spec": "bcc.lgn1.c12m40.1p40",
                    "specPrice": "4017.0",
                    "status": "available"
                  }
                ]
              },
              {
                "specId": "lgn1",
                "specPrices": [
                  {
                    "spec": "bcc.lgn1.c24m80.2p40",
                    "specPrice": "8034.0",
                    "status": "available"
                  }
                ]
              },
              {
                "specId": "lgn1",
                "specPrices": [
                  {
                    "spec": "bcc.lgn1.c48m160.4p40",
                    "specPrice": "16068.0",
                    "status": "available"
                  }
                ]
              }
            ]
          }
          或
          {
            "price": [
              {
                "specId": "lgn1",
                "specPrices": [
                  {
                    "spec": "bcc.lgn1.c12m40.1p40",
                    "specPrice": "4017.0",
                    "status": "available"
                  }
                ]
              }
            ]
          }  
          上一篇
          查询可用区列表
          下一篇
          查询实例套餐规格(新)