All Products
Search
Document Center

Elastic Container Instance:DescribeContainerGroupPrice

Last Updated:Nov 14, 2024

Queries the price of an elastic container instance.

Operation description

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eci:DescribeContainerGroupPriceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
CpufloatYes

The number of vCPUs. For information about the vCPU and memory specifications that are supported by Elastic Container Instance, see vCPU and memory specifications.

2.0
MemoryfloatYes

The size of the memory. Unit: GiB. For information about the vCPU and memory specifications that are supported by Elastic Container Instance, see vCPU and memory specifications.

4.0
InstanceTypestringNo

The instance type of the Elastic Compute Service (ECS) instance that is used to create the elastic container instance. For information about the ECS instance types that are supported by Elastic Container Instance, see ECS instance types that are supported by Elastic Container Instance.

Note If you specify this parameter, the specified specifications of vCPUs and memory are ignored. Only the price of the ECS instance type is returned.
ecs.c5.large
SpotStrategystringNo

The bidding policy for the elastic container 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 automatically used as the bid price.

Default value: NoSpot.

SpotWithPriceLimit
ZoneIdstringNo

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

cn-hangzhou-g
SpotPriceLimitfloatNo

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

0.2
EphemeralStorageintegerNo

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

20
SpotDurationintegerNo

The protection period of the preemptible instance. Unit: hours. Default value: 1. The value of 0 indicates no protection period.

1
ComputeCategorystringNo

The computing power type. A value of economy specifies economic instances.

economy

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

7A872585-33C7-4D69-AB8E-412E81EBA387
PriceInfoobject

The information about the prices and discount rules.

SpotPricesarray<object>

The information about the prices of preemptible elastic container instances.

SpotPriceobject
ZoneIdstring

The zone ID of the instance.

cn-hangzhou-i
SpotPricefloat

The prices of preemptible elastic container instances.

0.056
InstanceTypestring

The ECS instance type.

ecs.c5.large
OriginPricefloat

The original price.

0.622
Priceobject

The price.

DiscountPricefloat

The discount.

0
TradePricefloat

The transaction price, which is equal to the original price minus the discount.

0.00012252
OriginalPricefloat

The original price.

0.00012252
DetailInfosarray<object>

The information about the price.

DetailInfoobject
Resourcestring

The name of the resource.

cpu
DiscountPricefloat

The discount.

0
TradePricefloat

The transaction price.

0.000098
OriginalPricefloat

The original price.

0.000098
Rulesarray<object>

Details about the pricing rules.

Ruleobject
Descriptionstring

The description of the rule.

Receive a 15% discount on a 1-year subscription
RuleIdlong

The rule ID.

123456
Currencystring

The currency unit. Valid values:

  • CNY: This value only applies to the China site (aliyun.com).
  • USD: This value only applies to the International site (alibabacloud.com).
CNY
Rulesarray<object>

Details about the promotion rules.

Ruleobject
Descriptionstring

The description of the promotion rule.

Receive a 15% discount on a 1-year subscription
RuleIdlong

The ID of the promotion rule.

123456

Examples

Sample success responses

JSONformat

{
  "RequestId": "7A872585-33C7-4D69-AB8E-412E81EBA387",
  "PriceInfo": {
    "SpotPrices": {
      "SpotPrice": [
        {
          "ZoneId": "cn-hangzhou-i",
          "SpotPrice": 0.056,
          "InstanceType": "ecs.c5.large",
          "OriginPrice": 0.622
        }
      ]
    },
    "Price": {
      "DiscountPrice": 0,
      "TradePrice": 0.00012252,
      "OriginalPrice": 0.00012252,
      "DetailInfos": {
        "DetailInfo": [
          {
            "Resource": "cpu",
            "DiscountPrice": 0,
            "TradePrice": 0.000098,
            "OriginalPrice": 0.000098,
            "Rules": {
              "Rule": [
                {
                  "Description": "Receive a 15% discount on a 1-year subscription\n",
                  "RuleId": 123456
                }
              ]
            }
          }
        ]
      },
      "Currency": "CNY"
    },
    "Rules": {
      "Rule": [
        {
          "Description": "Receive a 15% discount on a 1-year subscription\n",
          "RuleId": 123456
        }
      ]
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParam.CpuOrMemorySpecThe specified specification is invalid.The specified specification is invalid.
400TradeBidCommodityNotMatchThe trade ID and the commodity do not match.-
400InvalidSpotCpuMemorySpecThe specified CPU and memory are not allowed. You must create spot ECI using standard ECS specifications for CPU and memory.-
400FeatureBasedConstraintConflictA conflict occurs in specified feature constraints: [%s].A conflict occurs in specified feature constraints
403Spot.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-
403FeatureAccessRestrictedAccess to this feature:[%s] is restricted. Please contact Alibaba Cloud ECI support to request access.Access to this feature is restricted. Please contact Alibaba Cloud ECI support to request access.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-27The Error code has changed. The request parameters of the API has changedView Change Details
2023-12-25The Error code has changedView Change Details