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

Functions

def set_certification_begin (certification_name)
 Notifiy backend certification begin, last certification record would be cleaned. More...
 
def set_certification_end (certification_name)
 Notifiy backend certification end, all cached result would be flushed to DB. More...
 
def save_certification_db (table_name, input_data, sync=False)
 save certification result in db, it would be cache in memory, and batch write into db in size 16 More...
 
def query_certification_db (table_name, query_condition)
 query certification result in db More...
 
def export_certification_report (report_name, report_content, export_path='certification')
 save report to specified folder on webserver, default is Public/certification More...
 
def export_map (devices, map_name, map_path='certification')
 draw devices on map and save to folder on webserver, default is Public/certification More...
 
def read_report (file_name, folder='certification')
 read report from webserver desktop, MUST be placed at Public More...
 
def remove_file (file_name, folder='certification')
 remove file from webserver desktop, MUST be placed at Public More...
 
def clear_certification_dbs ()
 
def get_benchmark (name)
 DO NOT USE THIS API EXCEPT IN CERTIFICATION. More...
 
def save_benchmark (benchmark)
 DO NOT USE THIS API EXCEPT IN CERTIFICATION. More...
 
def execute_benchmark (name)
 DO NOT USE THIS API EXCEPT IN CERTIFICATION. More...
 
def get_latest_device_benchmark_results (devIds)
 DO NOT USE THIS API EXCEPT IN CERTIFICATION. More...
 

Variables

 str_stack = traceback.format_exc();
 
 export_result = namedtuple('export_result', ["success", "error"])
 
 export_map_request = namedtuple('export_map_request', ['devices', "map_name", "map_path"])
 
 read_file_result = namedtuple('read_file_result', ['success', 'error', 'data'])
 

Function Documentation

◆ clear_certification_dbs()

def netbrain.sysapi.certification.clear_certification_dbs ( )

◆ execute_benchmark()

def netbrain.sysapi.certification.execute_benchmark (   name)

DO NOT USE THIS API EXCEPT IN CERTIFICATION.

◆ export_certification_report()

def netbrain.sysapi.certification.export_certification_report (   report_name,
  report_content,
  export_path = 'certification' 
)

save report to specified folder on webserver, default is Public/certification

Parameters
report_name(string)name of report
report_content(string)content of report
export_path(string)target folder, we search folder from Public
Returns
object of export_result, export_result.success == True means success

◆ export_map()

def netbrain.sysapi.certification.export_map (   devices,
  map_name,
  map_path = 'certification' 
)

draw devices on map and save to folder on webserver, default is Public/certification

Parameters
devices(list)device name list
map_name(string)name of map
Returns
object of export_result, export_result.success == True means success

◆ get_benchmark()

def netbrain.sysapi.certification.get_benchmark (   name)

DO NOT USE THIS API EXCEPT IN CERTIFICATION.

◆ get_latest_device_benchmark_results()

def netbrain.sysapi.certification.get_latest_device_benchmark_results (   devIds)

DO NOT USE THIS API EXCEPT IN CERTIFICATION.

◆ query_certification_db()

def netbrain.sysapi.certification.query_certification_db (   table_name,
  query_condition 
)

query certification result in db

Parameters
table_name(string)name of collection, should be one of
  • Certification_IP
  • Certification_Device
  • Certification_Interface
  • Certification_White_Black_list
  • Certification_TableData
  • Certification_Common_General_Table
  • Certification_Common_L3_Table
  • Certification_Common_L2_Table
  • Certification_Common_Topo_Table
  • Certification_DT_General_Table
  • Certification_DT_L2_Table
  • Certification_DT_L3_Table
  • Certification_DT_Topo_Table
query_condition(dict)query dict, should be same as db query
Returns
List of record

◆ read_report()

def netbrain.sysapi.certification.read_report (   file_name,
  folder = 'certification' 
)

read report from webserver desktop, MUST be placed at Public

Parameters
folder(string)folder name, we add prefix "public" at backend
file_name(string)name of file
Returns
object of read_file_result, result.success == True means success result.data is actual content, result.error is error message

◆ remove_file()

def netbrain.sysapi.certification.remove_file (   file_name,
  folder = 'certification' 
)

remove file from webserver desktop, MUST be placed at Public

Parameters
folder(string)folder name, we add prefix "public" at backend
file_name(string)name of file
Returns
object of read_file_result, result.success == True means success result.error is error message

◆ save_benchmark()

def netbrain.sysapi.certification.save_benchmark (   benchmark)

DO NOT USE THIS API EXCEPT IN CERTIFICATION.

◆ save_certification_db()

def netbrain.sysapi.certification.save_certification_db (   table_name,
  input_data,
  sync = False 
)

save certification result in db, it would be cache in memory, and batch write into db in size 16

Parameters
table_name(string)name of collection, should be one of
  • Certification_IP
  • Certification_Device
  • Certification_Interface
  • Certification_White_Black_list
  • Certification_TableData
  • Certification_Common_General_Table
  • Certification_Common_L3_Table
  • Certification_Common_L2_Table
  • Certification_Common_Topo_Table
  • Certification_DT_General_Table
  • Certification_DT_L2_Table
  • Certification_DT_L3_Table
  • Certification_DT_Topo_Table
input_data(dict)record, 'certificateName' MUST be one key
syncsave to db instantly, default is false
Returns
nothing

◆ set_certification_begin()

def netbrain.sysapi.certification.set_certification_begin (   certification_name)

Notifiy backend certification begin, last certification record would be cleaned.

Parameters
certification_name(string)name of certification
Returns
nothing

◆ set_certification_end()

def netbrain.sysapi.certification.set_certification_end (   certification_name)

Notifiy backend certification end, all cached result would be flushed to DB.

Parameters
certification_name(string)name of certification
Returns
nothing

Variable Documentation

◆ export_map_request

netbrain.sysapi.certification.export_map_request = namedtuple('export_map_request', ['devices', "map_name", "map_path"])

◆ export_result

netbrain.sysapi.certification.export_result = namedtuple('export_result', ["success", "error"])

◆ read_file_result

netbrain.sysapi.certification.read_file_result = namedtuple('read_file_result', ['success', 'error', 'data'])

◆ str_stack

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