Python Api
2.0
|
api for System maintaince More...
api for System maintaince
def netbrain.sysapi.datamodel.AddDevicesToDeviceGroup | ( | devices, | |
device_group_name, | |||
isStatic = True , |
|||
deviceGroupType = 0 |
|||
) |
add devices to device group
devices | (list) devices name |
device_group_name | (string) device group name |
isStatic | (bool) is isStatic |
deviceGroupType | (int) device group type (default 0)- Public = 0, Private = 1 |
def netbrain.sysapi.datamodel.AddDevicesToSite | ( | site_path, | |
device_ids | |||
) |
add devices to site
site_path | (string) site full path |
device_ids | (list) device id lists |
def netbrain.sysapi.datamodel.AddDeviceToDeviceGroup | ( | device, | |
device_group_name, | |||
isStatic = True , |
|||
deviceGroupType = 0 |
|||
) |
add device to device group
device | (string) device name |
device_group_name | (string) device group name |
isStatic | (bool) is isStatic |
deviceGroupType | (int) device group type (default 0)- Public = 0, Private = 1 |
def netbrain.sysapi.datamodel.AddNDTItem | ( | devNameExp, | |
isRegex, | |||
ipAddrRange, | |||
driverId, | |||
subType | |||
) |
add Network Definition
devNameExp | device name expression |
isRegex | devNameExp is regex or not. |
ipAddrRange | ip |
driverId | driver id |
subType | device sub type |
def netbrain.sysapi.datamodel.ClearDevicesInDeviceGroup | ( | device_group_name | ) |
clear device from device group
device_group_name | (string) device group name |
def netbrain.sysapi.datamodel.ClearDevicesInSite | ( | siteh_path | ) |
– func unrealized
def netbrain.sysapi.datamodel.CreateDeviceGroup | ( | device_group_name, | |
device_group_type | |||
) |
create device group
device_group_name | (string) device group name |
device_group_type | (int) device group type - Public = 0, Private = 1 |
def netbrain.sysapi.datamodel.FindVendorByMAC | ( | mac | ) |
find vendor by mac
mac | (string) mac |
def netbrain.sysapi.datamodel.GetAllPhantomInterfaceTypes | ( | ) |
get all phantom interface types
["ipIntfs",ip6Intfs,greVpnIntfs,"ipsecVpnIntfs"] |
def netbrain.sysapi.datamodel.GetCurrentDomainInfo | ( | ) |
def netbrain.sysapi.datamodel.GetCurrentMapId | ( | ) |
get current map id
def netbrain.sysapi.datamodel.GetCurrentMapPageId | ( | ) |
get current map page id
def netbrain.sysapi.datamodel.GetCurrentRunbookID | ( | ) |
get current runbook id
def netbrain.sysapi.datamodel.GetDataViewTemplete | ( | dvt_path | ) |
get dvt by path
dvt_path | dvt path |
def netbrain.sysapi.datamodel.GetDeviceIdsFromDeviceGroup | ( | device_group_name | ) |
get device ids from device group
device_group_name | (string) device group name |
["device | id1", "device id2", ...] |
def netbrain.sysapi.datamodel.GetDeviceIdsFromSite | ( | site_path, | |
include_child = False |
|||
) |
get device ids from site
site_path | (string) site full path |
include_child | (bool) include child - default : False |
["device | id1", "device id2", ...] |
def netbrain.sysapi.datamodel.GetDeviceMACInfo | ( | filter_list | ) |
get mac info
filter_list | (dic) - {"device1":["mac1", "mac2", ...], "device2":[], ....} |
[["host | name", "port name", "vlan name", "address"], [...], ...] |
def netbrain.sysapi.datamodel.GetDeviceSetting | ( | device | ) |
Get device setting.
device | name (string) |
example | { 'ApplianceId': 'fs36', 'CliSetting': { 'AccessMethod': 1, 'LoginScript': { 'UseLoginScript': False }, 'SSHKeyId': '', 'SSHPort': 22, 'TelnetPort': 23, 'TelnetProxyId': '', 'TelnetProxyIdForSmartCLI': '' }, 'CpuExpression': '', 'DependOn': None, 'DriverId': 'b2d313fe-43e6-4d5f-9189-b3af6b71a83a', 'Extension': None, 'ExternalServers': None, 'HostName': 'xxxx', 'LiveHostName': 'xxxx', 'LiveStatus': 1, 'Locked': False, 'ManageIp': 'xx.xx.xx.xx', 'ManageIpInt': 2887256578, 'MemoryExpression': '', 'Mode': 0, 'SNMPSetting': { 'snmpPort': 161, 'snmpVersion': 2, 'v3': { 'authMode': 0, 'authPro': 0, 'contextName': '', 'encryptPro': 0 } }, 'SubType': 2, 'Version': 420, } |
def netbrain.sysapi.datamodel.GetDeviceSiteFullPath | ( | device | ) |
get device site full path
device | (string) device name |
def netbrain.sysapi.datamodel.GetDeviceSiteName | ( | device | ) |
get device site name
device | (string) device name |
def netbrain.sysapi.datamodel.GetDriverIdBySysOID | ( | sysObjectID | ) |
def netbrain.sysapi.datamodel.GetDriverIdByVendorModel | ( | vendor, | |
model | |||
) |
def netbrain.sysapi.datamodel.GetNDTItems | ( | ) |
return all NDT Items
[{item1},{item2}...] |
def netbrain.sysapi.datamodel.GetProxyServerStatus | ( | fsId | ) |
Network settings APIs - GetProxyServerStatus.
fsId | fsId |
def netbrain.sysapi.datamodel.GetQappInfo | ( | qapp_path | ) |
get qapp content by path
qapp_path | qapp path |
def netbrain.sysapi.datamodel.GetRunbookTemplete | ( | runbook_templete_path | ) |
get runbook templete by path
runbook_templete_path | runbook templete path |
def netbrain.sysapi.datamodel.GetSchemaType | ( | schema_name | ) |
get schema type by schema name
schema_name | (string) schema name |
def netbrain.sysapi.datamodel.GetSiteProperty | ( | property_name, | |
site_path | |||
) |
get site property
site_path | (string) site path |
property_name | (string) property name |
def netbrain.sysapi.datamodel.GetVendorModel | ( | sysoid | ) |
get vendor model
sysoid | (string) oid |
def netbrain.sysapi.datamodel.QueryDataFromDB | ( | db, | |
collection, | |||
json_value | |||
) |
query data from db
def netbrain.sysapi.datamodel.RemoveDeviceFromDeviceGroup | ( | device, | |
device_group_name | |||
) |
remove device from device group
device | (string) device name |
device_group_name | (string) device group name |
def netbrain.sysapi.datamodel.RemoveDevicersFromSite | ( | siteh_path, | |
device_ids | |||
) |
– func unrealized
def netbrain.sysapi.datamodel.SaveDataToDB | ( | db, | |
collection, | |||
value | |||
) |
save json to mongodb
def netbrain.sysapi.datamodel.SetDeviceCredential | ( | device_name, | |
username, | |||
password, | |||
privilege_username, | |||
privilege_password, | |||
access_mode = 0 , |
|||
port = 0 |
|||
) |
Network settings APIs - SetDeviceCredential.
device_name | deivce name |
username | user name |
password | password |
privilege_username | privilege_username |
privilege_password | privilege_password |
access_mode | access mode - 0, – telnet 1, – SSH 2, – SSHv2 |
port | port port if 0 not change If not find deivce setting by device name, will return False. |
def netbrain.sysapi.datamodel.SetDeviceSetting | ( | device_setting_object | ) |
Set device setting.
device_setting_object | device setting object |
def netbrain.sysapi.datamodel.SetNDTItem | ( | ndtItem | ) |
set NDT Item
ndtItem | (dic) ndt item |
If | the parameter does not contain "_id", return false |
def netbrain.sysapi.datamodel.SetProxyServerOfDevice | ( | device_name, | |
fsId | |||
) |
Network settings APIs - SetProxyServerOfDevice.
device_name | device name |
fsId | fsId |
def netbrain.sysapi.datamodel.SetSiteProperty | ( | property_name, | |
site_path, | |||
value | |||
) |
set site property
site_path | (string) site path |
property_name | (string) property name |
value | (string) property value |