Network ResourcesDistributed Port Group Related Interfaces

Change L3 Network DHCP IP Address

PUT/zstack/v1/l3-networks/{l3NetworkUuid}/dhcp-ip

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeL3NetworkDhcpIpAddress": {
    "dhcpServerIp": "192.168.1.100",
    "dhcpv6ServerIp": "2024:04:28:01::100"
  },
  "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 PUT -d '{"changeL3NetworkDhcpIpAddress":{"dhcpServerIp":"192.168.1.100","dhcpv6ServerIp":"2024:04:28:01::100"}}' \
http://localhost:8080/zstack/v1/l3-networks/6b693b00316b30819bb30bfe0df10256/dhcp-ip

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
l3NetworkUuidStringurlThe L3 Network UUID. 4.10.16
dhcpServerIp (Optional)Stringbody(contained in the changeL3NetworkDhcpIpAddress structure)The DHCP v4 server address. 4.10.16
dhcpv6ServerIp (Optional)Stringbody(contained in the changeL3NetworkDhcpIpAddress structure)The DHCP v6 server address. 4.10.16
systemTags (Optional)ListbodyThe system tags. 4.10.16
userTags (Optional)ListbodyThe user tags. 4.10.16

API Response

Sample Response

{
  "dhcpServerIp": "192.168.100.3",
  "dhcpv6ServerIp": "2024:04:28:01::100"
}
NameTypeDescriptionStarting Version
dhcpServerIpString 4.10.16
dhcpv6ServerIpString 4.10.16
successboolean 4.10.16
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error4.10.16

error

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

SDK Sample

Java SDK

ChangeL3NetworkDhcpIpAddressAction action = new ChangeL3NetworkDhcpIpAddressAction();
action.l3NetworkUuid = "6b693b00316b30819bb30bfe0df10256";
action.dhcpServerIp = "192.168.1.100";
action.dhcpv6ServerIp = "2024:04:28:01::100";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeL3NetworkDhcpIpAddressAction.Result res = action.call();

Python SDK

action = ChangeL3NetworkDhcpIpAddressAction()
action.l3NetworkUuid = "6b693b00316b30819bb30bfe0df10256"
action.dhcpServerIp = "192.168.1.100"
action.dhcpv6ServerIp = "2024:04:28:01::100"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()