Network ResourcesDistributed Switch Related Interfaces

UpdateL2Network

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateL2Network": {
    "name": "Test-Net",
    "description": "Test"
  },
  "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 '{"updateL2Network":{"name":"Test-Net","description":"Test"}}' \
http://localhost:8080/zstack/v1/l2-networks/8a44ece25f973842b841591a554f5fee/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlThe resource UUID. 0.6
name (Optional)Stringbody (contained in updateL2Network structure)The name of the L2 network. 0.6
description (Optional)Stringbody (contained in updateL2Network structure)The detailed description of the L2 network. 0.6
systemTags (Optional)ListbodyThe system tags. 0.6
userTags (Optional)ListbodyThe user tags. 0.6

API Response

Sample Response

{
  "inventory": {
    "vlan": 10,
    "name": "Test-Net",
    "description": "Test",
    "zoneUuid": "fa938a0c3dc437748ba603836bb59fda",
    "physicalInterface": "eth0",
    "type": "L2VlanNetwork"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation fails, or vice versa. The value is null on success. See error.0.6
inventoryL2NetworkInventorySee 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
elaborationStringReserved field. Default value: null.0.6
opaqueLinkedHashMapReserved 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
zoneUuidStringThe Data Center UUID.0.6
physicalInterfaceStringPhysical NIC.0.6
typeStringDistributed Switch type.0.6
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6
attachedClusterUuidsListThe list of attached Cluster UUIDs.0.6

SDK Sample

Java SDK

UpdateL2NetworkAction action = new UpdateL2NetworkAction();
action.uuid = "f7ea5335fcab4d438069879d62384b0e";
action.name = "Test-Net";
action.description = "Test";
action.sessionId = "05627ec42486449cb6b422ef927829f1";
UpdateL2NetworkAction.Result res = action.call();

Python SDK

UpdateL2NetworkAction action = UpdateL2NetworkAction()
action.uuid = "7dc08ad01b8a4d578aab2ae0ad750f1b"
action.name = "Test-Net"
action.description = "Test"
action.sessionId = "130b064e63204a479857ced03f550cf2"
UpdateL2NetworkAction.Result res = action.call()