Network ResourcesDistributed Port Group Related Interfaces

Add IPv6 Address Range

POST/zstack/v1/l3-networks/{l3NetworkUuid}/ipv6-ranges

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "Test-IP-Range",
    "startIp": "2002:2001::02",
    "endIp": "2002:2001::FE",
    "gateway": "2002:2001::01",
    "prefixLen": 64,
    "addressMode": "Stateful-DHCP"
  },
  "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-IP-Range","startIp":"2002:2001::02","endIp":"2002:2001::FE","gateway":"2002:2001::01","prefixLen":64.0,"addressMode":"Stateful-DHCP"}}' http://localhost:8080/zstack/v1/l3-networks/b6f82aa00c3f37adba4b349eb427db80/ipv6-ranges

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

l3NetworkUuid

String

url

The L3 Network UUID.

 

3.1.0

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

startIp

String

body(contained in the params structure)

The start IP address.

 

3.1.0

endIp

String

body(contained in the params structure)

The end IP address.

 

3.1.0

gateway

String

body(contained in the params structure)

The gateway.

 

3.1.0

prefixLen

Integer

body(contained in the params structure)

The prefix length.

 

3.1.0

addressMode

String

body(contained in the params structure)

The IPv6 address allocation mode.

  • SLAAC
  • Stateful-DHCP
  • Stateless-DHCP

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. Add the affinityGroup option to SystemTags.
    • Option format: flatNetwork::DhcpServer::{%s}::ipUuid::{%s}
    • Example: flatNetwork::DhcpServer::192.168.1.100::ipUuid::null

API Response

Sample Response

{
  "inventory": {
    "l3NetworkUuid": "10d6128c8f473a63889597becc396bba",
    "name": "Test-IP-Range",
    "startIp": "2002:2001::02",
    "endIp": "2002:2001::FE",
    "netmask": "FFFF:FFFF:FFFF:FFFF:0:0:0:0",
	"prefixLen": "64"
    "gateway": "2002:2001::01"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error3.1.0
inventoryIpRangeInventoryFor more information, see inventory3.1.0

error

NameTypeDescriptionStarting Version
codeStringThe error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.10013.1.0
descriptionStringThe brief description of the error.3.1.0
detailsStringThe details about the error.3.1.0
elaborationStringThe reserved field. Default value: null3.1.0
opaqueLinkedHashMapThe reserved field. Default value: null3.1.0
causeErrorCodeThe root error, which is the associated root cause of the current error. If no root error exists, this parameter is null3.1.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe resource UUID, which uniquely identifies the resource.3.1.0
l3NetworkUuidStringThe L3 Network UUID.3.1.0
nameStringThe resource name.3.1.0
descriptionStringThe detailed description of the resource.3.1.0
startIpString 3.1.0
endIpString 3.1.0
netmaskString 3.1.0
prefixLenStringThe prefix length.3.1.0
gatewayString 3.1.0
networkCidrString 3.1.0
ipVersionIntegerThe IP protocol number.3.1.0
addressModeStringThe IPv6 address allocation mode.3.1.0
createDateTimestampThe creation date.3.1.0
lastOpDateTimestampThe last operation date.3.1.0

SDK Sample

Java SDK

AddIpv6RangeAction action = new AddIpv6RangeAction();
action.l3NetworkUuid = "b6f82aa00c3f37adba4b349eb427db80";
action.name = "Test-IP-Range";
action.startIp = "2002:2001::02";
action.endIp = "2002:2001::FE";
action.gateway = "2002:2001::01";
action.prefixLen = 64;
action.addressMode = "Stateful-DHCP";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIpv6RangeAction.Result res = action.call();

Python SDK

AddIpv6RangeAction action = AddIpv6RangeAction()
action.l3NetworkUuid = "b6f82aa00c3f37adba4b349eb427db80"
action.name = "Test-IP-Range"
action.startIp = "2002:2001::02"
action.endIp = "2002:2001::FE"
action.gateway = "2002:2001::01"
action.prefixLen = 64
action.addressMode = "Stateful-DHCP"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIpv6RangeAction.Result res = action.call()