Network ResourcesDistributed Switch Related Interfaces

AttachL2NetworkToCluster

POST/zstack/v1/l2-networks/{l2NetworkUuid}/clusters/{clusterUuid}

Headers

OAuth: the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST http://localhost:8080/zstack/v1/l2-networks/e852ba6eb4c03f2fafdb73ce838d8980/clusters/112816423a1a3b50a58d54fd1f6a8665

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

l2NetworkUuid

String

url

The port group Distributed Switch UUID.

 

0.6

clusterUuid

String

url

The cluster UUID.

 

0.6

l2ProviderType (Optional)

String

body

Optional. The Distributed Switch implementation type.

  • LinuxBridge

4.8.0

systemTags (Optional)

List

body

Optional. The system tags.

 

0.6

userTags (Optional)

List

body

Optional. The user tags.

 

0.6

hostParams (Optional)

String

body

Optional. The host parameter list.

 

4.3.0

API Response

Sample Response

{
  "inventory": {
    "vlan": 10.0,
    "name": "Test-Net",
    "description": "Test",
    "zoneUuid": "95ab67ece21e3ce39896b9b391a21a94",
    "physicalInterface": "eth0",
    "type": "L2VlanNetwork"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.8.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.4.8.0
inventoryL2NetworkInventorySee inventory.4.8.0

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
zoneUuidStringThe Data Center UUID.0.6
physicalInterfaceStringThe physical NIC.0.6
typeStringThe Distributed 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

AttachL2NetworkToClusterAction action = new AttachL2NetworkToClusterAction();
action.l2NetworkUuid = "e852ba6eb4c03f2fafdb73ce838d8980";
action.clusterUuid = "112816423a1a3b50a58d54fd1f6a8665";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachL2NetworkToClusterAction.Result res = action.call();

Python SDK

AttachL2NetworkToClusterAction action = AttachL2NetworkToClusterAction()
action.l2NetworkUuid = "e852ba6eb4c03f2fafdb73ce838d8980"
action.clusterUuid = "112816423a1a3b50a58d54fd1f6a8665"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachL2NetworkToClusterAction.Result res = action.call()