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

Functions

def Query (protocol)
 
def Save (protocol)
 
def GetCPNATTable (device_name)
 
def GetCPPolicyTable (device_name)
 
def GetCPIPsecVPNTable (device_name)
 
def GetBaselineConfig (device_name, include_auxiliary=True)
 
def GetBaselineAuxiliaryCli (device_name)
 get the device cinfig Auxiliary Cli. More...
 
def GetConfig (device_name, include_auxiliary=True)
 
def SaveConfig (device_name, config)
 
def GetCLIData (device_name, cli_command)
 
def SaveCLIData (device_name, cli_command, cli_outputs)
 
def GetNCTTable (device_name, table_name, tableIdentifier=None)
 get the device nct table. More...
 
def SaveNCTTable (device_name, csv_content, table_name, tableIdentifier=None, tableProperties=None)
 save the device nct table. More...
 
def GetRouteTable (device_name, vrf='')
 
def SaveRouteTable (device_name, csv_content, vrf='')
 
def GetMatchedRouteTable (device_name, dest_ip, vrf='')
 
def GetARPTable (device_name, vrf='')
 
def SaveARPTable (device_name, csv_content, vrf='')
 
def GetMACTable (device_name)
 get the mac table content of one device from baseline. More...
 
def SaveMACTable (device_name, csv_content)
 save the mac table content of one device to baseline. More...
 
def GetNDPTable (device_name)
 get the ndp table content of one device from baseline. More...
 
def SaveNDPTable (device_name, csv_content)
 save the ndp table content of one device to baseline. More...
 
def GetSTPTable (device_name)
 get the stp table content of one device from baseline. More...
 
def SaveSTPTable (device_name, csv_content)
 save the stp table content of one device to baseline. More...
 
def GetBGPRouteTable (device_name, peer_ip, vrf='')
 
def SaveBGPRouteTable (device_name, csv_content, peer_ip, vrf='')
 
def ImportConfig (driverId, config, dictAuxiliaryCmds={})
 import configuration file to current baseline. More...
 
def ImportDeviceDataByCLI (protocol)
 
def GetBaselineNCTSubNames (device_name, nctTableName)
 get nct table subnames from baseline. More...
 
def get_all_vrf_route (device_name)
 get vrf of routing table in currentbaseline More...
 
def get_all_vrf_arp_table (device_name)
 get vrf of arp table in currentbaseline More...
 
def get_sending_commands (dev_ids)
 get sending commands in currentbaseline More...
 

Variables

 str_stack = traceback.format_exc();
 

Function Documentation

◆ get_all_vrf_arp_table()

def netbrain.sysapi.devicedata.get_all_vrf_arp_table (   device_name)

get vrf of arp table in currentbaseline

Parameters
device_name(string) name of device
Returns
list of vrf names

◆ get_all_vrf_route()

def netbrain.sysapi.devicedata.get_all_vrf_route (   device_name)

get vrf of routing table in currentbaseline

Parameters
device_name(string) name of device
Returns
list of vrf names

◆ get_sending_commands()

def netbrain.sysapi.devicedata.get_sending_commands (   dev_ids)

get sending commands in currentbaseline

Parameters
dev_ids(array of string) ids of device,[id1, id2]
Returns
list of object, [{_id:device_id, commands:["cmd1", "cmd2"]}]

◆ GetARPTable()

def netbrain.sysapi.devicedata.GetARPTable (   device_name,
  vrf = '' 
)

◆ GetBaselineAuxiliaryCli()

def netbrain.sysapi.devicedata.GetBaselineAuxiliaryCli (   device_name)

get the device cinfig Auxiliary Cli.

Parameters
device_name(string) device hostname
Returns
dict {"content":"...", "result":"success", "error":"", "livelog":"", "time":1590780145}
example
device_name = "R1"
data = GetBaselineAuxiliaryCli(device_name)

◆ GetBaselineConfig()

def netbrain.sysapi.devicedata.GetBaselineConfig (   device_name,
  include_auxiliary = True 
)

◆ GetBaselineNCTSubNames()

def netbrain.sysapi.devicedata.GetBaselineNCTSubNames (   device_name,
  nctTableName 
)

get nct table subnames from baseline.

Parameters
device_name(string) driver id
nctTableName(string) configure content
Returns
result (array of object),
example
device_name="R1"
nctTableName='''MPLS VPN4 Label'''
ret = GetBaselineNCTsubNames(device_name, nctTableName)
return [{'subName', ''}, {'subName':'vrf1'}, {'subName':'vrf2'}]

◆ GetBGPRouteTable()

def netbrain.sysapi.devicedata.GetBGPRouteTable (   device_name,
  peer_ip,
  vrf = '' 
)

◆ GetCLIData()

def netbrain.sysapi.devicedata.GetCLIData (   device_name,
  cli_command 
)

◆ GetConfig()

def netbrain.sysapi.devicedata.GetConfig (   device_name,
  include_auxiliary = True 
)

◆ GetCPIPsecVPNTable()

def netbrain.sysapi.devicedata.GetCPIPsecVPNTable (   device_name)

◆ GetCPNATTable()

def netbrain.sysapi.devicedata.GetCPNATTable (   device_name)

◆ GetCPPolicyTable()

def netbrain.sysapi.devicedata.GetCPPolicyTable (   device_name)

◆ GetMACTable()

def netbrain.sysapi.devicedata.GetMACTable (   device_name)

get the mac table content of one device from baseline.

Parameters
device_name(string) device hostname
Returns
mac table content of device (string)
example
device_name = "R1"
mac_csv = GetMACTable(device_name)

◆ GetMatchedRouteTable()

