Network ResourcesDistributed Switch Related Interfaces
AttachL2NetworkToCluster
Headers
OAuth: the-session-uuidCurl 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/112816423a1a3b50a58d54fd1f6a8665Parameter 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. |
| 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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.8.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.8.0 |
| inventory | L2NetworkInventory | See inventory. | 4.8.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| zoneUuid | String | The Data Center UUID. | 0.6 |
| physicalInterface | String | The physical NIC. | 0.6 |
| type | String | The Distributed Switch type. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| attachedClusterUuids | List | The 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()