You need to enable JavaScript to run this app.
导航
DescribeDBInstancePriceDetail
最近更新时间:2024.07.26 14:50:53首次发布时间:2023.08.14 13:15:55

调用 DescribeDBInstancePriceDetail 接口查询 MySQL 实例的价格详情。

请求类型

同步请求。

请求参数

名称类型是否必选示例值描述
NodeInfoArray of NodeInfoObject请参见请求示例实例规格配置。主节点和备节点有且只有 1 个,只读节点可选 0~10 个。更多关于 NodeInfo 信息,请参见数据结构
StorageTypeStringLocalSSD实例存储类型。取值为 LocalSSD,表示本地 SSD 盘。
StorageSpaceInteger100实例存储空间。取值范围:[20, 3000],单位:GB,步长 10GB。

ChargeType

String

PrePaid

计费类型,取值为:

  • PrePaid:预付费,即包年包月。
  • PostPaid:后付费,即按量计费。

PeriodUnit

String

Month

预付费模式下的时长单位。取值为:

  • Month:以月为单位计算时长。
  • Year:以年为单位计算时长。

说明

ChargeType 取值为 PrePaid 时,需设置该字段。

Period

Integer

2

预付费模式下的时长数量。

说明

ChargeType 取值为 PrePaid 时,需设置该字段。

NumberInteger1实例个数。

返回参数

名称类型示例值描述

BillingMethod

String

configuration_hourly

计价方法。取值为:

  • configuration_hourly:后付费,即按量计费。
  • fixed_price:预付费,即包年包月。
ChargeItemPricesArray of ChargeItemPriceObject请参见返回示例费用明细。关于 ChargeItemPrices 的更多详细信息,请参见数据结构
CouponAmountDouble1.25使用优惠券抵扣的金额。
CurrencyString人民币货币单位。默认值人民币。
DiscountPriceDouble0.75实例折扣价。
OriginalPriceDouble0.75实例原价。
PayablePriceDouble0.75实例应付价格。
QuantityInteger3实例数量。
RefundAmountDouble0.75应退款金额。

请求示例

  • 查询实例在后付费(按量计费)方式下的价格。

    POST /?Action=DescribeDBInstancePriceDetail&Version=2022-01-01 HTTP/1.1
    Accept: application/json
    Content-Type: application/json
    Host: rds.volcengineapi.com
    X-Date: 20230810T101010Z
    Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20230810/cn-beijing/rds_mysql/request, SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c645a****
    
    {
        "StorageType":"LocalSSD",
        "StorageSpace":100,
        "ChargeType":"PostPaid",
        "NodeInfo":[
            {
                "ZoneId":"cn-beijing-c",
                "NodeSpec":"rds.mysql.1c2g",
                "NodeType":"Primary"
            },
            {
                "ZoneId":"cn-beijing-c",
                "NodeSpec":"rds.mysql.1c2g",
                "NodeType":"Secondary"
            }
        ],
        "Number":3
    }
    
  • 查询实例在预付费(包年包月)方式下的价格。

    POST /?Action=DescribeDBInstancePriceDetail&Version=2022-01-01 HTTP/1.1
    Accept: application/json
    Content-Type: application/json
    Host: rds.volcengineapi.com
    X-Date: 20230810T101010Z
    Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20230810/cn-beijing/rds_mysql/request, SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c645a****
    
    {
        "StorageType":"LocalSSD",
        "StorageSpace":100,
        "ChargeType":"PrePaid",
        "PeriodUnit":"Month",
        "Period":2,
        "NodeInfo":[
            {
                "ZoneId":"cn-beijing-c",
                "NodeSpec":"rds.mysql.1c2g",
                "NodeType":"Primary"
            },
            {
                "ZoneId":"cn-beijing-c",
                "NodeSpec":"rds.mysql.1c2g",
                "NodeType":"Secondary"
            }
        ],
        "Number":3
    }
    

返回示例

正常返回示例

  • 查询实例在后付费(按量计费)方式下的价格的返回结果。

    {
        "ResponseMetadata": {
            "RequestId": "20231204173554075E7B40F518422CE47D",
            "Action": "DescribeDBInstancePriceDetail",
            "Version": "2022-01-01",
            "Service": "rds_mysql",
            "Region": "cn-beijing"
        },
        "Result": {
            "BillingMethod": "configuration_hourly",
            "ChargeItemPrices": [
                {
                    "ChargeItemKey": "rds.mysql.d1.1c2g_cn-beijing",
                    "ChargeItemType": "Primary",
                    "ChargeItemValue": 1,
                    "DiscountPrice": 0.0689645275,
                    "OriginalPrice": 0.25,
                    "PayablePrice": 0.0689645275,
                    "UnitPrice": 0.25
                },
                {
                    "ChargeItemKey": "rds.mysql.d1.1c2g_cn-beijing",
                    "ChargeItemType": "Secondary",
                    "ChargeItemValue": 1,
                    "DiscountPrice": 0.0689645275,
                    "OriginalPrice": 0.25,
                    "PayablePrice": 0.0689645275,
                    "UnitPrice": 0.25
                },
                {
                    "ChargeItemKey": "rds.mysql.d1.localssd_cn-beijing",
                    "ChargeItemType": "Storage",
                    "ChargeItemValue": 100,
                    "DiscountPrice": 0.03205044,
                    "OriginalPrice": 0.25,
                    "PayablePrice": 0.03205044,
                    "UnitPrice": 0.0004166666666666667
                }
            ],
            "CouponAmount": 0,
            "Currency": "人民币",
            "DiscountPrice": 0.509938485,
            "OriginalPrice": 2.25,
            "PayablePrice": 0.509938485,
            "Quantity": 3,
            "RefundAmount": 0
        }
    }
    
  • 查询实例在预付费(包年包月)方式下的价格的返回结果。

    {
        "ResponseMetadata": {
            "RequestId": "20231204173611C80EEB6878C8F0309ADB",
            "Action": "DescribeDBInstancePriceDetail",
            "Version": "2022-01-01",
            "Service": "rds_mysql",
            "Region": "cn-beijing"
        },
        "Result": {
            "BillingMethod": "fixed_price",
            "ChargeItemPrices": [
                {
                    "ChargeItemKey": "rds.mysql.d1.1c2g_cn-beijing",
                    "ChargeItemType": "Primary",
                    "ChargeItemValue": 1,
                    "DiscountPrice": 99.31,
                    "OriginalPrice": 240,
                    "PayablePrice": 99.31,
                    "UnitPrice": 49.6544598
                },
                {
                    "ChargeItemKey": "rds.mysql.d1.1c2g_cn-beijing",
                    "ChargeItemType": "Secondary",
                    "ChargeItemValue": 1,
                    "DiscountPrice": 99.31,
                    "OriginalPrice": 240,
                    "PayablePrice": 99.31,
                    "UnitPrice": 49.6544598
                },
                {
                    "ChargeItemKey": "rds.mysql.d1.localssd_cn-beijing",
                    "ChargeItemType": "Storage",
                    "ChargeItemValue": 100,
                    "DiscountPrice": 46.15,
                    "OriginalPrice": 240,
                    "PayablePrice": 46.15,
                    "UnitPrice": 0.0384605233
                }
            ],
            "CouponAmount": 0,
            "Currency": "",
            "DiscountPrice": 734.31,
            "OriginalPrice": 2160,
            "PayablePrice": 734.31,
            "Quantity": 3,
            "RefundAmount": 0
        }
    }
    

错误码

更多详情,请参见错误码