Modifies the bandwidth configuration of your Instance. If the network specification of your ECS instance is not suitable for your business scale, you can change the bandwidth configuration accordingly.

Description

When you call this interface, consider the following:

  • When you change the bandwidth configuration of a Subscription (PrePaid) instance, consider the following:

    • The configuration of bandwidth that is PayByTraffic(Pay By Traffic) can be upgraded or downgraded.

    • The instance has an Internet IP allocated when the InternetMaxBandwidthOut (InternetMaxBandwidthOut) is upgraded from 0 Mbps.

  • When you change the bandwidth configuration of a Pay-As-You-Go (Pay-As-You-Go) instance, consider the following:

    • The bandwidth configuration can be upgraded or downgraded.

    • The instance has no Internet IP allocated when the InternetMaxBandwidthOut (InternetMaxBandwidthOut) is upgraded from zero Mbps. However, you can call AllocatePublicIpAddress  to allocate Internet IP address for the instance.

  • For classic type instances, when InternetMaxBandwidthOut(InternetMaxBandwidthOut) is upgraded from 0 Mbps, the instance must be in the Stopped (Stopped) status.

  • Before going ahead with an upgrade, you must make sure that you have registered a valid credit card, once you upgrade the bandwidth configuration, auto-payment is initiated. If the payment is unsuccessful, an abnormal order is returned and can only be nullified.

    If your account balance is insufficient, you can set the parameter  AutoPay to false to cancel the automatic payment. Thus, an unpaid order is returned and you can complete the order by making the payment in the ECS console.

  • The bandwidth cannot be changed again within five minutes after the action is performed.

  • The bandwidth of a Subscription instance can only be downgraded three times.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: ModifyInstanceNetworkSpec.
InstanceId String Yes ID of the instance.
InternetMaxBandwidthOut Integer No Maximum value of public network outbound bandwidth; unit: Mbps (Megabit per second). Value range: [1, 100].
InternetMaxBandwidthIn Integer No The maximum inbound bandwidth from the Internet, measured in Mbps. Value range: [1, 100].
NetworkChargeType String No The billing method of the bandwidth. Optional values:
  • PayByTraffic: The bandwidth is billed by the sum of network traffic.
Autopay Boolean  No Whether or not automatic payment is enabled. Optional values:
  • true: The payment goes through automatically after you upgrade the bandwidth configuration. However, before that, you must make sure that your registered credit card is valid and does not have credit limit set. Moreover, if you choose PayPal, you must maintain sufficient balance in your account. If the auto payment attempt is unsuccessful, an abnormal order returns and can only be nullified. However, before you set Autopay to True you must make sure that your registered credit card is valid and does not have credit limit set. Moreover, if you choose PayPal, you must maintain sufficient balance in your account.
  • false: The payment does not go through automatically, once you upgrade the bandwidth configuration. When your registered credit card is invalid or you have insufficient balance in your PayPal account, you can set the AutoPay parameter to false to cancel the auto-payment option. This results into an unpaid order and you can complete the order ECS console .
Default value: True.
ClientToken String No Guarantees the idempotence of the request. The value is generated by a client. It must be unique among all requests and contains a maximum of 64 ASCII characters. For more information, see How to ensure idempotence.

Response parameters

Name Type Description
RequestId String The ID of the request.
Orderid Long Order ID.

Examples

Request example
https://ecs.aliyuncs.com/?Action=ModifyInstanceNetworkSpec
&RegionId=cn-hangzhou
&InstanceId=i-xxxxx1
&InternetMaxBandwidthOut=10
&ClientToken=xxxxxxxxxxxxxx
&<Common Request Parameters>
Response sample

XML format

<ModifyInstanceNetworkSpecResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
</ModifyInstanceNetworkSpecResponse>
JSON format
{
      "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

Error codes specific to this interface are as follows. For more error codes, visit API Error Center.

Error code Error message HTTP status code  Description
Account.Arrearage Your account has an outstanding payment. 400 Your account has an overdue payment.
DecreasedBandWidthNotAllowed A higher bandwidth than the current one is required. 400 The new bandwidth cannot be less than the existing bandwidth.
InvalidInstance.UnpaidOrder The specified instance has unpaid order. 400 The current instance has unpaid orders.
InvalidInstanceStatus.NotStopped The specified Instance status is not Stopped. 400 The instance is not in a Stopped status.
InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is invalid. 400 The specified InternetChargeType does not exist.
InvalidInternetMaxBandwidthIn.ValueNotSupported The specified InternetMaxBandwidthIn is beyond the permitted range. 400 The value range of InternetMaxBandwidthIn is [1, 200].
InvalidInternetMaxBandwidthOut.ValueNotSupported The specified InternetMaxBandwidthOut is beyond the permitted range. 400 The value range of InternetMaxBandwidthOut is [0, 100].
MissingParameter The input parameter “InstanceId” that is mandatory for processing this request is not supplied. 400 You must specify the InstanceId.
OperationDenied Specified instance is in VPC. 400 A VPC instance does not support this operation.
ChargeTypeViolation The operation is not permitted due to billing method of the instance. 403 The billing method of the instance does not support this operation.
IncorrectInstanceStatus The current status of the instance does not support this operation. 403 The status of the instance does not support this operation.
InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). 403 Your subscription ECS instance has expired. Or your Pay-As-You-Go instance has an overdue payment.
InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 403 The instance is locked for security reasons.
InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance. 403 Your registered credit card is invalid or you have insufficient balance in your PayPal account.
OperationDenied The operation is denied due to the instance is PrePaid. 403 The operation is denied for a Subscription instance.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified InstanceIds does not exist.
InternalError The request processing has failed due to some unknown error, exception or failure.  500 Internal error. Try again later.