Add IPv6
Updated at:2025-10-20
This API is designed to add secondary IPv6 internal IPs to BCC instances.
Request structure
Plain Text
1POST /v{version}/instance/addIpv6 HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "instanceId": instanceId,
6 "ipv6Address": ipv6Address,
7 "reboot": reboot
8}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number |
| instanceId | String | Yes | requestBody parameters | Instance ID |
| ipv6Address | String | No | requestBody parameters | IPv6 address; an empty value indicates automatic IPv6 assignment |
| reboot | boolean | No | requestBody parameters | Whether to reboot. True indicates reboot; empty indicates no reboot |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| ipv6Address | String | Full IPv6 address for the primary network interface card |
Error codes
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| BadRequest | request is invalid | 400 | Invalid request parameters |
| NoSuchObject | The specified object is not found or resource do not exist. | 404 | The instance is not found or does not exist |
| BadRequest | instance has ipv6 already, please release ipv6 first | 400 | If the instance already has an IPv6 address, the IPv6 address must be released first |
| BadRequest | ipv6Address is invalid | 400 | Invalid IPv6 address |
| Instance.GetHostEnableIpv6Exception | get host enable ipv6 exception. | 400 | An exception occurs while retrieving whether the virtual machine kernel supports IPv6. |
| Instance.VMKernelVersionTooLowException | vm kernel version is too low to support ipv6, please purchase the vm which support ipv6. | 400 | The virtual machine version is too low. We recommend repurchasing a virtual machine that supports IPv6 |
| Vpc.AddIpv6Exception | Vpc add ipv6 exception. | 503 | An exception occurs while adding IPv6 to the VPC |
Request example
Plain Text
1POST http://bcc.bj.baidubce.com/v2/instance/addIpv6
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "instanceId": "i-123456",
7 "ipv6Address": "2400:da00:e003:2712::285",
8 "reboot": true
9}
Response example
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "ipv6Address": "2400:da00:e003:2712::285"
9}
