Module APIs are used to serve the system features and can be grouped into the following categories:
▪Map
▪Site
API |
Description |
---|---|
AddMessage(message, message_level[, associated_table_name, row_index_of_associated_table]) |
Print a message. ▪message — the message text. ▪message_level — the level of the message. The default value is MessageLevel.Information. ▪associated_table_name — the name of the associated table. The default value is null. ▪row_index_of _associated_table (int) — specify a row number of the associated table. The default value is 0. |
AddDeviceAlert(device_name, alert_name, alert, alert_level) |
Print a device alert message in the Event Console. ▪device_name — the device name. ▪alert_name — the name of the alert text (this API is preserved and to be expanded). ▪alert — the alert text. ▪alert_level — the level of the alert, such as AlertLevel.Error or AlertLevel.Warning. |
AddInterfaceAlert(device_name, interface_name, alert_name, alert, alert_level) |
Print an interface alert message in the Event Console. ▪device_name — the device name. ▪interface_name — the interface name. ▪alert_name — the name of the alert text the name of the alert text (this API is preserved and to be expanded). ▪alert — the alert text. ▪alert_level — the level of the alert, such as AlertLevel.Error or AlertLevel.Warning. |
CompleteInterfaceName(device_name, interface_name) |
Return a complete interface name by looking up the interface name translation table according to the corresponding device type of the device and interface name. |
GetInterfaceShortName(device_name, interface_name) |
Return the short name of an interface according to the corresponding device type of the device and interface name. |
GetInterface(device_name, interface_name, interface_type) |
Return an interface object. ▪device_name — the device name. ▪interface_name — the interface name. ▪interface_type — the interface types. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface. ogreVpnIntfs — GRE VPN interface. |
GetInterfacesByType(interface_type) |
Return all the interfaces that belong to a specified interface type. The returned data type is list. ▪interface_type — the interface types. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface. ogreVpnIntfs — GRE VPN interface. |
API |
Description |
---|---|
MapAutoLayout ([layout_style, map_name, page_name]) |
Specify the layout style of a map. ▪layout_style — the style of map layout. By default, the value is LayoutStyle.Symmetric. See Auto Layout Style for more details. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
MapAutoLink([topology_type, map_name, page_name]) |
Auto link the devices on a map page. ▪topology_type — Specify to use which topology type to connect. The default value is IPv4 L3 topology. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawDevice(device_name[, auto_link, topology_type, map_name, page_name]) |
Draw a device on a map. ▪device_name — the device name. ▪auto_link — the value type is bool and the default value is true, which means that the auto link is enabled. ▪Topology_type — specify to use which topology type. The default value is IPv4 L3 topology. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawInterface(device_name, interface_name, interface_type, topology_type[, map_name, page_name]) |
Draw the specified interfaces of a device on a map. ▪device_name — the device name. ▪interface_name — the interface name. ▪interface_type — the interface type. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface. ogreVpnIntfs — GRE VPN interface. ▪Topology_type — the topology type. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawInterfaceNeighbor(device_name, interface_name, interface_type, topology_type, neighbor_device_name[, map_name, page_name]) |
Draw the specified interface and its neighbor device on a map. ▪device_name — the device name. ▪interface_name — the interface name. ▪interface_type — the interface type. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface. ogreVpnIntfs — GRE VPN interface. ▪Topology_type — the topology type. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪neighbor_device_name — the name of the neighbor device. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawEndSystem(address[, connected_device_name, connected_interface_name, interface_type, topology_type, map_name, page_name]) |
Draw an end system on a map. ▪address — the IP or MAC address of the end system. ▪connected_device_name — the hostname of the device that the end system connects to. ▪connected_interface_name — the name of the interface that the end system connects to. ▪interface_type — the type of the interface that the end system connects to. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface. ogreVpnIntfs — GRE VPN interface. ▪topology_type — the topology type. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawMapNote(title, content[, note_type, expand, forecolor, font_size, align, background_color, map_name, page_name]) |
Draw a note to a map. ▪title — the title of the note content. ▪content — the content of the note ▪note_type — the type of displaying a map. The default type is notetype.append. See note type for more details. ▪expand — whether to expand the note content. The value type is bool and the default value is False. ▪forecolor — the font color of the note text. ▪font_size — the font size of the note text. ▪align — the alignment style of the note text. The default value is color.black. See alignment for more details. ▪background_color — the background color of the note. The default value is Color.RGB(255, 255, 128). ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawDeviceNote(device_name, title, content[, note_type, expand, forecolor, font_size, align, background_color, map_name, page_name]) |
Draw a note attached to the specified device on a map. ▪device_name — the device name. ▪title — the title of the note content. ▪content — the content of the note. ▪note_type — the type of displaying a map. The default type is notetype.append. See note type for more details. ▪Expand — whether to expand the note content. The value type is bool and the default value is False. ▪forecolor — the font color of the note text. ▪font_size — the font size of the note text. ▪align — the alignment style of the note text. The default value is color.black. See alignment for more details. ▪background_color — the background color of the note. The default value is Color.RGB(255, 255, 128). ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawInterfaceNote(device_name, interface_name, interface_type topology_type, title, content[, note_type, expand, forecolor, font_size, align, background_color, map_name, page_name]) |
Draw a note attached to one interface of a device on a map. ▪device_name — the device name. ▪interface_name — the interface name. ▪interface_type — the type of the interface. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface ▪Topology_type — the topology type. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪title — the title of the note content. ▪note_type — the type of displaying a map. The default type is notetype.append. See note type for more details. ▪Expand — whether to expand the note content. The value type is bool and the default value is false. ▪forecolor — the font color of the note text. ▪font_size — the font size of the note text. ▪align — the alignment style of the note text. The default value is color.black. See alignment for more details. ▪background_color — the background color of the note. The default value is Color.RGB(255, 255, 128). ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawHyperLink(text, url[, map_name, page_name]) |
Draw a hyperlink on a map. ▪text — the display text of the hyperlink ▪url — the address of the hyperlink. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawTraceRouteHops([{'ips':[]}]) |
Draw the traceroute result hop by hop on a map based on the IP address of each hop. The parameter of this API is a sequential hop list and you need to enter all hops based on the sequence that a hop is drawn. ips — The IP address of a hop. Input all load balance IP addresses in the ips field if a hop contains load balance. For example, 'ips':["IP2","IP3"], IP2 and IP3 are loading-balancing hop. |
HighlightDevice(device_name, legend[, color, append, map_name, page_name]) |
Highlight the specified device on a map. ▪device_name — the device name. ▪legend — the legend name. ▪color — the color of the highlighted device. The default value is color.random. ▪append — append the highlight color and display multiple colors at one time. The value type is bool and the default value is true. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
HighlightInterface(device_name, interface_name, interface_type, topology_type, legend[, color, line_style, width, append, map_name, page_name]) |
Highlight the specified interface on a map. ▪device_name — the device name. ▪interface_name — the interface name. ▪interface_type — the interface type. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface ▪Topology_type — the topology type. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪legend — the legend name. ▪color — the color of the highlighted interface. The default value is color. random. See color for more details. ▪append — decide whether to append the highlight color and display multiple colors at one time. The value type is bool and the default value is true. ▪width — the width of the link. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
HighlightNeighbor(source_device_name, destination_device_name, legend, source_text, destination_text[, color, two_way, line_style, thickness, map_name, page_name]) |
Highlight the specified neighbor of a device on a map. ▪source_device_name — the hostname of the source device. ▪destination_device_name — the hostname of the neighbor device. ▪legend — the legend name. ▪source_text — any strings about the source device. ▪destination_text — any strings about the neighbor device. ▪color — the color of the highlighted interface. The default value is color. random. See color for more details. ▪two_way — whether to draw a line with two directions. The value type is bool and the default value is false. ▪line_style — the style of the line. See line style for more details. ▪thickness — the thickness of the link. The default value is 2. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
DrawHop(device_name1, device_name2[, text, color, line_type, thickness, map_name, page_name]) |
Drop a line pointing to the next hop of a device on a map. ▪device_name1 — the hostname of the source device. ▪device_name2 — the hostname of the next hop device. ▪text — a text displayed on the next hop device. The default value is null. ▪color — the color of the line leading to the next hop device. The default value is color.red. ▪line_style — the style of the line. See line style for more details. ▪thickness — the thickness of the link. The default value is 2. ▪map_name — the name of a map. The default value is null, which means that the map that the current Qapp runs on. ▪page_name — the name of the map page. The default value is null, which means that the map page that the current Qapp runs on. |
GetAllVisibleDevices |
Return all devices on a map. The returned data type is list. |
GetAllVisibleInterfaces |
Return all visible interfaces of a specified device on a map. The returned data type is list. ▪device_name — the hostname of the specified device. |
API |
Description |
---|---|
SetDeviceProperty(property_name, device_name, value) |
Set a value for a specified property of a device. ▪property_name — the name of the specified device property, such as software version. ▪device_name — the hostname of the specified device. ▪value — the value of the property. |
GetDeviceProperty(property_name, device_name) |
Return the value of a specified device property. ▪property_name — the name of the specified device property, such as software version. ▪device_name — the hostname of the specified device. |
SetModuleProperty(property_name, device_name, module_name, value) |
Set a value for a specified module property of a device. ▪property_name — the name of the specified module property, such as SW Rev. ▪device_name — the hostname of the specified device. ▪module_name — the name of the module. ▪value — the value of the module property. |
GetModuleProperty(property_name, device_name, module_name) |
Return the value of a specified module property. ▪property_name — the name of the specified module property, such as SW Rev. ▪device_name — the hostname of the specified device. ▪module_name — the name of the module. |
SetInterfaceProperty(property_name, device_name, interface_name, interface_type, value) |
Set a value for a specified interface property of a device. ▪property_name — the name of the specified interface property, such as SW Rev. ▪device_name — the hostname of the specified device. ▪interface_name — the name of the interface. ▪interface_type — the type of the interface. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface ▪value — the value of the module property. |
GetInterfaceProperty(property_name, device_name, interface_name, interface_type) |
Return the value of a specified interface property of a device. ▪property_name — the name of the specified module property, such as SW Rev. ▪device_name — the hostname of the specified device. ▪interface_name — the name of the interface. ▪interface_type — the type of the interface. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface |
SetSiteProperty(property_name, site_path, value) |
Set a value for the specified property of a site. ▪property_name — the name of the specified site property, such as Region. ▪site_path — the full path of the site, such as My Network\Site A. ▪value — the value of the site property. |
GetSiteProperty(property_name, site_path) |
Return the value of the specified site property. ▪property_name — the name of the specified site property, such as Region. ▪site_path — the full path of the site, such as My Network\Site A. |
API |
Description |
---|---|
SetDeviceCredential(device_name, username, password, privilege_username, privilege_password[, access_mode, port]) |
Set the login credentials for a device. ▪device_name — the hostname of the device. ▪username — the username to log in to the device. ▪password — the password to log in to the device. ▪privilege_username — the username to enter the privileged mode of the device. ▪privilege_password — the password to enter the privileged mode of the device. ▪access_mode — the access mode, such as Telnet, SSH. ▪port — the port of the access mode, such as 23. |
API |
Description |
---|---|
CreateDeviceGroup(device_group_name, device_group_type) |
Create a device group. ▪device_group_name — the name of the device group. ▪device_group_type — the type of the device group, such as Public. |
AddDeviceToDeviceGroup(device_name, device_group_name) |
Add a device into a device group. ▪device_group_name — the name of the device group. ▪device_name — the device name. |
RemoveDeviceFromDeviceGroup(device_name, device_group_name) |
Remove a device from a device group. ▪device_group_name — the name of the device group. ▪device_name — the device name. |
ClearDevicesInDeviceGroup(device_group_name) |
Clear devices in a device group. ▪device_group_name — the name of the device group. |
GetDevicesFromDeviceGroup(device_group_name) |
Return all devices in a device group. The returned object type is list. ▪device_group_name — the name of the device group. |
API |
Description |
---|---|
GetSitePathOfDevice(device_name)) |
Return the full path of the site that contains the specified device. ▪device_name — the device name. |
GetSiteNameOfDevice(device_name) |
Return the name of the site that contains the specified device. ▪device_name — the device name. |
GetDevicesFromSite(site_path[, include_child]) |
Return all devices in a site. The returned object type is list. ▪site_path — the full path of the site, such as My Network\Site A. ▪include_child — the value type is bool and the default value is false, which means that returned value does not include devices in the site's child sites. |
API |
Description |
---|---|
FindVendorbyMac(mac_address) |
Return the vendor information about a device by MAC address. ▪mac_address — the MAC address of the device. |
API |
Description |
---|---|
AddDeviceDataUnit(device_name, item_name, item_type, value) |
Add a data unit for a device for data view. ▪device_name — the device name. ▪item_name — the name of the data unit, such as version. ▪item_type — the type of the data unit, such as string and int. ▪value — the value of the data unit. |
AddInterfaceDataUnit(device_name, interface_name, interface_type, topology_type, item_name, item_type, value) |
Add a data unit for a specified interface of a device for data view. ▪device_name — the device name. ▪Interface_name — the interface name. ▪Interface_type — the interface type. The interface type includes: ointfs — physical interface. oipIntfs — IPv4 Interface. oip6Intfs — IPv6 interface. oipsecVpnIntfs — IPsec VPN interface ▪Topology_type — the topology type. The topology type includes: oL2_Topo_Type — Layer 2 topology. oL3_Topo_Type — IPv4 Layer 3 topology. oIpv6_L3_Topo_Type — IPv6 L3 Topology. oVPN_Topo_Type — L3 VPN Tunnel topology. ▪item_name — the name of the data unit, such as mtu. ▪item_type — the type of the data unit, such as string and int. ▪value — the value of the data unit. |
API |
Description |
---|---|
ListDir (absolute_path) |
Return the files and sub-folders contained in a specified folder. ▪absolute_path — the absolute path of the folder. |
ReadFile (absolute_path) |
Return the content of a file ▪absolute_path — the absolute path of the file. |
IsFolder (absolute_path) |
Judge whether the folder path is valid. If valid, return True, else return false. ▪absolute_path — the absolute path of the folder. |
IsFile (absolute_path) |
Judge whether the file path is valid. If valid, return True, else return false. ▪absolute_path — the absolute path of the file. |
Exists (absolute_path) |
Judge whether the absolute path of a file or folder exists. if existing, return True, else return false. ▪absolute_path — the absolute path of the file or folder. |
See also: