Add IPv6 Address Range by Network CIDR
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "Test-IPRange",
"networkCidr": "2002:2001::/64",
"addressMode": "SLAAC"
},
"systemTags": [],
"userTags": []
}In the preceding sample, systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"Test-IPRange","networkCidr":"2002:2001::/64","addressMode":"SLAAC"}}' http://localhost:8080/zstack/v1/l3-networks/92850b5a66633e2aa8c3a8ae6ebb541d/ipv6-ranges/by-cidrParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
name | String | body(contained in the params structure) | The name of the L3 Network. |
| 3.1.0 |
description (Optional) | String | body(contained in the params structure) | The detailed description of the L3 Network. |
| 3.1.0 |
l3NetworkUuid | String | url | The L3 Network UUID. |
| 3.1.0 |
networkCidr | String | body(contained in the params structure) | The network CIDR. |
| 3.1.0 |
addressMode | String | body(contained in the params structure) | The IPv6 address allocation mode. |
| 3.1.0 |
resourceUuid (Optional) | String | body(contained in the params structure) | The resource UUID. If specified, the L3 Network will use this field value as its UUID. |
| 3.1.0 |
systemTags (Optional) | List | body | The system tags. |
| 3.1.0 |
userTags (Optional) | List | body | The user tags. |
| 3.1.0 |
- ZSvirt supports specifying a DHCP server address when adding an IPv6 address range by network CIDR. Add the affinityGroup option to SystemTags.
- Option format:
flatNetwork::DhcpServer::{%s}::ipUuid::{%s} - Example:
flatNetwork::DhcpServer::192.168.1.100::ipUuid::null
- Option format:
API Response
Sample Response
{
"inventory": {
"l3NetworkUuid": "6735b2c2bc0c345892b7d66b1616d909",
"name": "Test-IPRange",
"networkCidr": "2002:2001::/64"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error | 3.1.0 |
| inventory | IpRangeInventory | For more information, see inventory | 3.1.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001 | 3.1.0 |
| description | String | The brief description of the error. | 3.1.0 |
| details | String | The details about the error. | 3.1.0 |
| elaboration | String | The reserved field. Default value: null | 3.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null | 3.1.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null | 3.1.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID, which uniquely identifies the resource. | 3.1.0 |
| l3NetworkUuid | String | The L3 Network UUID. | 3.1.0 |
| name | String | The resource name. | 3.1.0 |
| description | String | The detailed description of the resource. | 3.1.0 |
| startIp | String | 3.1.0 | |
| endIp | String | 3.1.0 | |
| netmask | String | 3.1.0 | |
| prefixLen | String | The prefix length. | 3.1.0 |
| gateway | String | 3.1.0 | |
| networkCidr | String | 3.1.0 | |
| ipVersion | Integer | The IP protocol number. | 3.1.0 |
| addressMode | String | The IPv6 address allocation mode. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
Java SDK
AddIpv6RangeByNetworkCidrAction action = new AddIpv6RangeByNetworkCidrAction();
action.name = "Test-IPRange";
action.l3NetworkUuid = "92850b5a66633e2aa8c3a8ae6ebb541d";
action.networkCidr = "2002:2001::/64";
action.addressMode = "SLAAC";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIpv6RangeByNetworkCidrAction.Result res = action.call();Python SDK
AddIpv6RangeByNetworkCidrAction action = AddIpv6RangeByNetworkCidrAction()
action.name = "Test-IPRange"
action.l3NetworkUuid = "92850b5a66633e2aa8c3a8ae6ebb541d"
action.networkCidr = "2002:2001::/64"
action.addressMode = "SLAAC"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIpv6RangeByNetworkCidrAction.Result res = action.call()