Queries the price of an elastic container instance.

Description

This operation cannot be used for 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.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region and zone list.

Cpu Float Yes 2.0

The number of vCPUs.

Memory Float Yes 4.0

The size of the memory. Unit: GiB.

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 bidding policy for the instance. Valid values:

  • NoSpot: The instance is a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is a preemptible instance with a user-defined maximum hourly price.
  • SpotAsPriceGo: The instance is a preemptible instance for which the market price at the time of purchase is used as the bid price.

Default value: NoSpot.

ZoneId String No cn-hangzhou-g

The zone ID of the instance. You can call the DescribeRegions operation to query the most recent region and zone list.

SpotPriceLimit Float No 0.2

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

EphemeralStorage Integer No 20

The size of the temporary storage space. Unit: GiB.

Response parameters

Parameter Type Example Description
RequestId String 7A872585-33C7-4D69-AB8E-412E81EBA387

The ID of the request.

PriceInfo Object

The information about the price and discount rules.

SpotPrices Array of SpotPrice

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

SpotPrice
ZoneId String cn-hangzhou-i

The zone ID of the instance.

SpotPrice Float 0.056

The price of the preemptible elastic container instance.

InstanceType String ecs.c5.large

The instance type.

OriginPrice Float 0.622

The original price.

Price Object

The price.

DiscountPrice Float 0

The discount price.

TradePrice Float 0.00012252

The final price that you need to pay. The final price is equal to the original price minus the discount price.

OriginalPrice Float 0.00012252

The original price.

DetailInfos Array of DetailInfo

The details about the price.

DetailInfo
Resource String cpu

The name of the resource.

DiscountPrice Float 0

The discount price.

TradePrice Float 0.000098

The transaction price.

OriginalPrice Float 0.000098

The original price.

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.

Currency String CNY

The currency that is used to measure the price. Valid values:

  • CNY: This value only applies to the China site (aliyun.com).
  • USD: This value only applies to the International site (alibabacloud.com).
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.

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

HTTP/1.1 200 OK
Content-Type:application/xml

<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

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status code 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.
400 InvalidSpotCpuMemorySpec The specified CPU and memory are not allowed. You must create spot ECI using standard ECS specifications for CPU and memory. The error message returned because you do not specify a valid number of vCPUs or memory size for ECS instance types that are used to create elastic container instance-based spots.
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 prevent insufficient resources. For more information, visit https://www.alibabacloud.com/help/doc-detail/157290.html.

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