All Products
Search
Document Center

Elastic Compute Service:ModifyInstanceNetworkOptions

Last Updated:Nov 28, 2025

Modifies instance network configurations.

Operation description

When you call this operation, note that:

  • This is an asynchronous operation. The ID of the asynchronous task is returned after the call. Query the asynchronous task result to determine whether the execution is complete.
  • You can modify only one attribute at a time. If you modify multiple attributes, call this operation multiple times.
  • To modify the BandwidthWeighting, you must specify the specifications of the instance. You can use the DescribeInstanceTypes to query whether the current instance type supports bandwidth weights and the supported bandwidth weights.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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:ModifyInstanceNetworkOptionsupdate
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The ID of the instance whose network bandwidth weight is to be modified.

i-bp67acfmxazb4p****
BandwidthWeightingstringNo

The bandwidth weight.

The supported values vary with instance types. You can query the bandwidth weights supported by the current instance type by using the DescribeInstanceTypes .

Valid values:

  • Vpc-L1: Vpc-L1.
  • Vpc-L2: Vpc-L2.
  • Ebs-L1: Ebs-L1.
  • Ebs-L2: Ebs-L2.
  • Default: the Default.
Vpc-L1

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
TaskIdstring

The ID of the task for which the bandwidth weight is modified.

You can use the DescribeTaskAttribute interface to modify the bandwidth weight result.

t-bp198jigq7l0h5ac****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TaskId": "t-bp198jigq7l0h5ac****"
}

Error codes

HTTP status codeError codeError messageDescription
400IdempotentParameterMismatchThe request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.-
400InvalidInstanceType.NetworkOptionsBandwidthWeightingUnsupportedThe current instance type does not support setting or modifying the BandwidthWeighting parameter.The current instance type does not support setting or modifying the BandwidthWeighting parameter.
400InvalidParameter.NetworkOptionsBandwidthWeightingThe specified parameter BandwidthWeighting is not valid.The correct value should be in [%s].The specified parameter BandwidthWeighting is not valid.The correct value should be in [%s].
404InvalidInstanceId.NotFoundSpecified instance does not exist.The specified instance does not exist. Check whether the instance ID is correct.

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