Skip to main content
Answer

how to draw device's L3 gateway using python script

  • February 6, 2022
  • 1 reply
  • 113 views

I have been dabbling with the Qapp Python scripting lately and i want to build a qapp wherein the user can have multiple end device ips as input and have their L2 connected switch and L3 Gateways automatically drawn on the map using one-ip-table information. However, looks like the gateways cannot be resolved by one ip table that’s why it is not being drawn. Then i noticed when the end device is drawn, i am able to see the L3 neighbor by extending the plus sign. Is there a Qapp API or a combination of them that can see the L3 neighbor? Or is there a better way to achieve this? Thank you!

 

import PyDataModel

output = GetOneIpTableItem($Input1.IP,"","","")

output has no entry for gw.

 

 

 

  

Best answer by bogdan.andrus

Hi jpmackz,

thank for your inquiry!

 

Please use the GetNeighborIdsOfDevice() api to get the L3 gateway for end systems using the topo_type "L3_Topo_Type" parameter. Description here: https://www.netbraintech.com/docs/python-api/namespacenetbrain_1_1sysapi_1_1topology.html#ab1105d9284e92f627322cfedd2b38e18

 

and then draw the device on the map using: DrawDevice(device_name[, auto_link, topology_type, map_name, page_name]). Details here: https://www.netbraintech.com/docs/ie101/help/index.html?module-api.htm

 

For all python api documentation please refer to the pages:

https://www.netbraintech.com/docs/python-api/

and

https://www.netbraintech.com/docs/ie101/help/index.html?module-api.htm

Cheers,

Bogdan

1 reply

  • New Participant
  • Answer
  • March 21, 2022

Hi jpmackz,

thank for your inquiry!

 

Please use the GetNeighborIdsOfDevice() api to get the L3 gateway for end systems using the topo_type "L3_Topo_Type" parameter. Description here: https://www.netbraintech.com/docs/python-api/namespacenetbrain_1_1sysapi_1_1topology.html#ab1105d9284e92f627322cfedd2b38e18

 

and then draw the device on the map using: DrawDevice(device_name[, auto_link, topology_type, map_name, page_name]). Details here: https://www.netbraintech.com/docs/ie101/help/index.html?module-api.htm

 

For all python api documentation please refer to the pages:

https://www.netbraintech.com/docs/python-api/

and

https://www.netbraintech.com/docs/ie101/help/index.html?module-api.htm

Cheers,

Bogdan