Network ResourcesDistributed Switch Related Interfaces

GetCandidateL2NetworksForAttachingCluster

GET/zstack/v1/cluster/{clusterUuid}/l2-candidates

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cluster/016f3e0efa66377b8acf1d1b73050af0/l2-candidates?limit=1000&start=0

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
clusterUuidStringurlThe cluster UUID. 4.0.0
limit (Optional)IntegerqueryOptional. The maximum number of records to return. Similar to the MySQL limit. 4.0.0
start (Optional)IntegerqueryOptional. The starting record offset. Similar to the MySQL offset. Use with limit for pagination. 4.0.0
systemTags (Optional)ListqueryOptional. The system tags. 4.0.0
userTags (Optional)ListqueryOptional. The user tags. 4.0.0

API Response

Sample Response

{
  "inventories": [
    {
      "name": "l2",
      "description": "test",
      "physicalInterface": "eth0",
      "vlan": 0,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.0.0
inventoriesListSee inventories.4.0.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.4.0.0

inventories

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.4.0.0
nameStringThe resource name.4.0.0
poolUuidStringThe network pool UUID.4.0.0
zoneUuidStringThe Data Center UUID.4.0.0
descriptionStringThe detailed description of the resource.4.0.0
physicalInterfaceStringThe NIC name.4.0.0
typeStringThe Distributed Switch type.4.0.0
vniStringThe VNI number.4.0.0
vlanintThe VLAN number.4.0.0
createDateTimestampThe creation date.4.0.0
lastOpDateTimestampThe last operation date.4.0.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

SDK Sample

Java SDK

GetCandidateL2NetworksForAttachingClusterAction action = new GetCandidateL2NetworksForAttachingClusterAction();
action.clusterUuid = "016f3e0efa66377b8acf1d1b73050af0";
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateL2NetworksForAttachingClusterAction.Result res = action.call();

Python SDK

GetCandidateL2NetworksForAttachingClusterAction action = GetCandidateL2NetworksForAttachingClusterAction()
action.clusterUuid = "016f3e0efa66377b8acf1d1b73050af0"
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateL2NetworksForAttachingClusterAction.Result res = action.call()