Queries the price of an elastic container instance.

Description

This operation does not support the resource group authentication.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeContainerGroupPrice

The operation that you want to perform. Set the value to DescribeContainerGroupPrice.

Cpu Float Yes 2.0

The number of vCPUs.

Memory Float Yes 4.0

The size of the memory.

RegionId String Yes cn-hangzhou

The region ID of the elastic container instance.

InstanceType String No ecs.c5.large

The instance type of the Elastic Compute Service (ECS) instance used to create the elastic container instance.

SpotStrategy String No SpotWithPriceLimit

The preemption policy of the elastic container instance. Valid values:

  • NoSpot: The elastic container instance is a pay-as-you-go elastic container instance.
  • SpotWithPriceLimit: The elastic container instance is a preemptible elastic container instance that has a user-defined maximum hourly price.
  • SpotAsPriceGo: The elastic container instance is a preemptible elastic container instance whose price is based on the current market price.

Default value: NoSpot.

ZoneId String No cn-hangzhou-g

The zone ID of the elastic container instance.

SpotPriceLimit Float No 0.2

The maximum hourly price of the preemptible elastic container instance. The value can be accurate to three decimal places. When SpotStrategy is set to SpotWithPriceLimit, the SpotPriceLimit parameter must be specified.

EphemeralStorage Integer No 20

The size of the temporary storage. Unit: GiB.

Response parameters

Parameter Type Example Description
PriceInfo Struct

The information about the price and discount rules.

Price Struct

The price.

Currency String CNY

The currency unit.

DetailInfos Array of DetailInfo

The details about the price.

DetailInfo
DiscountPrice Float 0

The discount price.

OriginalPrice Float 0.000098

The original price.

Resource String cpu

The name of the resource.

Rules Array of Rule

The details about the pricing rules.

Rule
Description String Get 15% off on a 1-year subscription

The description of the promotion rule.

RuleId Long 123456

The ID of the promotion rule.

TradePrice Float 0.000098

The transaction price.

DiscountPrice Float 0

The discount price.

OriginalPrice Float 0.00012252

The original price.

TradePrice Float 0.00012252

The transaction price. This price is calculated by deducting the discount from the original price.

Rules Array of Rule

The details about the promotion rules.

Rule
Description String Get 15% off on a 1-year subscription

The description of the promotion rule.

RuleId Long 123456

The ID of the promotion rule.

SpotPrices Array of SpotPrice

The details about the price of the preemptible elastic container instance.

SpotPrice
InstanceType String ecs.c5.large

The instance type of the elastic container instance.

OriginPrice Float 0.622

The original price.

SpotPrice Float 0.056

The price of the preemptible elastic container instance.

ZoneId String cn-hangzhou-i

The zone ID of the elastic container instance.

RequestId String 7A872585-33C7-4D69-AB8E-412E81EBA387

The ID of the request.

Examples

Sample requests

https://eci.aliyuncs.com/?Action=DescribeContainerGroupPrice
&Cpu=2.0
&Memory=4.0
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<DescribeContainerGroupPriceResponse>
      <RequestId>49BF254A-F5A6-5B71-9F2B-5DB61B4FE12B</RequestId>
      <PriceInfo>
            <Price>
                  <OriginalPrice>0.00017222</OriginalPrice>
                  <Currency>CNY</Currency>
                  <DiscountPrice>0.00016949</DiscountPrice>
                  <DetailInfos>
                        <DetailInfo>
                              <OriginalPrice>0.00017222</OriginalPrice>
                              <DiscountPrice>0.00016949</DiscountPrice>
                              <Resource>instance_type</Resource>
                              <TradePrice>0.00000273</TradePrice>
                              <Rules>
                    </Rules>
                        </DetailInfo>
                  </DetailInfos>
                  <TradePrice>0.00000273</TradePrice>
            </Price>
            <Rules>
                  <Rule>
                        <Description>Get 15% off on a 1-year subscription</Description>
                        <RuleId>123456</RuleId>
                  </Rule>
            </Rules>
      </PriceInfo>
</DescribeContainerGroupPriceResponse>

JSON format

{
    "RequestId": "49BF254A-F5A6-5B71-9F2B-5DB61B4FE12B",
    "PriceInfo": {
        "Price": {
            "OriginalPrice": 0.00017222,
            "Currency": "CNY",
            "DiscountPrice": 0.00016949,
            "DetailInfos": {
                "DetailInfo": [
                    {
                        "OriginalPrice": 0.00017222,
                        "DiscountPrice": 0.00016949,
                        "Resource": "instance_type",
                        "TradePrice": 0.00000273,
                        "Rules": {
                            "Rule": []
                        }
                    }
                ]
            },
            "TradePrice": 0.00000273
        },
        "Rules": {
            "Rule": [
                {
                    "Description": "Get 15% off on a 1-year subscription",
                    "RuleId": 123456
                }
            ]
        }
    }
}

Error codes

HttpCode Error code Error message Description
400 InvalidParam.CpuOrMemorySpec The specified specification is invalid. The error message returned because the specified instance type is unavailable. You cannot query the price of the instance type.
400 TradeBidCommodityNotMatch The trade ID and the commodity do not match. The error message returned because the transaction ID and the commodity do not match.
403 Spot.NotMatched %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://help.aliyun.com/document_detail/157290.html %s. The error message returned because the inventory of the resource is insufficient. We recommend that you specify multiple zones and instance types to avoid insufficient resources. For more information, see https://www.alibabacloud.com/help/doc-detail/157290.htm?spm=a2c63.l28256.b99.50.3eaf3b03g0ERpm.

For a list of error codes, visit the API Error Center.