Assigns one or more IPv6 addresses to an elastic network interface (ENI).
Operation description
Usage notes
You can specify IPv6 addresses in the CIDR block of the vSwitch to which the ENI is connected. You can also specify the number of IPv6 addresses that the system assigns to the ENI. Take note of the following items:
-
IPv6 must be enabled on the vSwitch to which the ENI is connected. For more information, see Enable IPv6 for a vSwitch.
-
The ENI must be in the Available (Available) or InUse (InUse) state.
-
If you want to assign IPv6 addresses to a primary ENI, make sure that the Elastic Compute Service (ECS) instance to which the ENI is attached is in the Running (Running) or Stopped (Stopped) state.
-
The maximum number of IPv6 addresses that can be assigned to an ENI varies based on the instance type of the instance to which the ENI is attached.
- If the ENI is in the Available (Available) state, up to 10 IPv6 addresses can be assigned to the ENI.
- If the ENI is attached to an ECS instance, the maximum number of IPv6 addresses that can be assigned to the ENI varies based on the instance type. For more information, see Overview of instance families.
-
After the operation is called, you can obtain the IPv6 addresses that are assigned to the ENI from the response.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:AssignIpv6Addresses | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the ENI. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
NetworkInterfaceId | string | Yes | The ENI ID. | eni-bp1iqejowblx6h8j**** |
Ipv6AddressCount | integer | No | The number of IPv6 addresses to randomly generate for the ENI. Valid values: 1 to 10. Note
You must specify Ipv6Addresses.N or Ipv6AddressCount , but not both.
| 1 |
Ipv6Address | array | No | The IPv6 addresses to assign to the ENI. Valid values of N: 1 to 10. Example: Ipv6Address.1=2001:db8:1234:1a00::**** Note
You must specify Ipv6Addresses.N or Ipv6AddressCount , but not both.
| |
string | No | IPv6 address N to assign to the ENI. Valid values of N: 1 to 10. Example: Ipv6Address.1=2001:db8:1234:1a00::**** Note
You must specify Ipv6Addresses.N or Ipv6AddressCount , but not both.
| 2001:db8:1234:1a00::**** | |
Ipv6Prefix | array | No | The IPv6 prefixes to assign to the ENI. Valid values of N: 1 to 10. Note
To assign IPv6 prefixes to the ENI, you must specify Ipv6Prefix.N or Ipv6PrefixCount, but not both.
| |
string | No | IPv6 prefix N to assign to the ENI. Valid values of N: 1 to 10. Note
To assign IPv6 prefixes to the ENI, you must specify Ipv6Prefix.N or Ipv6PrefixCount, but not both.
| hide | |
Ipv6PrefixCount | integer | No | The number of IPv6 prefixes to assign to the ENI. Valid values: 1 to 10. Note
To assign IPv6 prefixes to the ENI, you must specify Ipv6Prefix.N or Ipv6PrefixCount, but not both.
| hide |
ClientToken | string | No | 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
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"NetworkInterfaceId": "eni-bp1iqejowblx6h8j****",
"Ipv6Sets": {
"Ipv6Address": [
"2001:db8:1234:1a00::****"
]
},
"Ipv6PrefixSets": {
"Ipv6Prefix": [
"hide"
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | UnsupportedParameter | %s | The parameter is not supported. |
400 | InvalidParameter | %s | The specified parameter is invalid. |
400 | InvalidInstanceID.Malformed | %s | The specified InstanceId parameter is invalid. |
400 | MissingParameter | %s | A parameter is not specified. |
400 | InValidParameter | %s | The specified parameter is invalid. |
400 | InvalidParams.EniId | %s | The specified EniId parameter is invalid. |
400 | InvalidOperation.InvalidEcsState | %s | - |
400 | InvalidOperation.InvalidEniState | %s | - |
400 | InvalidPrivateIpAddress.Duplicated | Specified private IP address is duplicated. | - |
400 | IncorrectVSwitchStatus | The current status of vSwitch does not support this operation. | - |
400 | InvalidParameter.Conflict | %s | The specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions. |
403 | InvalidUserType.NotSupported | %s | Your account does not support this operation. |
403 | Abs.InvalidAccount.NotFound | %s | Your Alibaba Cloud account does not exist or your AccessKey pair has expired. |
403 | Forbedden.NotSupportRAM | %s | RAM users are not authorized to perform this operation. |
403 | Forbbiden.SubUser | %s | You are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization. |
403 | InvalidOperation.InvalidEniType | %s | - |
403 | MaxEniIpv6IpsCountExceeded | %s | The maximum number of IPv6 addresses that can be assigned to the ENI has been reached. |
403 | InvalidIp.IpUnassigned | %s | The specified IP address is not assigned. |
403 | InvalidIp.IpRepeated | %s | The specified IP address already exists. |
403 | InvalidIp.IpAssigned | %s | The specified IP address is already assigned. |
403 | InvalidIp.Address | %s | - |
403 | InvalidOperation.EniCountExceeded | %s | - |
403 | InvalidOperation.Ipv4CountExceeded | %s | The operation is valid because the maximum number of IPv4 addresses has been reached. |
403 | InvalidOperation.Ipv6CountExceeded | %s | The operation is valid because the maximum number of IPv6 addresses has been reached. |
403 | InvalidOperation.Ipv6NotSupport | %s | - |
403 | InvalidOperation.Ipv4NotSupport | %s | - |
403 | InvalidVSwitch.Ipv6NotTurnOn | %s | The IPv6 feature is not enabled for your current vSwitch. Enable the feature and try again. |
403 | InvalidParam.IpAssign | %s | - |
403 | InvalidVSwitchId.IpInvalid | %s | The specified private IP address is invalid. |
403 | Forbidden.RegionId | %s | The service is unavailable in the current region. |
403 | InvalidOperation.EniServiceManaged | %s | The operation is invalid. |
403 | SecurityGroupInstanceLimitExceed | %s | - |
403 | InvalidOperation.HighPerformanceTrafficModeEniNotSupport | %s | - |
403 | InvalidOperation.EniTypeNotSupport | The member eni does not support ipv6. | - |
403 | InvalidIp.IpPrefixIllegal | The ip prefixes %s is/are illegal. | The IP address prefix is invalid and is not in the CIDR format. |
403 | InvalidIp.IpPrefixMaskIllegal | The ip prefix mask is illegal. | The IP address prefix mask is invalid. |
403 | InvalidIp.IpPrefixMaskInvalid | The ip prefixes mask %s is illegal which must be between %s and %s. | The IP address prefix mask is invalid and is not within the valid range. |
403 | InvalidIp.IpPrefixMaskNotSame | The ip prefixes %s are illegal which mask must be same. | The IP address prefix masks are not the same. |
403 | InvalidIp.IpPrefixMustInReserveSegment | The ip prefix must in vswitch reserve segment. | The IP address prefix is invalid and is not in the reserved CIDR block of the vSwitch. |
403 | InvalidIp.IpPrefixNotAvailable | The ip prefix is/are not available. | The IP address prefix is not available. |
403 | InvalidIp.IpPrefixNotStrict | The ip prefix must be strict cidr format. | The IP address prefix is invalid and is not in the CIDR format. |
403 | InvalidVSwitchId.IpPrefixNotEnough | The specified vSwitch has not enough ip prefix. | The number of IP address prefixes in the specified vSwitch is insufficient. |
403 | MissingParameter | These parameters %s cannot be both empty. | - |
404 | InvalidEniId.NotFound | %s | The specified ENI ID does not exist. |
404 | MaxEniIpv6IpsCountExceeded | The ipv6 address count exceed limitation. | - |
404 | InvalidOperation.VSwitchIpv6Disabled | The specified VSwitch does not support Ipv6 feature. | The specified VSwitch does not support IPv6. |
404 | InvalidOperation.EnableIpv6Failed | The specified VSwitch does not support Ipv6 feature. | - |
404 | InvalidIp.IpAssigned | The specified ipv6 has already been allocated. | - |
404 | InvalidVSwitchId.IpInvalid | The specified ipv6 does not match VSwitch cidr scope. | - |
404 | InvalidOperation.HasIpv6RouteEntry | The specified eni has been pointed to the next hop of the route. | - |
404 | InvalidOperation.VSwitchCidrReservationNotExist | The specified vSwitch has no cidr reservation. | - |
500 | InvalidOperation.RegionNotSupportIpPrefix | The current region does not support ip prefix. | You cannot assign IP address prefixes in this region. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-04-26 | The Error code has changed | View Change Details |
2021-07-05 | The Error code has changed. The response structure of the API has changed | View Change Details |