All Products
Search
Document Center

:ModifyInstanceNetworkSpec

最終更新日:Jan 25, 2024

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

Usage notes

Before you call this operation, take note of the following items:

  • Starting 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 bandwidth limit, submit a ticket. The following throttling policies apply:
    • In 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 automatically 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 is 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

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 ModifyInstanceNetworkSpec

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

InstanceId String Yes i-bp67acfmxazb4****

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

InternetMaxBandwidthOut Integer No 10

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

InternetMaxBandwidthIn Integer No 10

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 are 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 are 1 to the InternetMaxBandwidthOut value and the default value is the InternetMaxBandwidthOut value.
ISP String No null
Note This parameter is in invitational preview and is not publicly available.
NetworkChargeType String No PayByTraffic

The billing method for network usage. Valid values:

  • PayByBandwidth
  • PayByTraffic
Note If the pay-by-traffic billing method is used for network usage, the maximum inbound and outbound bandwidths are used as upper limits of bandwidths instead of the guaranteed performance. In scenarios in which demand outstrips resource supplies, the maximum bandwidth values may not be reached. If you require guaranteed bandwidths for your instance, use the pay-by-bandwidth billing method for network usage.
AllocatePublicIp Boolean No false

Specifies whether to assign a public IP address to the instance. Valid values:

  • true
  • false

Default value: false.

StartTime String No 2017-12-05T22:40Z

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).

EndTime String No 2017-12-06T22Z

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.
AutoPay Boolean No true

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.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that you want to use to ensure the idempotence of the request. You can use the client to generate a token. Make sure that a unique client token is used for each request. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Response parameters

Parameter

Type

Example

Description

OrderId String 123457890

The order ID.

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

The request ID.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=ModifyInstanceNetworkSpec
&InstanceId=i-bp67acfmxazb4p****
&InternetMaxBandwidthOut=10
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyInstanceNetworkSpecResponse>
    <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
    <OrderId>123457890</OrderId>
</ModifyInstanceNetworkSpecResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
  "OrderId" : "123457890"
}

Error codes

HttpCode

Error code

Error message

Description

400 InvalidInternetMaxBandwidthIn.ValueNotSupported The specified InternetMaxBandwidthIn is beyond the permitted range. The specified maximum inbound public bandwidth exceeds the maximum allowed value.
400 InvalidInternetMaxBandwidthOut.ValueNotSupported The specified InternetMaxBandwidthOut is beyond the permitted range. The specified maximum outbound public bandwidth exceeds the maximum allowed value.
400 OperationDenied Specified instance is in VPC. The instance resides in a virtual private cloud (VPC).
400 InvalidParameter.Conflict %s The specified parameter is invalid. Check whether a parameter conflict exists. %s is a variable. An error message is dynamically returned based on the call conditions.
400 ChargeTypeViolation The operation is not permitted due to billing method of the instance. The billing method of the instance does not support the operation.
400 InvalidStartTime.ValueNotSupported %s The end time cannot be earlier than the start time.
400 Account.Arrearage Your account has an outstanding payment. Your account has unpaid orders.
400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is invalid. The specified InternetChargeType parameter is invalid.
400 DecreasedBandwidthNotAllowed %s The bandwidth downgrade operation is invalid.
400 BandwidthUpgradeDenied.EipBoundInstance The specified VPC instance has bound EIP, temporary bandwidth upgrade is denied. The instance is associated with an elastic IP address (EIP), and the network bandwidth of the instance cannot be temporarily upgraded.
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. The value of ClientToken is invalid.
400 Throttling Request was denied due to request throttling, please try again after 5 minutes. Your request is throttled. Try again in 5 minutes.
400 InvalidAction Specified action is not valid. The operation is invalid.
400 IpAllocationError Allocate public ip failed. A public IP address cannot be assigned.
400 InvalidParam.AllocatePublicIp The specified param AllocatePublicIp is invalid. The specified value of AllocatePublicIp is invalid.
400 InstanceDowngrade.QuotaExceed Quota of instance downgrade is exceed. The maximum number of configuration downgrades allowed for the instance is exceeded.
400 InvalidBandwidth.ValueNotSupported Instance upgrade bandwidth of temporary not allow less then existed. The new bandwidth specified for the temporary bandwidth upgrade is lower than the current bandwidth.
400 InvalidInstanceStatus The specified instance status does not support this action. The instance is in a state that does not support the current operation.
400 InvalidInstance.UnPaidOrder Unpaid 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.
400 OperationDenied After 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.
400 InvalidInternetChargeType.ValueNotSupported %s The value of InternetChargeType is invalid.
400 LastOrderProcessing The previous order is still processing, please try again later. The order is being processed. Try again later.
400 OperationDenied The current user does not support this operation. Your account does not support this operation.
400 InvalidAction.WithActiveElasticUpgrade The instance has active Elastic Upgrade. The operation cannot be performed on the instance while the configurations of the instance are being temporarily upgraded. The configurations of the instance go through a temporary upgrade if the ModifyPrepayInstanceSpec operation is called with EndTime set.
400 InvalidParameter.Bandwidth %s The specified bandwidth is invalid. Check the parameter values.
400 InvalidParameter.DedicatedRegionNotSupported The specified action is rejected because the specified ECS instance in the dedicated region does not support public IP. The ECS instances in the dedicated region do not support the parameter.
403 IncorrectInstanceStatus The current status of the instance does not support this operation. This operation cannot be performed on the instance in the current state.
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. The instance is locked for security reasons.
403 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). The instance has expired or has an overdue payment. Renew or complete the payment for the instance and try again.
403 OperationDenied The operation is denied due to the instance is PrePaid. The instance is a subscription instance and does not support the operation.
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance. Your account balance is insufficient. Add funds to your account and try again.
403 InvalidInstance.UnPaidOrder The specified Instance has unpaid order. You have unpaid orders for the specified instance. Pay for the orders and try again.
403 InvalidInstance.InstanceNotSupported The 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.
403 InvalidInstanceStatus The current status of the instance does not support this operation. This operation cannot be performed on the instance in the current state.
403 InvalidInstance.EipNotSupport The specified instance with eip is not supported, please unassociate eip first. This operation cannot be performed on the instance that is associated with an EIP. Disassociate the EIP first.
403 OperationDenied.UnpaidOrder The specified instance has unpaid order. You have unpaid orders for the instance. You can log on to the ECS console to pay for the orders.
403 InvalidNetworkType.ValueNotSupported The specified parameter NetworkType is not valid. The specified network type is invalid.
403 IncorrectInstanceStatus The current status of the resource does not support this operation. This operation cannot be performed on the resource in the current state.
403 SecurityRisk.3DVerification We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. Risks are detected in your default credit card or debit card. Click the URL in the email for verification.
500 InternalError The request processing has failed due to some unknown error. An internal error occurred. Try again later.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred. Try again later.

For a list of error codes, see Service error codes.