ModifyInstanceNetworkSpec

Last Updated: Jan 29, 2018

Description

Modifies the bandwidth configuration of your ECS instance. If the network specification of your ECS instance is not suitable for your business scale, you can change the bandwidth configuration accordingly. When you call this interface, consider the following:

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

    • The configuration of bandwidth billed by PayByTraffic can be upgraded or downgraded.

    • An Internet IP is automatically assigned to an ECS instance when its bandwidth configurations is upgraded from zero Mbps.

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

    • The bandwidth configuration can be upgraded or downgraded.

    • The Internet IP is not assigned to an ECS instance when its bandwidth configurations is upgraded from zero Mbps. However, you can call AllocatePublicIpAddress to assign an Internet IP for a Pay-As-You-Go instance.

  • The parameters InternetMaxBandwidthIn and InternetMaxBandwidthOut can only be modified when the instance is in the Stopped or Running status.

  • After you upgrade the bandwidth configuration for a Classic network instance from zero Mbps, the instance must be restarted to make the change effective.

  • 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 registered credit card is invalid, you can set the AutoPay parameter to false to cancel the automatic bill 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.

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 The maximum outbound bandwidth to the Internet, measured in Mbps. Value range:
  • [0, 100]
InternetMaxBandwidthIn Integer No The maximum inbound bandwidth from the Internet, measured in Mbps. Value range:
  • [1, 200]
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 the payment is automatically completed or not. Optional values:
  • true: The payment goes through automatically, once 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.
  • 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 Autopay parameter to false to cancel the auto pay option. This results into an unpaid order and you can complete the order in the ECS console.
Default value: true.
ClientToken String No To guarantee 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

All parameters are common response parameters. For more information, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=ModifyInstanceNetworkSpec
  2. &InstanceId=i-23nn22421
  3. &InternetMaxBandwidthOut=20
  4. &<Common Request Parameters>

Response example

XML format

  1. <ModifyInstanceNetworkSpecResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
  3. </ModifyInstanceNetworkSpecResponse>

JSON format

  1. {
  2. "RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
  3. }
Error code Error message HTTP status code Meaning
Account.Arrearage Your account has an outstanding payment. 400 Your account has an outstanding payment.
DecreasedBandWidthNotAllowed A higher bandwidth than the current one is required. 400 You need a bandwidth upgrade.
InvalidInstance.UnpaidOrder The specified instance has unpaid order. 400 An unpaid order exist for the specified instance.
InvalidInstanceStatus.NotStopped The specified Instance status is not Stopped. 400 The specified instance must be in the 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 InternetMaxBandwidthIn 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 InstanceId does not exist.
InternalError The request processing has failed due to some unknown error, exception or failure. 500 Internal error, please try again later.
Thank you! We've received your feedback.