InquiryPriceCreateDisks

Last updated: 2020-02-03 20:13:02

1. API Description

Domain name for API request: cbs.tencentcloudapi.com.

This API (InquiryPriceCreateDisks) is used to inquire the price for cloud disk creation.

  • It supports inquiring the price for the creation of multiple cloud disks. The total price for the creation is returned.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: cbs.ap-shanghai-fsi.tencentcloudapi.com

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: InquiryPriceCreateDisks
Version Yes String Common parameter. The value used for this API: 2017-03-12
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
DiskType Yes String Type of cloud hard disk. Value range:
  • Ordinary cloud disk: CLOUD_BASIC
  • Premium cloud storage: CLOUD_PREMIUM
  • SSD cloud disk: CLOUD_SSD.
  • DiskSize Yes Integer Cloud disk size (in GB). For the value range of the cloud disk sizes, see cloud disk Product Types.
    DiskChargeType Yes String Cloud disk billing method.
  • POSTPAID_BY_HOUR: Pay-as-you-go on an hourly basis
  • DiskChargePrepaid No DiskChargePrepaid Relevant parameter settings for the prepaid mode (i.e., monthly subscription). The monthly subscription cloud disk purchase attributes such as usage period and whether or not auto-renewal is set up can be specified using this parameter.
    This parameter is required when creating a prepaid cloud disk. This parameter is not required when creating an hourly postpaid cloud disk.
    DiskCount No Integer Quantity of cloud disks purchased. If left empty, default is 1.
    ProjectId No Integer ID of project the cloud disk belongs to.

    3. Output Parameters

    Parameter Name Type Description
    DiskPrice Price Describes the price of purchasing new cloud disk.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Samples

    Sample 1. Querying the Price for Purchasing an HDD Cloud Disk (50 GB) for 6 Months

    Input Sample Code

    https://cbs.tencentcloudapi.com/?Action=InquiryPriceCreateDisks
    &DiskType=CLOUD_BASIC
    &DiskSize=50
    &DiskChargeType=PREPAID
    &DiskChargePrepaid.Period=6
    &<common request parameters>

    Output Sample Code

    {
      "Response": {
        "RequestId": "55db49cf-b9d7-da27-825b-5a02ba6884ca",
        "DiskPrice": {
          "DiscountPrice": 79.2,
          "UnitPrice": null,
          "OriginalPrice": 90.0,
          "ChargeUnit": null
        }
      }
    }

    Sample 2. Querying the Price for Purchasing a Pay-as-you-go Cloud Disk

    Query the price for purchasing a pay-as-you-go premium cloud disk with a size of 100 GB.

    Input Sample Code

    https://cbs.tencentcloudapi.com/?Action=InquiryPriceCreateDisks
    &DiskType=CLOUD_PREMIUM
    &DiskSize=100
    &DiskCount=1
    &DiskChargeType=POSTPAID_BY_HOUR
    &<common request parameters>

    Output Sample Code

    {
      "Response": {
        "RequestId": "55db49cf-b9d7-da27-825b-5a02ba6884ca",
        "DiskPrice": {
          "DiscountPrice": null,
          "UnitPrice": 0.021,
          "OriginalPrice": null,
          "ChargeUnit": "HOUR"
        }
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidParameterValue Invalid parameter value. Parameter value format error or parameter value not supported.
    MissingParameter Missing parameter. Request does not include the required parameter.