tencent cloud

文档反馈

DescribePriceRunInstance

最后更新时间:2023-08-18 14:28:09

1. API Description

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

This API is used to query the price of an instance.

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: DescribePriceRunInstance.
Version Yes String Common Params. The value used for this API: 2019-07-19.
Region No String Common Params. This parameter is not required for this API.
InstanceType Yes String Instance model information
SystemDisk Yes SystemDisk System disk information
InstanceCount Yes Integer Number of instances
DataDisk.N No Array of DataDisk Data disk information
InstanceChargeType No Integer Instance billing type. Valid values:
0: Bill by daily resource usage peak (CPU, memory, and disk). It applies only to non-GNR models;
1: Bill by usage hours of an instance. It applies only to GNR models. It’s available to beta users now. To enable it, submit a ticket;
2: Bill by usage month of an instance. It applies only to GNR models.
If this field is left empty, 0 is selected by default for non-GNR models, and 2 is selected by default for GNR models.

3. Output Parameters

Parameter Name Type Description
InstancePrice InstancesPrice Instance price information
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying instance price

Input Example

https://ecm.tencentcloudapi.com/?Action=DescribePriceRunInstance
&InstanceType="SN3ne.LARGE8"
&InstanceCount=2
&SystemDisk.DiskType="234"
&SystemDisk.DiskId="123"
&SystemDisk.DiskSize=50
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "testreq.1634816636",
        "InstancePrice": {
            "InstancePricesPartDetail": {
                "DisksPrice": {
                    "OriginalPrice": 116,
                    "DiscountPrice": 75,
                    "Discount": 64
                },
                "MemPrice": {
                    "OriginalPrice": 8106,
                    "DiscountPrice": 5269,
                    "Discount": 65
                },
                "CpuPrice": {
                    "OriginalPrice": 12800,
                    "DiscountPrice": 8320,
                    "Discount": 65
                }
            },
            "OriginalPrice": 21023,
            "DiscountPrice": 13665,
            "Discount": 65
        }
    }
}

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.InternalOperationFailure Internal error.
InvalidParameter.InvalidDataFormat The data format is incorrect.
InvalidParameterValue The parameter value is incorrect.
InvalidParameterValue.InvalidInstanceTypeConfigID The model ID is invalid.
InvalidParameterValue.InvalidPublicParam The common parameter is invalid.
InvalidParameterValue.InvalidSystemDiskSize The system disk size is invalid.
InvalidParameterValue.InvalidSystemDiskType The system disk type is invalid.
UnauthorizedOperation.ForbiddenOperation You don't have the permission to perform this operation.