All Products
Search
Document Center

Elastic Compute Service:ModifyInstanceNetworkSpec

Last Updated:Nov 14, 2024

Modifies the bandwidth configuration of an Elastic Compute Service (ECS) instance. You can modify the bandwidth configurations of an instance to improve network performance.

Operation description

Take note of the following items:

  • From November 27, 2020, the maximum bandwidth value available for you to create ECS instances or to change ECS instance configurations is subject to the throttling policy for your account. To increase the maximum bandwidth value, submit a ticket. The following throttling policies apply:

    • Within a single region, the sum of actual peak bandwidths of all ECS instances that use the pay-by-traffic billing method for network usage cannot exceed 5 Gbit/s.
    • Within a single region, the sum of actual peak bandwidths of all ECS instances that use the pay-by-bandwidth billing method for network usage cannot exceed 50 Gbit/s.
  • If you upgrade the outbound public bandwidth (InternetMaxBandwidthOut) of a subscription (PrePaid) instance from 0 Mbit/s when you modify the bandwidth configurations of the instance, a public IP address is automatically assigned to the instance.

  • If you upgrade the outbound public bandwidth (InternetMaxBandwidthOut) of a pay-as-you-go (PostPaid) instance from 0 Mbit/s when you modify the bandwidth configurations of the instance, no public IP address is assigned to the instance. You must set AllocatePublicIp to true or call the AllocatePublicIpAddress operation to assign a public IP address to the instance.

  • An instance in the classic network must be in the Stopped state before you can upgrade its outbound public bandwidth (InternetMaxBandwidthOut) from 0 Mbit/s.

  • After the bandwidth is upgraded, AutoPay is set to true by default and the payment is automatically made. Make sure that your account balance is sufficient. Otherwise, your order becomes invalid and must be canceled. If your account balance is insufficient, you can set AutoPay to false. In this case, when you call the ModifyInstanceNetworkSpec operation, an unpaid order is generated. Then, you can log on to the ECS console to pay for the order.

  • The price difference is refunded to the payment account that you used. Vouchers or coupons that have been redeemed cannot be returned.

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
ecs:ModifyInstanceNetworkSpecupdate
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance for which you want to modify bandwidth configurations.

i-bp67acfmxazb4****
InternetMaxBandwidthOutintegerNo

The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100.

10
InternetMaxBandwidthInintegerNo

The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:

  • If the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of this parameter range from 1 to 10, and the default value is 10.
  • If the purchased outbound public bandwidth is greater than 10 Mbit/s, the valid values of this parameter range from 1 to the value of InternetMaxBandwidthOut, and the default value is the value of InternetMaxBandwidthOut.
10
ISPstringNo
Note This parameter is in invitational preview and is not publicly available.
null
NetworkChargeTypestringNo

The billing method for network usage. Valid values:

  • PayByBandwidth
  • PayByTraffic
Note When the pay-by-traffic billing method for network usage is used, the maximum inbound and outbound bandwidth values are used as the upper limits of bandwidths instead of guaranteed values. In scenarios where demand outstrips resource supplies, these maximum bandwidths may be limited. If you want guaranteed bandwidths for your instance, use the pay-by-bandwidth billing method for network usage.
PayByTraffic
AllocatePublicIpbooleanNo

Specifies whether to allocate a public IP address.

Default value: false.

false
StartTimestringNo

The start time of the temporary bandwidth upgrade. Specify the time in the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format. The time must be in UTC and accurate to minutes (mm).

2017-12-05T22:40Z
EndTimestringNo

The end time of the temporary bandwidth upgrade. Specify the time in the ISO 8601 standard in the yyyy-MM-ddThhZ format. The time must be in UTC and accurate to hours (hh).

Note The interval between the end time and the start time of the temporary bandwidth upgrade must be greater than or equal to 3 hours.
2017-12-06T22Z
AutoPaybooleanNo

Specifies whether to automatically complete the payment. Valid values:

  • true: After you modify the bandwidth configurations, the payment is automatically complete. Make sure that you have a sufficient balance in your account before you set AutoPay to true. If your account balance is insufficient, your order cannot be paid in the ECS console and becomes invalid. You must cancel the order.
  • false: After you modify the bandwidth configurations, an order is generated but the payment is not complete. If your account balance is insufficient, you can set AutoPay to false to generate an unpaid order. Then, you can log on to the ECS console to pay for the order.

