Python Api  IE10.1
Functions | Variables
netbrain.sysapi.topology Namespace Reference

Functions

def GetNeighborIdsOfDevice (device, topo_type, use_new_table=False)
 Get nbr id list. More...
 
def GetNeighborLinksOfDevice (device, topo_type, use_new_table=False)
 Get nbr id list. More...
 
def GetOriginalLinksOfDevice (device, topo_type, use_new_table=False)
 Get original topo datas of device. More...
 
def GetOriginalLinksOfInterface (device, intf_name, topo_type, use_new_table=False)
 Get original topo datas of device interface. More...
 
def GetOriginalLinksOfMedia (media_name, topo_type, use_new_table=False, zone_name="Default Zone")
 Get original topo datas of media. More...
 
def GetNeighborInterfaceIdsOfDevice (device, topo_type, use_new_table=False)
 Get nbr interface id list by device. More...
 
def GetNeighborIdsOfInterface (device, intf_name, intf_type, topo_type, use_new_table=False, get_new_intf=False)
 Get nbr device id list by interface. More...
 
def GetNeighborInterfaceIdsOfInterface (device, intf_name, intf_type, topo_type, use_new_table=False, get_new_intf=False)
 Get nbr interface id list by interface. More...
 
def GetTopoTypeStatusObject (topo_type)
 Get topo link status by id. More...
 
def SetTopoTypeStatusObject (object)
 Set topo link status object. More...
 
def SetTopologyStartTime (topo_type)
 set topo start time More...
 
def SetTopologyEndTime (topo_type)
 set topo end time More...
 
def UpdateTopologyProgress (topo_type, progress_value)
 update topo progress More...
 
def RemoveLinkP2p (device1, intf1, intf_type1, device2, intf2, intf_type2, topo_type)
 remove link p2p by name More...
 
def RemoveLinkMp (device, intf, intf_type, media_name, media_type, topo_type)
 remove link Mp by name More...
 
def AddLinkP2p (device1, intf1, intf_type1, device2, intf2, intf_type2, topo_type)
 add link p2p by name More...
 
def AddLinkMp (device, intf, intf_type, media_name, media_type, topo_type, link_type_group="", zone="")
 add link Mp by name More...
 
def DeleteTopoLinksByIds (idList, topo_type, tech)
 delete topo link by Ids More...
 
def RemoveLinksOfInterface (device, intf, intf_type, topo_type)
 remove all links of one interface More...
 
def CreateUnknownEndsystem (ip, mac, desc="")
 create one unknown endsystem,use ip and mac More...
 
def RemoveLinksBetweenDevices (device_names, topo_type, source="system")
 remove links between devices More...
 
def AddLockedLinkMp (device, intf, intf_type, media_name, media_type, topo_type)
 add locked link mp More...
 
def AddLockedLinkP2p (device1, intf1, intf_type1, device2, intf2, intf_type2, topo_type)
 add locked link p2p by name More...
 
def RemoveLockedLinkMp (device, intf, intf_type, media_name, media_type, topo_type)
 remove locked link Mp by name More...
 
def RemoveLockedLinkP2p (device1, intf1, intf_type1, device2, intf2, intf_type2, topo_type)
 remove locked link p2p by name More...
 
def AddBlockedLinkMp (device, intf, intf_type, media_name, media_type, topo_type)
 add blocked link Mp More...
 
def AddBlockedLinkP2p (device1, intf1, intf_type1, device2, intf2, intf_type2, topo_type)
 add blocked link p2p More...
 
def RemoveBlockedLinkMp (device, intf, intf_type, media_name, media_type, topo_type)
 remove blocked link Mp More...
 
def RemoveBlockedLinkP2p (device1, intf1, intf_type1, device2, intf2, intf_type2, topo_type)
 remove blocked link p2p by name More...
 
def AddZone (name, desc, zone_type=3)
 add zone More...
 
def DeleteZoneByName (name)
 delete zone name More...
 
def MoveInterfaceToZone (device, intf, zone_name, get_new_intf=False)
 move interface to zone More...
 
def SetInterfaceToZone (device, intf, intf_type, zone_name, get_new_intf=False)
 set interface to zone More...
 
def GetZoneNameOfInterface (device, intf, get_new_intf=False)
 get zone name of interface More...
 
def GetMedias (media_type, topo_type)
 Get media. More...
 
def GetMediaObjects (topo_type, dev_name)
 
def GetAllZoneName ()
 get zone name list More...
 
def GetZoneDetailbyName (zone_name)
 get zone detail by name More...
 
def GetZoneById (zone_id)
 get basic zone by id More...
 
def AddMedia (media_name, media_type, topo_type, zone='', kw)
 add media More...
 
def DeleteMedia (media_name)
 delete media More...
 
def GetMediaById (media_id)
 get media by id More...
 
def GetInterfaceIdsByMedia (media_name, media_type, topo_type)
 Get interface id list by media. More...
 
def GetDeviceIdsByMedia (media_name, media_type, topo_type)
 Get device id list by media. More...
 
def GetEndSystemGwL3Media (ip)
 Get end system gw by l3 media. More...
 
def GetSameLanInterfacesByMedia (ip)
 for any given ip, try to find interfaces connected to same media in L3 topo More...
 
def ClearLinks (topo_type)
 Delete all links from topology table. More...
 
def UpdateSubnetIpInterfacesByDevices (device_list)
 UpdateSubnetIpInterfacesByDevices. More...
 
def GetBestPortForMac (mac, use_new_table=False, get_new_intf=False)
 Get best port for Mac. More...
 

Variables

 str_stack = traceback.format_exc();
 

Function Documentation

◆ AddBlockedLinkMp()

def netbrain.sysapi.topology.AddBlockedLinkMp (   device,
  intf,
  intf_type,
  media_name,
  media_type,
  topo_type 
)

add blocked link Mp

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ AddBlockedLinkP2p()

def netbrain.sysapi.topology.AddBlockedLinkP2p (   device1,
  intf1,
  intf_type1,
  device2,
  intf2,
  intf_type2,
  topo_type 
)

add blocked link p2p

