tencent cloud

Feedback

DescribeDiskDiscount

Last updated: 2023-12-04 16:32:04

    1. API Description

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

    This API is used to query the discount information of a cloud disk.

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

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    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 Params. The value used for this API: DescribeDiskDiscount.
    Version Yes String Common Params. The value used for this API: 2020-03-24.
    Region No String Common Params. This parameter is not required for this API.
    DiskType Yes String Cloud disk type. Valid values: "CLOUD_PREMIUM".
    DiskSize Yes Integer Cloud disk size.
    DiskBackupQuota No Integer Specify the quota of disk backups. No quota if it’s left empty. Only one quota is allowed.

    3. Output Parameters

    Parameter Name Type Description
    Currency String Currency: CNY, USD.
    DiscountDetail Array of DiscountDetail Discount tier details. The information of each tier includes the duration, discounted quantity, total price, discounted price, and discount details (user discount, official website discount, or final discount).
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying the discount information of cloud disks

    This example shows you how to query the discount information of cloud disks.

    Input Example

    POST / HTTP/1.1
    Host: lighthouse.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDiskDiscount
    <Common request parameters>
    
    {
        "DiskType": "CLOUD_PREMIUM",
        "DiskSize": 50
    }
    

    Output Example

    {
        "Response": {
            "Currency": "USD",
            "DiscountDetail": [
                {
                    "TimeSpan": 1,
                    "TimeUnit": "m",
                    "Discount": 100,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 100,
                        "ActivityDiscount": null,
                        "FinalDiscount": 100,
                        "DiscountType": null
                    },
                    "TotalCost": 50,
                    "RealTotalCost": 50
                },
                {
                    "TimeSpan": 2,
                    "TimeUnit": "m",
                    "Discount": 100,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 100,
                        "ActivityDiscount": null,
                        "FinalDiscount": 100,
                        "DiscountType": null
                    },
                    "TotalCost": 100,
                    "RealTotalCost": 100
                },
                {
                    "TimeSpan": 3,
                    "TimeUnit": "m",
                    "Discount": 100,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 100,
                        "ActivityDiscount": null,
                        "FinalDiscount": 100,
                        "DiscountType": null
                    },
                    "TotalCost": 150,
                    "RealTotalCost": 150
                },
                {
                    "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": 83,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 83,
                        "ActivityDiscount": 100,
                        "FinalDiscount": 83,
                        "DiscountType": "common"
                    },
                    "TotalCost": 600,
                    "RealTotalCost": 498
                },
                {
                    "TimeSpan": 24,
                    "TimeUnit": "m",
                    "Discount": 70,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 70,
                        "ActivityDiscount": 100,
                        "FinalDiscount": 70,
                        "DiscountType": "common"
                    },
                    "TotalCost": 1200,
                    "RealTotalCost": 840
                },
                {
                    "TimeSpan": 36,
                    "TimeUnit": "m",
                    "Discount": 50,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 50,
                        "ActivityDiscount": 100,
                        "FinalDiscount": 50,
                        "DiscountType": "common"
                    },
                    "TotalCost": 1800,
                    "RealTotalCost": 900
                },
                {
                    "TimeSpan": 48,
                    "TimeUnit": "m",
                    "Discount": 50,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 50,
                        "ActivityDiscount": 100,
                        "FinalDiscount": 50,
                        "DiscountType": "common"
                    },
                    "TotalCost": 2400,
                    "RealTotalCost": 1200
                },
                {
                    "TimeSpan": 60,
                    "TimeUnit": "m",
                    "Discount": 50,
                    "PolicyDetail": {
                        "UserDiscount": 100,
                        "CommonDiscount": 50,
                        "ActivityDiscount": 100,
                        "FinalDiscount": 50,
                        "DiscountType": "common"
                    },
                    "TotalCost": 3000,
                    "RealTotalCost": 1500
                }
            ],
            "RequestId": "250d48df-ded8-4ce0-92f5-10c13e673d06"
        }
    }
    

    5. Developer Resources

    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
    FailedOperation.RequestError A request error occurred.
    FailedOperation.TradeGetPriceFailed Failed to query the price.
    InternalError.RequestError There was an error in the request.
    InternalError.TradeGetPriceFailed Failed to get the price.
    InvalidParameterValue Incorrect parameter value.
    InvalidParameterValue.OutOfRange Invalid parametric value: it is not within the valid range.
    UnauthorizedOperation.NoPermission No permission