AssignIpv6Addresses

Last updated: 2020-10-16 18:47:00

1. API Description

Domain name for API request: vpc.tencentcloudapi.com.

This API (AssignIpv6Addresses) is used to apply for an IPv6 address for the ENI.

This API is completed asynchronously. If you need to query the async execution results, use the RequestId returned by this API to query the QueryTask API.

  • An ENI can only be bound with a limited number of IPs. For more information about resource limits, seeENI use limits.
  • You can specify the IPv6 address when applying. The address type cannot be the primary IP. Currently, IPv6 can only be supported as the secondary IP.
  • The address must be unoccupied and is in the subnet to which the ENI belongs.
  • When applying for one to multiple secondary IPv6 addresses on ENI, the API will return the specified number of secondary IPv6 addresses in the subnet range where the ENI is located.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: AssignIpv6Addresses.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
NetworkInterfaceId Yes String The ID of the ENI instance, such as eni-m6dyj72l.
Ipv6Addresses.N No Array of Ipv6Address A list of IPv6 addresses. You can specify a maximum of 10 at one time. The quota is calculated together with that of Ipv6AddressCount, a required input parameter alternative to this one.
Ipv6AddressCount No Integer The number of automatically assigned IPv6 addresses. The total number of private IP addresses cannot exceed the quota. The quota is calculated together with that of Ipv6Addresses, a required input parameter alternative to this one.

3. Output Parameters

Parameter Name Type Description
Ipv6AddressSet Array of Ipv6Address The list of IPv6 addresses assigned to ENIs.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Assigning the specified IPv6 address

Input Example

https://vpc.tencentcloudapi.com/?Action=AssignIpv6Addresses
&NetworkInterfaceId=eni-5u5biujl
&Ipv6Addresses.0.Address=3402:4e00:20:1202::1
&Ipv6Addresses.0.Primary=false
&Ipv6Addresses.0.Description=test1
&Ipv6Addresses.1.Address=3402:4e00:20:1202::2
&Ipv6Addresses.1.Primary=false
&Ipv6Addresses.1.Description=test2
&<Common Request Parameters>

Output Example

{
  "Response": {
    "Ipv6AddressSet": [
      {
        "Address": "3402:4e00:20:1202::1",
        "AddressId": "",
        "Primary": false,
        "PublicIpAddress": "3402:4e00:20:1202::1",
        "Description": "test1",
        "IsWanIpBlocked": false,
        "State": "PENDING"
      },
      {
        "Address": "3402:4e00:20:1202::2",
        "AddressId": "",
        "Primary": false,
        "PublicIpAddress": "3402:4e00:20:1202::2",
        "Description": "test2",
        "IsWanIpBlocked": false,
        "State": "PENDING"
      }
    ],
    "RequestId": "4a8d6fc0-bc48-4394-b1f7-2818a217359a"
  }
}

Example2 Assigning IPv6 addresses by number automatically

Input Example

https://vpc.tencentcloudapi.com/?Action=AssignIpv6Addresses
&NetworkInterfaceId=eni-5u5biujl
&Ipv6AddressCount=2
&<Common Request Parameters>

Output Example

{
  "Response": {
    "Ipv6AddressSet": [
      {
        "Address": "3402:4e00:20:1202:0:8d05:c272:f514",
        "AddressId": "",
        "Primary": false,
        "PublicIpAddress": "3402:4e00:20:1202:0:8d05:c272:f514",
        "Description": "",
        "IsWanIpBlocked": false,
        "State": "PENDING"
      },
      {
        "Address": "3402:4e00:20:1202:0:8d05:c272:f559",
        "AddressId": "",
        "Primary": false,
        "PublicIpAddress": "3402:4e00:20:1202:0:8d05:c272:f559",
        "Description": "",
        "IsWanIpBlocked": false,
        "State": "PENDING"
      }
    ],
    "RequestId": "4a8d6fc0-bc48-4394-b1f7-2818a217359a"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidParameterValue Incorrect parameter value.
LimitExceeded.Address The number of assigned IP addresses has reached the upper limit.
MissingParameter Missing parameter.
ResourceInUse.Address The specified IP address is already in use.
UnsupportedOperation.InvalidState Invalid resource status.
UnsupportedOperation.MutexOperationTaskRunning The resource mutual exclusion operation is being executed.
UnsupportedOperation.UnassignCidrBlock IPv6 IP range is not assigned.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help