You can call this operation to query the maximum public bandwidth that can be purchased, upgraded, or downgraded for various instance types.

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 DescribeBandwidthLimitation

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

RegionId String Yes cn-hangzhou

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

InstanceType String Yes ecs.g5.large

The instance type. For more information about the values, see Instance families.

Note This parameter is required.
InstanceChargeType String No PrePaid

The billing method of the instance. For more information, see Billing overview. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go

Default value: PostPaid.

SpotStrategy String No NoSpot

The preemption policy of the preemptible instance. Valid values:

  • NoSpot: applies to regular pay-as-you-go instances.
  • SpotWithPriceLimit: applies to preemptible instances with user-defined maximum hourly prices.
  • SpotAsPriceGo: applies to preemptible instances priced at the market price at the time of purchase.

Default value: NoSpot.

Note The SpotStrategy parameter takes effect only when the InstanceChargeType parameter is set to PostPaid.
ResourceId String No i-bp67acfmxazb4ph***

The ID of the resource.

Note When you set the OperationType parameter to Upgrade or Downgrade, the ResourceId parameter is required.
OperationType String No Upgrade

Specifies the specification limit of public bandwidth under different operations. Valid values:

  • Upgrade: upgrades the public bandwidth.
  • Downgrade: downgrades the public bandwidth.
  • Create: creates an ECS instance.

Default value: Create.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Bandwidths Array

An array consisting of Bandwidth data.

InternetChargeType String PayByTraffic

The billing method of the public bandwidth. Valid values:

  • PayByBandwidth
  • PayByTraffic
Min Integer 0

The minimum public bandwidth.

Max Integer 100

The maximum public bandwidth.

Unit String Mbps

The unit of the public bandwidth.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeBandwidthLimitation
&RegionId=cn-hangzhou
&InstanceType=ecs.g5.large
&<Common request parameters>

Sample success responses

XML format

<DescribeBandwidthLimitationResponse>
      <Bandwidths>
            <Bandwidth>
                  <Max>100</Max>
                  <InternetChargeType>PayByBandwidth</InternetChargeType>
                  <Unit>Mbps</Unit>
                  <Min>0</Min>
            </Bandwidth>
            <Bandwidth>
                  <Max>100</Max>
                  <InternetChargeType>PayByTraffic</InternetChargeType>
                  <Unit>Mbps</Unit>
                  <Min>0</Min>
            </Bandwidth>
      </Bandwidths>
      <RequestId>226CB38E-29E3-423E-85DD-DCD1C99832B0</RequestId>
</DescribeBandwidthLimitationResponse>

JSON format

{
    "Bandwidths": {
        "Bandwidth": [
            {
                "Max": 100,
                "InternetChargeType": "PayByBandwidth",
                "Unit": "Mbps",
                "Min": 0
            },
            {
                "Max": 100,
                "InternetChargeType": "PayByTraffic",
                "Unit": "Mbps",
                "Min": 0
            }
        ]
    },
    "RequestId": "226CB38E-29E3-423E-85DD-DCD1C99832B0"
}

Error codes

HTTP status code Error code Error message Description
400 Invalid.InstanceChargeType The specified InstanceChargeType is not valid. The error message returned because the specified InstanceChargeType parameter is invalid.
404 Invalid.NetworkCategory The specified NetworkCategory is not valid. The error message returned because the specified NetworkCategory parameter is invalid.
404 Invalid.SpotStrategy The specified SpotStrategy is not valid. The error message returned because the specified SpotStrategy parameter is invalid.
404 Invalid.IoOptimized The specified IoOptimized is not valid. The error message returned because the specified IoOptimized parameter is invalid.
404 Invalid.ResourceId The specified ResourceId is not valid. The error message returned because the specified ResourceId parameter is invalid.
404 Invalid.InstancePayType The specified InstancePayType is not valid. The error message returned because the specified InstanceChargeType parameter is invalid.

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