VMware Cloud Community
legioon
Enthusiast
Enthusiast

How to get a list of all Logical Switch ( Wire Network ) on NSX using vRO ?

Hi,

I have a lot of logical switch on NSX. Already I am using NSX and vRO with others functions. I can create and delete Logical switch and anything else with vRO. But I need to get a list of all logical switch ( it knowns as wire network on vRO )  Name and ID on nsx. There is no any workflow, action and function about with it. I found some function about Logical Switch list as you can see below. But, it is not working.

Have you ever done something like this before?

wirenetworkonvro.JPG

vraWireNetwork.JPG

Reply
0 Kudos
4 Replies
littleboy1982
Contributor
Contributor

Hello,

i just tried to use this function and i completed to get list of Logical switches. Simply use the function with arguments pageSize=9999 and startIndex=0.

  virtualWiresDto = NSXVirtualWireController.getAllWiresV2(connection, 9999, 0);

  var pagingInfo = virtualWiresDto.dataPage.pagingInfo;

  System.debug("pagingInfo.pageSize="+pagingInfo.pageSize);

  System.debug("pagingInfo.startIndex="+pagingInfo.startIndex);

  System.debug("pagingInfo.totalCount="+pagingInfo.totalCount);

  var datas = virtualWiresDto.dataPage.data;

  for each (d in datas){

    System.debug("d="+d);

    System.debug("d.name="+d.name);

  }

hope it will help you and others vro users.

best regards

Reply
0 Kudos
plaquevent
Contributor
Contributor

Hello,

First thank you for this post, I am having the same issue and google does not find much literature on this subject... I think I have the same issue as OP : whatever parameters I use for calling getAllWiresV2 method, I get an error. Meanwhile, other methods (like getSecurityTags) work just fine.

NSXSecurityTagManager.getSecurityTags(NSXEndpoint) => success

NSXVirtualWireController.getAllWiresV2(NSXEndpoint, 9999, 0) => failure

[2019-08-06 18:36:09.926] [E] Workflow execution stack:

***

item: 'Find All META-Bubble/item1', state: 'failed', business state: 'null', exception: 'org/apache/commons/beanutils/Converter (Workflow:Find All META-Bubble / Scripting (item2)#2)'

workflow: 'Find All META-Bubble' (8bc6ddb3-fb71-4d7e-add4-d7f118768fb8)

|  'attribute': name=errorCode type=String value=org/apache/commons/beanutils/Converter (Workflow:Find All META-Bubble / Scripting (item2)#2)

|  'attribute': name=NSXEndpoint type=NSX:Connection value=dunes://service.dunes.ch/CustomSDKObject?id='9368fc93-9dc0-46fb-8d62-ef028b278e14'&dunesName='NSX:Connection'

|  'input': name=type type=string value=META-Bubble

|  'output': name=resultObjs type=Array/DynamicTypes:META.Bubble value=null

*** End of execution stack.

I am using VRO / VRA 7.5.0 and NSX plugin 1.2.0 with NSX-V 6.4.4 build 11197766

Does anyone have any insight on this ?

Reply
0 Kudos
plaquevent
Contributor
Contributor

Looks a lot like it could be related to this kb : After upgrading vRealize Orchestrator to 7.4 or any following version, NSX 6.x plug-in may not work....

Will try the workaround Smiley Sad

Reply
0 Kudos
plaquevent
Contributor
Contributor

The workaround in the KB works on VRA / VRO all in one appliance V7.5.0, hope this saves time to someone someday ^^

Reply
0 Kudos