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
RegionId String Yes cn-hangzhou

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

Action String No DescribeBandwidthLimitation

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

InstanceType String No 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 method overview. Valid values:

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

Default value: PostPaid

SpotStrategy String No NoSpot

The preemption policy of a pay-as-you-go instance. Valid values:

  • NoSpot: The instance is created as a regular pay-as-you-go instance.
  • SpotWithPriceLimit: A user defined hourly price is used as the highest bidding price.
  • SpotAsPriceGo: The system automatically offers a bid, which is not higher than the pay-as-you-go price for the same instance type.

Default value: NoSpot

Note The SpotStrategy parameter is valid 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

Queries the specification limit of public bandwidth under different operation modes. Valid values:

  • Upgrade: upgrade the public bandwidth.
  • Downgrade: downgrade the public bandwidth.
  • Create: create an ECS instance.

Default value: Create.

Response parameters

Parameter Type Example Description
Bandwidths Array

A set of information about the maximum public bandwidth.

Bandwidth

A piece of information about the maximum public bandwidth.

InternetChargeType String PayByTraffic

The billing method for Internet usage. Valid values:

  • PayByBandwidth: pay-by-bandwidth.
  • PayByTraffic: pay-by-traffic.
Max Integer 100

The maximum public bandwidth. No value is returned if the parameter value is null.

Min Integer 0

The minimum public bandwidth. No value is returned if the parameter value is null.

Unit String Mbps

The unit of the public bandwidth. No value is returned if the parameter value is null.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Samples

Sample request

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

Sample success response

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",
				"Min":0,
				"Unit":"Mbps"
			},
			{
				"Max":100,
				"InternetChargeType":"PayByTraffic",
				"Min":0,
				"Unit":"Mbps"
			}
		]
	},
	"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 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 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 resource does not exist in the current region or has been released.
404 Invalid.InstancePayType The specified InstancePayType is not valid. The error message returned because the InstancePayType parameter is invalid.

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