def netbrain.sysapi.devicedata.GetMatchedRouteTable (   device_name,
  dest_ip,
  vrf = '' 
)

◆ GetNCTTable()

def netbrain.sysapi.devicedata.GetNCTTable (   device_name,
  table_name,
  tableIdentifier = None 
)

get the device nct table.

Parameters
device_name(string) device hostname
table_name(string) device table name
tableIdentifier(string or dict or None), if same table name have many tables, this field to identify the table
if the param is string equal to dict {"subName":tableIdentifier} for back compatible
Returns
dict {"content":"...", "result":"success", "error":"", "livelog":"", "time":1590780145}
example
device_name = "R1"
table_name = "BGP Advertised-route Table"
tableIdentifier = {vrf:"", peIp:"10.10.2.3"}
data = GetNCTTable(device_name, table_name, tableIdentifier)

◆ GetNDPTable()

def netbrain.sysapi.devicedata.GetNDPTable (   device_name)

get the ndp table content of one device from baseline.

Parameters
device_name(string) device hostname
Returns
ndp table content of device (string)
example
device_name = "R1"
ndp_csv = GetNDPTable(device_name)

◆ GetRouteTable()

def netbrain.sysapi.devicedata.GetRouteTable (   device_name,
  vrf = '' 
)

◆ GetSTPTable()

def netbrain.sysapi.devicedata.GetSTPTable (   device_name)

get the stp table content of one device from baseline.

Parameters
device_name(string) device hostname
Returns
stp table content of device (string)
example
device_name = "R1"
stp_csv = GetSTPTable(device_name)

◆ ImportConfig()

def netbrain.sysapi.devicedata.ImportConfig (   driverId,
  config,
  dictAuxiliaryCmds = {} 
)

import configuration file to current baseline.

Parameters
driverId(string) driver id
config(string) configure content
dictAuxiliaryCmds(dict) auxiliary commands (dict key) and it's resault (dict value)
Returns
result (dict)
example
driver_id="b32a22cb-b302-4286-aa62-de932a495379"
config_content=''' hostname BJ-R1 ...'''
ret = ImportConfig(device_name)
return {"content":"","result":"success","error":""} or {"content":"","result":"fail","error":"error message..."}

◆ ImportDeviceDataByCLI()

def netbrain.sysapi.devicedata.ImportDeviceDataByCLI (   protocol)

◆ Query()

def netbrain.sysapi.devicedata.Query (   protocol)

◆ Save()

def netbrain.sysapi.devicedata.Save (   protocol)

◆ SaveARPTable()

def netbrain.sysapi.devicedata.SaveARPTable (   device_name,
  csv_content,
  vrf = '' 
)

◆ SaveBGPRouteTable()

def netbrain.sysapi.devicedata.SaveBGPRouteTable (   device_name,
  csv_content,
  peer_ip,
  vrf = '' 
)

◆ SaveCLIData()

def netbrain.sysapi.devicedata.SaveCLIData (   device_name,
  cli_command,
  cli_outputs 
)

◆ SaveConfig()

def netbrain.sysapi.devicedata.SaveConfig (   device_name,
  config 
)

◆ SaveMACTable()

def netbrain.sysapi.devicedata.SaveMACTable (   device_name,
  csv_content 
)

save the mac table content of one device to baseline.

Parameters
device_name(string) device hostname
csv_content(string) csv content of device mac
Returns
result (dict)
example
device_name = "R1"
mac_csv = SaveMACTable(device_name)
return {"content":"","result":"success","error":""} or {"content":"","result":"fail","error":"error message..."}

◆ SaveNCTTable()

def netbrain.sysapi.devicedata.SaveNCTTable (   device_name,
  csv_content,
  table_name,
  tableIdentifier = None,
  tableProperties = None 
)

save the device nct table.

Parameters
device_name(string) device hostname
csv_content(string) csv table content
table_name(string) device table name
tableIdentifier(string or dict or None), if same table name have many tables, this field to identify the table
if the param is string equal to dict {"subName":tableIdentifier} for back compatible
tableProperties(dict or None) some tableProperties about the table, like displayName
example when tableIdentifier is {vrf:"", peIp:"10.10.2.3"} than tableProperties can be {displayName:"Global:10.10.2.3"}
Returns
No return value
example
device_name = "R1"
csv_content = "...."
table_name = "BGP Advertised-route Table"
tableIdentifier = {vrf:"", peIp:"10.10.2.3"}
tableProperties = {displayName:"Global:10.10.2.3"}
mac_csv = SaveNCTTable(device_name, csv_content, table_name, tableIdentifier, tableProperties)

◆ SaveNDPTable()

def netbrain.sysapi.devicedata.SaveNDPTable (   device_name,
  csv_content 
)

save the ndp table content of one device to baseline.

Parameters
device_name(string) device hostname
csv_content(string) csv content of device ndp
Returns
result (dict)
example
device_name = "R1"
ndp_csv = SaveNDPTable(device_name)
return {"content":"","result":"success","error":""} or {"content":"","result":"fail","error":"error message..."}

◆ SaveRouteTable()

def netbrain.sysapi.devicedata.SaveRouteTable (   device_name,
  csv_content,
  vrf = '' 
)

◆ SaveSTPTable()

def netbrain.sysapi.devicedata.SaveSTPTable (   device_name,
  csv_content 
)

save the stp table content of one device to baseline.

Parameters
device_name(string) device hostname
csv_content(string) csv content of device stp
Returns
stp table content of device (string)
example
device_name = "R1"
csv_content=...
stp_csv = SaveSTPTable(device_name,csv_content)
return {"content":"","result":"success","error":""} or {"content":"","result":"fail","error":"error message..."}

Variable Documentation

◆ str_stack

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