Note
from V8.0
Parameters
device1(string) device1 name
intf1(string) intf1 name
intf_type1(string) intf1 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
device2(string) device2 name
intf2(string) intf2 name
intf_type2(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ AddLinkMp()

def netbrain.sysapi.topology.AddLinkMp (   device,
  intf,
  intf_type,
  media_name,
  media_type,
  topo_type,
  link_type_group = "",
  zone = "" 
)

add link Mp by name

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
link_type_group(string) link type group (from EE7.1b)
  • "" ,empty means "Normal"
  • "UpLink"
  • "DownLink"
  • any other customized link type group.
zone(string) zone of media (from EE8.03)
Returns
True or False

◆ AddLinkP2p()

def netbrain.sysapi.topology.AddLinkP2p (   device1,
  intf1,
  intf_type1,
  device2,
  intf2,
  intf_type2,
  topo_type 
)

add link p2p by name

Note
from V8.0
Parameters
device1(string) device1 name
intf1(string) intf1 name
intf_type1(string) intf1 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
device2(string) device2 name
intf2(string) intf2 name
intf_type2(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ AddLockedLinkMp()

def netbrain.sysapi.topology.AddLockedLinkMp (   device,
  intf,
  intf_type,
  media_name,
  media_type,
  topo_type 
)

add locked link mp

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ AddLockedLinkP2p()

def netbrain.sysapi.topology.AddLockedLinkP2p (   device1,
  intf1,
  intf_type1,
  device2,
  intf2,
  intf_type2,
  topo_type 
)

add locked link p2p by name

Note
from V8.0
Parameters
device1(string) device1 name
intf1(string) intf1 name
intf_type1(string) intf1 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
device2(string) device2 name
intf2(string) intf2 name
intf_type2(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ AddMedia()

def netbrain.sysapi.topology.AddMedia (   media_name,
  media_type,
  topo_type,
  zone = '',
  kw 
)

add media

Note
from V8.0,change in V8.0.3
Parameters
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
zone(string) zone name of media,from V8.0.3 kw (dict) media attributes
  • {
  • 'hsrp': 'intfs.hsrp.type intfs.hsrp.group (intfs.hsrp.ips)',
  • 'vrf': intfs.mplsVrf
  • }
Returns
True or False

◆ AddZone()

def netbrain.sysapi.topology.AddZone (   name,
  desc,
  zone_type = 3 
)

add zone

Note
from V8.0
Parameters
name(string) zone name
desc(string) zone description
zone_type(int) zone type - default is 3.ByQapp,it means ByApi
1.BySystem,
2.ByManually,
3.ByQapp
Returns
True or False

◆ ClearLinks()

def netbrain.sysapi.topology.ClearLinks (   topo_type)

Delete all links from topology table.

Note
from V8.0
Parameters
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True if successed.

◆ CreateUnknownEndsystem()

def netbrain.sysapi.topology.CreateUnknownEndsystem (   ip,
  mac,
  desc = "" 
)

create one unknown endsystem,use ip and mac

Note
from V8.0
Parameters
ip(string) ip address
mac(string) mac address
desc(string) description
Returns
True or False

◆ DeleteMedia()

def netbrain.sysapi.topology.DeleteMedia (   media_name)

delete media

Note
from V8.0
Parameters
media_name(string) media name
Returns
True or False

◆ DeleteTopoLinksByIds()

def netbrain.sysapi.topology.DeleteTopoLinksByIds (   idList,
  topo_type,
  tech 
)

delete topo link by Ids

Note
from V8.0
Parameters
idList(List) id list
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
tech(string) tech
Returns
True or False

◆ DeleteZoneByName()

def netbrain.sysapi.topology.DeleteZoneByName (   name)

delete zone name

Note
from V8.0
Parameters
namezone name
Returns
True or False

◆ GetAllZoneName()

def netbrain.sysapi.topology.GetAllZoneName ( )

get zone name list

Note
from V8.0
Returns
zone name list

◆ GetBestPortForMac()

def netbrain.sysapi.topology.GetBestPortForMac (   mac,
  use_new_table = False,
  get_new_intf = False 
)

Get best port for Mac.

Note
from V8.0.3
Parameters
mac(string) intergface mac address, like 0050.5685.2A9E
use_new_table(bool) if use the new table to get the datas,default is only use current table.
get_new_intf(bool) Whether to use new data(When the interface data is modified in your script, it needs to be set to true in order to obtain the updated data)
Returns
doc of a switch port.
{
'switchName': 'Switch1',
'portName': 'Ethernet0/0'
}

◆ GetDeviceIdsByMedia()

def netbrain.sysapi.topology.GetDeviceIdsByMedia (   media_name,
  media_type,
  topo_type 
)

Get device id list by media.

Note
from V8.0
Parameters
media_name(string) media name
media_type(string) media type
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
device id list

◆ GetEndSystemGwL3Media()

def netbrain.sysapi.topology.GetEndSystemGwL3Media (   ip)

Get end system gw by l3 media.

Note
from V8.0
Parameters
ipip address
Returns
interface id list
Return values
[id1,id2,...]

◆ GetInterfaceIdsByMedia()

def netbrain.sysapi.topology.GetInterfaceIdsByMedia (   media_name,
  media_type,
  topo_type 
)

Get interface id list by media.

Note
from V8.0
Parameters
media_name(string) media name
media_type(string) media type
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
interface id list
Return values
[{"interfaceid":"111", "interface type":""}, {XXX}, {XXX} ]

◆ GetMediaById()

def netbrain.sysapi.topology.GetMediaById (   media_id)

get media by id

Note
from V10.0
Parameters
media_id(string) media id
Returns
basic media info
Return values
example
{
"_id" : "d421c7db-9f07-4ab7-8320-80d3501808f7",
"hsrp" : "",
"idName" : "",
"isDeleted" : false,
"isHiden" : false,
"lower" : 173588488,
"mask" : 31,
"topoType" : "L3_Topo_Type",
"type" : "Lan",
"uniName" : "10.88.192.8/31",
"upper" : 173588489,
"vrf" : "blue",
"zone" : ""
}

◆ GetMediaObjects()

def netbrain.sysapi.topology.GetMediaObjects (   topo_type,
  dev_name 
)

◆ GetMedias()

def netbrain.sysapi.topology.GetMedias (   media_type,
  topo_type 
)

Get media.

Note
from V8.0
Parameters
media_type(string) media type
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
media name list

◆ GetNeighborIdsOfDevice()

def netbrain.sysapi.topology.GetNeighborIdsOfDevice (   device,
  topo_type,
  use_new_table = False 
)

Get nbr id list.

Note
from V8.0
Parameters
device(string) device name
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
Returns
id list

◆ GetNeighborIdsOfInterface()

def netbrain.sysapi.topology.GetNeighborIdsOfInterface (   device,
  intf_name,
  intf_type,
  topo_type,
  use_new_table = False,
  get_new_intf = False 
)

Get nbr device id list by interface.

Note
from V8.0
Parameters
device(string) device name
intf_name(string) interface name
intf_type(string) interface type
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
get_new_intf(bool) Whether to use new data(When the interface data is modified in your script, it needs to be set to true in order to obtain the updated data)
Returns
device id list

◆ GetNeighborInterfaceIdsOfDevice()

def netbrain.sysapi.topology.GetNeighborInterfaceIdsOfDevice (   device,
  topo_type,
  use_new_table = False 
)

Get nbr interface id list by device.

Note
from V8.0
Parameters
device(string) device name
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
Returns
interface id list
Return values
[{"interfaceid":"111", "interface type":""}, {XXX}, {XXX} ]

◆ GetNeighborInterfaceIdsOfInterface()

def netbrain.sysapi.topology.GetNeighborInterfaceIdsOfInterface (   device,
  intf_name,
  intf_type,
  topo_type,
  use_new_table = False,
  get_new_intf = False 
)

Get nbr interface id list by interface.

Note
from V8.0
Parameters
device(string) device name
intf_name(string) interface name
intf_type(string) interface type
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
get_new_intf(bool) Whether to use new data(When the interface data is modified in your script, it needs to be set to true in order to obtain the updated data)
Returns
interface id list
Return values
[{"interfaceid":"111", "interface type":""}, {XXX}, {XXX} ]

◆ GetNeighborLinksOfDevice()

def netbrain.sysapi.topology.GetNeighborLinksOfDevice (   device,
  topo_type,
  use_new_table = False 
)

Get nbr id list.

Note
from V8.0
Parameters
device(string) device name
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
Returns
list topo links.
Return values
[{'localIntfId''222', 'nbrDevId': '333', 'nbrIntfId': '444','nbrIntfSchema': 'ipIntfs'}, {XXX}, {XXX}]

◆ GetOriginalLinksOfDevice()

def netbrain.sysapi.topology.GetOriginalLinksOfDevice (   device,
  topo_type,
  use_new_table = False 
)

Get original topo datas of device.

Note
from V8.0.2
Parameters
device(string) device name
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
Returns
list topo links.
if linkType is "MP", field "nbrDevId" is "Meida ID", "nbrIntfName" is "Media Name", "nbrIntfId" is empty.
[{
'_id': 'b8cf44f5-647b-49f5-9e6e-4242f40a30f4',
'group': 'DownLink',
'linkType': 'MP',
'localDevId': 'ed2e95ef-d83e-4f9d-a7a1-85421873fab5',
'localIntfId': '63a9a45b-01f3-4497-b03a-33a950984af7',
'localIntfName': 'Ethernet0',
'localIntfSchema': 'intfs',
'nbrDevId': '77059684-75e0-4110-9c48-898c479d2667',
'nbrIntfId': '',
'nbrIntfName': 'Bus(MIMIC-SW.FastEthernet1/0/5)',
'nbrIntfSchema': ''
}...]

◆ GetOriginalLinksOfInterface()

def netbrain.sysapi.topology.GetOriginalLinksOfInterface (   device,
  intf_name,
  topo_type,
  use_new_table = False 
)

Get original topo datas of device interface.

Note
from V8.0.2
Parameters
device(string) device name
intf_name(string) interface name
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
Returns
list topo links.
if linkType is "MP", field "nbrDevId" is "Meida ID", "nbrIntfName" is "Media Name", "nbrIntfId" is empty.
[{
'_id': 'b8cf44f5-647b-49f5-9e6e-4242f40a30f4',
'group': 'DownLink',
'linkType': 'MP',
'localDevId': 'ed2e95ef-d83e-4f9d-a7a1-85421873fab5',
'localIntfId': '63a9a45b-01f3-4497-b03a-33a950984af7',
'localIntfName': 'Ethernet0',
'localIntfSchema': 'intfs',
'nbrDevId': '77059684-75e0-4110-9c48-898c479d2667',
'nbrIntfId': '',
'nbrIntfName': 'Bus(MIMIC-SW.FastEthernet1/0/5)',
'nbrIntfSchema': ''
}...]

◆ GetOriginalLinksOfMedia()

def netbrain.sysapi.topology.GetOriginalLinksOfMedia (   media_name,
  topo_type,
  use_new_table = False,
  zone_name = "Default Zone" 
)

Get original topo datas of media.

Note
from V8.0.2
Parameters
media_name(string) media name
topo_type(string) topo type
  • if empty return all type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
use_new_table(bool) if use the new table to get the datas,default is only use current table.
zone_name(string) Zone Name of the Media.
Returns
list topo links.
if linkType is "MP", field "nbrDevId" is "Meida ID", "nbrIntfName" is "Media Name", "nbrIntfId" is empty.
[{
'_id': 'b8cf44f5-647b-49f5-9e6e-4242f40a30f4',
'group': 'DownLink',
'linkType': 'MP',
'localDevId': 'ed2e95ef-d83e-4f9d-a7a1-85421873fab5',
'localIntfId': '63a9a45b-01f3-4497-b03a-33a950984af7',
'localIntfName': 'Ethernet0',
'localIntfSchema': 'intfs',
'nbrDevId': '77059684-75e0-4110-9c48-898c479d2667',
'nbrIntfId': '',
'nbrIntfName': 'Bus(MIMIC-SW.FastEthernet1/0/5)',
'nbrIntfSchema': ''
}...]

◆ GetSameLanInterfacesByMedia()

def netbrain.sysapi.topology.GetSameLanInterfacesByMedia (   ip)

for any given ip, try to find interfaces connected to same media in L3 topo

Note
from V8.0
Parameters
ipip address
Returns
interface list
Return values
[{'id':'id1','type':'ipintf'},{'id':'id2','type':'intfs'}]

◆ GetTopoTypeStatusObject()

def netbrain.sysapi.topology.GetTopoTypeStatusObject (   topo_type)

Get topo link status by id.

Note
from V8.0
Parameters
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
topo type status object

◆ GetZoneById()

def netbrain.sysapi.topology.GetZoneById (   zone_id)

get basic zone by id

Note
from V10.0
Parameters
zone_idzone Id
Returns
basic zone info
Return values
example
{
'_id': 'c1211568-6676-49e1-a06e-a7cf914227a5',
'description': 'this is for tst',
'isCurrentUsed': True,
'isDefault': False,
'name': 'test_zone123',
'zoneType': 3
}

◆ GetZoneDetailbyName()

def netbrain.sysapi.topology.GetZoneDetailbyName (   zone_name)

get zone detail by name

Note
from V8.0
Parameters
zone_namezone name
Returns
zone info
Return values
example
{
'_id': 'c1211568-6676-49e1-a06e-a7cf914227a5',
'description': 'this is for tst',
'isCurrentUsed': True,
'isDefault': False,
'name': 'test_zone123',
'zoneType': 3
}

◆ GetZoneNameOfInterface()

def netbrain.sysapi.topology.GetZoneNameOfInterface (   device,
  intf,
  get_new_intf = False 
)

get zone name of interface

Note
from V8.0
Parameters
device(string) device name
intf(string) interface name (ip interface for example: FastEthernet1 1.2.3.4)
get_new_intf(bool) Whether to use new data(When the interface data is modified in your script, it needs to be set to true in order to obtain the updated data)
Returns
zone name (string)

◆ MoveInterfaceToZone()

def netbrain.sysapi.topology.MoveInterfaceToZone (   device,
  intf,
  zone_name,
  get_new_intf = False 
)

move interface to zone

Note
from V8.0
Parameters
device(string) device name
intf(string) interface name (ip interface for example: FastEthernet1 1.2.3.4)
zone_name(string) zone name
get_new_intf(bool) Whether to use new data(When the interface data is modified in your script, it needs to be set to true in order to obtain the updated data)
Returns
True or False

◆ RemoveBlockedLinkMp()

def netbrain.sysapi.topology.RemoveBlockedLinkMp (   device,
  intf,
  intf_type,
  media_name,
  media_type,
  topo_type 
)

remove blocked link Mp

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ RemoveBlockedLinkP2p()

def netbrain.sysapi.topology.RemoveBlockedLinkP2p (   device1,
  intf1,
  intf_type1,
  device2,
  intf2,
  intf_type2,
  topo_type 
)

remove blocked link p2p by name

Note
from V8.0
Parameters
device1(string) device1 name
intf1(string) intf1 name
intf_type1(string) intf1 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
device2(string) device2 name
intf2(string) intf2 name
intf_type2(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ RemoveLinkMp()

def netbrain.sysapi.topology.RemoveLinkMp (   device,
  intf,
  intf_type,
  media_name,
  media_type,
  topo_type 
)

remove link Mp by name

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ RemoveLinkP2p()

def netbrain.sysapi.topology.RemoveLinkP2p (   device1,
  intf1,
  intf_type1,
  device2,
  intf2,
  intf_type2,
  topo_type 
)

remove link p2p by name

Note
from V8.0
Parameters
device1(string) device1 name
intf1(string) intf1 name
intf_type1(string) intf1 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
device2(string) device2 name
intf2(string) intf2 name
intf_type2(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ RemoveLinksBetweenDevices()

def netbrain.sysapi.topology.RemoveLinksBetweenDevices (   device_names,
  topo_type,
  source = "system" 
)

remove links between devices

Note
from V8.0
Parameters
device_names(list | tuple) device name list
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
source(string) source type -
system
xx
xx
Returns
True or False

◆ RemoveLinksOfInterface()

def netbrain.sysapi.topology.RemoveLinksOfInterface (   device,
  intf,
  intf_type,
  topo_type 
)

remove all links of one interface

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ RemoveLockedLinkMp()

def netbrain.sysapi.topology.RemoveLockedLinkMp (   device,
  intf,
  intf_type,
  media_name,
  media_type,
  topo_type 
)

remove locked link Mp by name

Note
from V8.0
Parameters
device(string) device name
intf(string) intf name
intf_type(string) intf type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
media_name(string) media name
media_type(string) media type
  • "Lan"
  • "Wan"
  • "Bus"
  • "Serial"
  • "vPC"
  • "Dmvpn" ...
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ RemoveLockedLinkP2p()

def netbrain.sysapi.topology.RemoveLockedLinkP2p (   device1,
  intf1,
  intf_type1,
  device2,
  intf2,
  intf_type2,
  topo_type 
)

remove locked link p2p by name

Note
from V8.0
Parameters
device1(string) device1 name
intf1(string) intf1 name
intf_type1(string) intf1 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
device2(string) device2 name
intf2(string) intf2 name
intf_type2(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ SetInterfaceToZone()

def netbrain.sysapi.topology.SetInterfaceToZone (   device,
  intf,
  intf_type,
  zone_name,
  get_new_intf = False 
)

set interface to zone

Note
from V8.0.3,It is different from MoveInterfaceToZone,it can use any type of interface.
Parameters
device(string) device name
intf(string) interface name
intf_type(string) intf2 type name
  • "intfs"
  • "ipIntfs"
  • "ip6Intfs"
  • "greVpnIntfs"
  • "ipsecVpnIntfs"
zone_name(string) zone name
get_new_intf(bool) is get new interface from DB?
Returns
True or False

◆ SetTopologyEndTime()

def netbrain.sysapi.topology.SetTopologyEndTime (   topo_type)

set topo end time

Note
from V8.0
Parameters
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ SetTopologyStartTime()

def netbrain.sysapi.topology.SetTopologyStartTime (   topo_type)

set topo start time

Note
from V8.0
Parameters
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
Returns
True or False

◆ SetTopoTypeStatusObject()

def netbrain.sysapi.topology.SetTopoTypeStatusObject (   object)

Set topo link status object.

Note
from V8.0
Parameters
objecttopo link status object
Note
object["_id"] can not be empty
Returns
True or False

◆ UpdateSubnetIpInterfacesByDevices()

def netbrain.sysapi.topology.UpdateSubnetIpInterfacesByDevices (   device_list)

UpdateSubnetIpInterfacesByDevices.

Note
from V8.0
Parameters
device_listdevice name List
Returns
True if successed.

◆ UpdateTopologyProgress()

def netbrain.sysapi.topology.UpdateTopologyProgress (   topo_type,
  progress_value 
)

update topo progress

Note
from V8.0
Parameters
topo_type(string) topo type
  • "L2_Topo_Type"
  • "L3_Topo_Type"
  • "Ipv6_L3_Topo_Type"
  • "Logical_Topo_Type"
  • "L3_VPN_Topo_Type"
progress_value(int) progress value
Returns
True or False

Variable Documentation

◆ str_stack

netbrain.sysapi.topology.str_stack = traceback.format_exc();