续费实例询价

最近更新时间:2024-06-04 01:54:27

我的收藏

1. 接口描述

接口请求域名: lighthouse.tencentcloudapi.com 。

本接口(InquirePriceRenewInstances)用于续费实例询价。

默认接口请求频率限制:10次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:InquirePriceRenewInstances。
Version String 公共参数,本接口取值:2020-03-24。
Region String 公共参数,详见产品支持的 地域列表
InstanceIds.N Array of String 待续费的实例ID。可通过DescribeInstances接口返回值中的InstanceId获取。每次请求批量实例的上限为50。
示例值:["lhins-11110001"]
InstanceChargePrepaid InstanceChargePrepaid 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。
RenewDataDisk Boolean 是否续费数据盘。默认值: false, 即不续费。
示例值:false
AlignInstanceExpiredTime Boolean 数据盘是否对齐实例到期时间。默认值: false, 即不对齐。
示例值:false

3. 输出参数

参数名称 类型 描述
Price Price 询价信息。默认为列表中第一个实例的价格信息。
DataDiskPriceSet Array of DataDiskPrice 数据盘价格信息列表。
注意:此字段可能返回 null,表示取不到有效值。
InstancePriceDetailSet Array of InstancePriceDetail 待续费实例价格列表。
注意:此字段可能返回 null,表示取不到有效值。
TotalPrice TotalPrice 总计价格。
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 续费实例询价-成功返回

续费实例询价

输入示例

POST / HTTP/1.1
Host: lighthouse.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: InquirePriceRenewInstances
<公共请求参数>

{
    "InstanceChargePrepaid": {
        "RenewFlag": "NOTIFY_AND_AUTO_RENEW",
        "Period": "1"
    },
    "InstanceIds": [
        "lhins-iqrj7783"
    ]
}

输出示例

{
    "Response": {
        "Price": {
            "InstancePrice": {
                "Currency": "CNY",
                "OriginalBundlePrice": 50,
                "OriginalPrice": 50,
                "Discount": 40,
                "DiscountPrice": 20
            }
        },
        "DataDiskPriceSet": [],
        "InstancePriceDetailSet": [
            {
                "InstanceId": "lhins-iqrj7783",
                "InstancePrice": {
                    "Currency": "CNY",
                    "OriginalBundlePrice": 50,
                    "OriginalPrice": 50,
                    "Discount": 40,
                    "DiscountPrice": 20
                },
                "DiscountDetail": [
                    {
                        "TimeSpan": 1,
                        "TimeUnit": "m",
                        "Discount": 40,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 100,
                            "ActivityDiscount": 40,
                            "FinalDiscount": 40,
                            "DiscountType": "activity"
                        },
                        "TotalCost": 50,
                        "RealTotalCost": 20
                    },
                    {
                        "TimeSpan": 2,
                        "TimeUnit": "m",
                        "Discount": 30,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 100,
                            "ActivityDiscount": 30,
                            "FinalDiscount": 30,
                            "DiscountType": "activity"
                        },
                        "TotalCost": 100,
                        "RealTotalCost": 30
                    },
                    {
                        "TimeSpan": 3,
                        "TimeUnit": "m",
                        "Discount": 25,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 100,
                            "ActivityDiscount": 25,
                            "FinalDiscount": 25,
                            "DiscountType": "activity"
                        },
                        "TotalCost": 150,
                        "RealTotalCost": 37.5
                    },
                    {
                        "TimeSpan": 4,
                        "TimeUnit": "m",
                        "Discount": 100,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 100,
                            "ActivityDiscount": null,
                            "FinalDiscount": 100,
                            "DiscountType": null
                        },
                        "TotalCost": 200,
                        "RealTotalCost": 200
                    },
                    {
                        "TimeSpan": 5,
                        "TimeUnit": "m",
                        "Discount": 100,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 100,
                            "ActivityDiscount": null,
                            "FinalDiscount": 100,
                            "DiscountType": null
                        },
                        "TotalCost": 250,
                        "RealTotalCost": 250
                    },
                    {
                        "TimeSpan": 6,
                        "TimeUnit": "m",
                        "Discount": 88,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 88,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 88,
                            "DiscountType": "common"
                        },
                        "TotalCost": 300,
                        "RealTotalCost": 264
                    },
                    {
                        "TimeSpan": 7,
                        "TimeUnit": "m",
                        "Discount": 88,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 88,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 88,
                            "DiscountType": "common"
                        },
                        "TotalCost": 350,
                        "RealTotalCost": 308
                    },
                    {
                        "TimeSpan": 8,
                        "TimeUnit": "m",
                        "Discount": 88,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 88,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 88,
                            "DiscountType": "common"
                        },
                        "TotalCost": 400,
                        "RealTotalCost": 352
                    },
                    {
                        "TimeSpan": 9,
                        "TimeUnit": "m",
                        "Discount": 88,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 88,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 88,
                            "DiscountType": "common"
                        },
                        "TotalCost": 450,
                        "RealTotalCost": 396
                    },
                    {
                        "TimeSpan": 10,
                        "TimeUnit": "m",
                        "Discount": 88,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 88,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 88,
                            "DiscountType": "common"
                        },
                        "TotalCost": 500,
                        "RealTotalCost": 440
                    },
                    {
                        "TimeSpan": 11,
                        "TimeUnit": "m",
                        "Discount": 88,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 88,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 88,
                            "DiscountType": "common"
                        },
                        "TotalCost": 550,
                        "RealTotalCost": 484
                    },
                    {
                        "TimeSpan": 12,
                        "TimeUnit": "m",
                        "Discount": 85,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 85,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 85,
                            "DiscountType": "common"
                        },
                        "TotalCost": 600,
                        "RealTotalCost": 510
                    },
                    {
                        "TimeSpan": 24,
                        "TimeUnit": "m",
                        "Discount": 85,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 85,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 85,
                            "DiscountType": "common"
                        },
                        "TotalCost": 1200,
                        "RealTotalCost": 1020
                    },
                    {
                        "TimeSpan": 36,
                        "TimeUnit": "m",
                        "Discount": 85,
                        "PolicyDetail": {
                            "UserDiscount": 100,
                            "CommonDiscount": 85,
                            "ActivityDiscount": 100,
                            "FinalDiscount": 85,
                            "DiscountType": "common"
                        },
                        "TotalCost": 1800,
                        "RealTotalCost": 1530
                    }
                ]
            }
        ],
        "TotalPrice": {
            "OriginalPrice": 50,
            "DiscountPrice": 20
        },
        "RequestId": "22e25e9c-a1d2-4a82-aca0-6fd9e18f3df2"
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
FailedOperation 操作失败。
FailedOperation.TradeGetPriceFailed 计费询价失败。
InternalError.RequestError 请求出现错误。
InternalError.TradeGetPriceFailed 价格获取失败。
InvalidParameterValue.Duplicated 参数值非法,不允许包含重复的值。
InvalidParameterValue.InstanceIdMalformed 参数值非法,实例 ID 格式非法。
InvalidParameterValue.LimitExceeded 参数值非法,参数值的数量超过最大限制。
ResourceNotFound.InstanceDataDiskNotFound 实例不存在挂载的数据盘。
ResourceNotFound.InstanceIdNotFound 实例 ID 不存在。
UnauthorizedOperation.NoPermission 无权限。