Default value: true.

true
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000

Response parameters

ParameterTypeDescriptionExample
object
OrderIdstring

The order ID.

123457890
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "OrderId": "123457890",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidInternetMaxBandwidthIn.ValueNotSupportedThe specified InternetMaxBandwidthIn is beyond the permitted range.The specified maximum inbound public bandwidth exceeds the maximum allowed value.
400InvalidInternetMaxBandwidthOut.ValueNotSupportedThe specified InternetMaxBandwidthOut is beyond the permitted range.The specified maximum outbound public bandwidth exceeds the maximum allowed value.
400OperationDeniedSpecified instance is in VPC.The instance resides in a VPC.
400InvalidParameter.Conflict%sThe specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidStartTime.ValueNotSupportedThe specified StartTime is out of the permitted range.The specified start time is invalid.
400InvalidEndTime.ValueNotSupportedThe specified EndTime is out of the permitted range.The specified end time is invalid.
400ChargeTypeViolationThe operation is not permitted due to billing method of the instance.-
400InvalidStartTime.ValueNotSupported%sThe specified parameter StartTime cannot be earlier than the current time.
400Account.ArrearageYour account has an outstanding payment.Your account has overdue payments.
400InvalidEndTime.ValueNotSupported%s-
400InvalidInternetChargeType.ValueNotSupportedThe specified InternetChargeType is invalid.The specified InternetChargeType parameter is invalid.
400DecreasedBandwidthNotAllowed%sThe bandwidth downgrade operation is invalid.
400BandwidthUpgradeDenied.EipBoundInstanceThe specified VPC instance has bound EIP, temporary bandwidth upgrade is denied.The instance is associated with an EIP and cannot have its bandwidth temporarily upgraded.
400InvalidClientToken.ValueNotSupportedThe ClientToken provided is invalid.The specified ClientToken parameter is invalid.
400ThrottlingRequest was denied due to request throttling, please try again after 5 minutes.-
400InvalidInstanceStatus.NotStoppedThe specified Instance status is not Stopped.The specified instance is not in the Stopped state.
400InvalidActionSpecified action is not valid.The operation is invalid.
400IpAllocationErrorAllocate public ip failed.A public IP address cannot be assigned.
400InvalidParam.AllocatePublicIpThe specified param AllocatePublicIp is invalid.The specified AllocatePublicIp parameter is invalid.
400InstanceDowngrade.QuotaExceedQuota of instance downgrade is exceed.The maximum number of configuration downgrades allowed for the instance has been reached.
400InvalidBandwidth.ValueNotSupportedInstance upgrade bandwidth of temporary not allow less then existed.-
400InvalidInstanceStatusThe specified instance status does not support this action.The instance is in a state that does not support the current operation.
400InvalidInstance.UnPaidOrderUnpaid order exists in your account, please complete or cancel the payment in the expense center.Your account has an unpaid order. Pay for the order and try again.
400OperationDeniedAfter downgrade, you cannot upgrade or downgrade your instances again in the remaining time of the current billing cycle.After you downgrade the configurations of the instance, you cannot upgrade or downgrade the configurations again until the new billing cycle starts.
400InvalidInternetChargeType.ValueNotSupported%sThe specified InternetChargeType parameter is invalid.
400LastOrderProcessingThe previous order is still processing, please try again later.The order is being processed. Try again later.
400OperationDeniedThe current user does not support this operation.Your account does not support this operation.
400LastRequestProcessingThe previous request is still processing, please try again later.-
400InvalidStartTime.BeyondLifeCycleThe specified start time exceeds the expiration time.-
400InvalidEndTime.BeyondLifeCycleThe specified end time exceeds the expiration time.-
400InvalidPayMethod.SyncPaymentNotSupportSynchronous payment is not supported. Use another payment method.-
400InvalidBandwidthOut.LessThanZeroThe bandwidth must be larger than 0 when specifying isp.-
400InvalidParameter.BandwidthBiggerThanBaseBandwidth%s-
400InvalidAction.WithActiveElasticUpgradeThe instance has active Elastic Upgrade.The operation is not supported while the instance are being temporarily upgraded. The instance goes through a temporary configuration upgrade if the EndTime parameter is specified to call the ModifyPrepayInstanceSpec operation.
400InvalidParameter.CloudboxNotSupported%s-
400InvalidParameter.Bandwidth%sThe specified bandwidth value is invalid.
400NoPermission.PriceThe operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true.-
400NoPermission.RefundThe operation requires refund permission. Please apply for permission from your main account.-
400InvalidParameter.DedicatedRegionNotSupportedThe specified action is rejected because the specified ECS instance in the dedicated region does not support public IP.Parameter error codes not supported in the dedicated region
400InvalidOperation.InstanceStatusUnsupportedThe specified instance status is not supported for this operation, expect status is Running or Stopped.The status of the specified instance is not satisfied. The status of the instance should be Running or Stopped.
400QuotaExceeded.InternetBandwidth%s.Under your current account, the public network bandwidth of the Pay-As-You-Go ECS instance charged by fixed bandwidth exceeds the total bandwidth quota limit.
403IncorrectInstanceStatusThe current status of the instance does not support this operation.The instance is in a state that does not support the current operation.
403InstanceLockedForSecurityThe specified operation is denied as your instance is locked for security reasons.-
403InstanceExpiredOrInArrearsThe specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).The subscription instance has expired. You must renew the instance before you can proceed.
403OperationDeniedThe operation is denied due to the instance is PrePaid.Subscription instances do not support this operation.
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
403InvalidInstance.UnPaidOrderThe specified Instance has unpaid order.The specified instance has a purchase order not paid for.
403InvalidInstance.InstanceNotSupportedThe special vpc instance with eip not need bandwidth.The instance resides in a VPC and is associated with an EIP. You cannot specify a public bandwidth for the instance.
403InvalidInstanceStatusThe current status of the instance does not support this operation.The instance is in a state that does not support the current operation.
403InvalidOperation.StarterPackageStarterPackage not support modification.-
403NAT_PUBLIC_IP_BINDING_FAILEDBinding nat public ip failed.-
403InvalidInstance.EipNotSupportThe specified instance with eip is not supported, please unassociate eip first.The operation is not supported while an EIP is associated with the instance. Disassociate the EIP first.
403InvalidInstance.NatPortMapNotSupportThe special instance with nat port map not support operate, please remove nat port map first.-
403OperationDenied.UnpaidOrderThe specified instance has unpaid order.Your account has unpaid orders for the specified instance. You can log on to the ECS console to pay for the orders.
403Mayi.InternalErrorThe request processing has failed due to some unknown error.-
403InvalidNetworkType.ValueNotSupportedThe specified parameter NetworkType is not valid.The specified NetworkType parameter is invalid.
403OperationDenied.ImageNotValidThe specified image is not authorized.You are not authorized to use this image.
403InvalidInstanceChargeType.ValueNotSupportedThe specified parameter ChargeType is not valid.-
403IncorrectInstanceStatusThe current status of the resource does not support this operation.The resource is in a state that does not support the current operation.
403InvalidIspType.ValueNotSupported%s-
403UnsupportedIspChargeType%s-
403UnsupportedIspClassicNetwork%s-
403UnsupportedIspNetworkChargeType%s-
403InvalidIspBandwidthOut%s-
403UnsupportedChangeIsp%s-
403InvalidIspUID%s-
403UnsupportedIspRegion%s-
403BandIncreaseNotSupportIsp%s-
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.-
403InvalidOperation.PublicIpAddressNoStockThe public IP address for the specified Region or ChargeType of the instance is out of stock. Please try another Region or ChargeType.Under the conditions of the specified region or payment type, the public IP address inventory of the instance is insufficient. Please try another region or payment type.
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error has occurred. Try again later.
500Image.OrderFailedCreate marketplace image order failed.-

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

Change history

Change timeSummary of changesOperation
2024-09-27The Error code has changedView Change Details
2024-09-23The Error code has changedView Change Details
2024-01-30The Error code has changedView Change Details
2024-01-08The Error code has changedView Change Details
2023-10-10The Error code has changedView Change Details