Network ResourcesDistributed Switch Related Interfaces

GetCandidateClustersForAttachingL2Network

GET/zstack/v1/l2-networks/{l2NetworkUuid}/cluster-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/l2-networks/0b888b1f97993dbc9a22667219bcc690/cluster-candidates?limit=1000&start=0

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
l2NetworkUuidStringurlThe Distributed Switch UUID. 4.0.0
clusterTypes (Optional)ListqueryOptional. The cluster type list. 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": "cluster1",
      "uuid": "170abd61de68305cb2ccaa008a17c11e",
      "description": "test",
      "state": "Enabled",
      "hypervisorType": "KVM",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "zoneUuid": "8de4bc023e4c3be6bfa7c514eb3bb024",
      "type": "zstack"
    }
  ]
}
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
nameStringThe resource name.0.6
uuidStringThe resource UUID.0.6
descriptionStringThe detailed description of the resource.0.6
stateStringThe cluster state.0.6
hypervisorTypeStringThe hypervisor type.0.6
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6
zoneUuidStringThe Data Center UUID.0.6
typeStringThe reserved field.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

SDK Sample

Java SDK

GetCandidateClustersForAttachingL2NetworkAction action = new GetCandidateClustersForAttachingL2NetworkAction();
action.l2NetworkUuid = "0b888b1f97993dbc9a22667219bcc690";
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateClustersForAttachingL2NetworkAction.Result res = action.call();

Python SDK

GetCandidateClustersForAttachingL2NetworkAction action = GetCandidateClustersForAttachingL2NetworkAction()
action.l2NetworkUuid = "0b888b1f97993dbc9a22667219bcc690"
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateClustersForAttachingL2NetworkAction.Result res = action.call()