Network ResourcesDistributed Port Group Related Interfaces

ChangeL3NetworkState

PUT/zstack/v1/l3-networks/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeL3NetworkState": {
    "stateEvent": "enable"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding sample, both 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 '{"changeL3NetworkState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/l3-networks/a8744f1ba60c33f3a2c912c077f41fe5/actions

Request Parameters

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

The resource UUID.

 

0.6

stateEvent

String

body(contained in the changeL3NetworkState structure)

The state. The allowed values are enable and disable.

  • enable
  • disable

0.6

systemTags

List

body

Optional. The system tags.

 

0.6

userTags

List

body

Optional. The user tags.

 

0.6

API Response

Sample Response

{
  "inventory": {
    "name": "Test-L3Network",
    "l2NetworkUuid": "dfae4bce43694f4d9fc0ba5cdf4e38bd"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.0.6
inventoryL3NetworkInventorySee inventory.0.6

error

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

inventory

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.0.6
nameStringThe resource name.0.6
descriptionStringThe detailed description of the resource.0.6
typeString 0.6
zoneUuidStringThe Data Center UUID.0.6
l2NetworkUuidStringThe port group Distributed Switch UUID.0.6
stateString 0.6
dnsDomainString 0.6
systemBoolean 0.6
categoryString 0.6
ipVersionIntegerThe IP protocol number.3.1.0
enableIPAMBooleanEnable IP address management.4.10.16
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6
dnsList 0.6
ipRangesListSee ipRanges.0.6
networkServicesListSee networkServices.0.6
hostRouteListSee hostRoute.2.3
reservedIpRangesListSee reservedIpRanges.4.10.16

ipRange

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.0.6
l3NetworkUuidStringThe Distributed Port Group UUID.0.6
nameStringThe resource name.0.6
descriptionStringThe detailed description of the resource.0.6
startIpString 0.6
endIpString 0.6
netmaskString 0.6
prefixLenStringThe prefix length.3.1.0
gatewayString 0.6
networkCidrString 0.6
ipVersionIntegerThe IP protocol number.3.1.0
addressModeStringThe IPv6 address allocation mode.3.1.0
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6

networkServices

NameTypeDescriptionStarting Version
l3NetworkUuidStringThe Distributed Port Group UUID.0.6
networkServiceProviderUuidStringThe network service provider UUID.0.6
networkServiceTypeString 0.6

hostRoute

NameTypeDescriptionStarting Version
idLong 2.3
l3NetworkUuidStringThe Distributed Port Group UUID.2.3
prefixString 2.3
nexthopString 2.3
createDateTimestampThe creation date.2.3
lastOpDateTimestampThe last operation date.2.3

reservedIpRanges

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.4.10.16
l3NetworkUuidStringThe Distributed Port Group UUID.4.10.16
nameStringThe resource name.4.10.16
descriptionStringThe detailed description of the resource.4.10.16
startIpStringThe start IP address (included in the reserved address range).4.10.16
endIpStringThe end IP address (included in the reserved address range).4.10.16
ipVersionIntegerThe IP protocol number.4.10.16
createDateTimestampThe creation date.4.10.16
lastOpDateTimestampThe last operation date.4.10.16

SDK Sample

Java SDK

ChangeL3NetworkStateAction action = new ChangeL3NetworkStateAction();
action.uuid = "eb0849bf0e57400da650a09f2e852260";
action.stateEvent = "enable";
action.sessionId = "be8ec965ebd94169ba713c42dc079af9";
ChangeL3NetworkStateAction.Result res = action.call();

Python SDK

action = ChangeL3NetworkStateAction()
action.uuid = "a8744f1ba60c33f3a2c912c077f41fe5"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()