R12.1-JA-2025June05

Support Native Objects

In some scenarios, users may want to perform diagnoses on specific objects. For example, build a diagnosis and generate output based on data from the device (‘$device’ object), not just the current device (‘$this_device’). NI supports the native objects in NI: device, interface, map, path, site, device group, and file. Each type of object has a set of property variables and methods.

Sample Use Cases:

  • For Device Object:
    • Use Case 1: Loop a device group/site and return the $device object, then use the associated GDR/NCT for programming. Then users can also draw $devices to map and highlight the $devices’ properties.
    • Use Case 2: Create a diagnosis and find a device list that meets the requirements in the domain, then loop this device list to call follow-up NIT. Finally, draw devices to map and highlight the devices with alert/success.
  • For Map Object:
    • Use Case 1: Support looping map objects via map folders (level 1 only) and looping each device within the map.
    • Use Case 2: Schedule to update a map via intent. For example, draw a multicast tree map and show the required data on this map.
  • For Site Object:
    • Users can use intent to add devices to a site.
  • For Device Group Object:
    • Users can use intent to create device groups or add devices to a device group.
  • For File Object:
    • Use a simple text file, which includes a set of IP strings of critical servers in a company server farm (e.g. 192.168.1.1, 192.168.1.2, ...), then use this IP list to do network change verification - Ping all these IPs from a set of key devices.

Property Variables and Methods

The following table lists the supported native objects.

Object TypePropertiesID PropertyMethodsRelated Functions & Diagnosis Actions
Device
  • string Hostname
  • int Main_Device_Type, Device_Type
  • string Main_Device_Type_Name, Device_Type_Name
  • string Mgmt_IP
  • string Vendor, string Model, Software_Version
  • string Location
  • Hostname
  • GetProperty(string PropertyName) (Obtain the value of a property based on its display name)
  • GetTopoNeighbors(int TopologyType)
  • GetTopoNeighbors(string TopologyType) (Return the list of Interface object)
  • GetInterfaceList(string InterfaceType=”Interface”) (Return a list of Interface object)
  • GetInterfaceList(int InterfaceType) (Return the list of Interface object)
  • GetInterfaceNameList(string InterfaceType=”Interface”) (Return the list of interface name string)
  • GetInterfaceNameList(int InterfaceType) (Return the list of interface name string)
  • GetConfigFile() (Return the string of baseline config file)
  • SetProperty(string PropertyName, string Value)
  • A special function: ToString() (Return Hostname)

Related Global Functions:

  • Device Device(string Hostname)
  • bool DoesDeviceExist(string Hostname)

Related Diagnosis Actions:

  • Find Objects in Domain
    • Find Devices in Domain
    • Find Devices in a Selected Device Group
    • Find Devices in a Selected Site
    • Find Devices in a Selected Map
  • Operate on List
    • Add device to List
    • Remove device from List
Interface
  • string Hostname
  • string Interface_Name
  • string IPv4_Address (primary ip address)
  • string IPv6_Address
  • string MAC_Address
  • int Bandwidth
  • string Speed, Duplex
  • string InterfaceType (one of Interface, IPv4 Interface, IPv6 Interface, IPsec VPN Interface, GRE VPN Interface)
  • Hostname
  • Interface_Name
  • InterfaceType
  • GetDevice() (Return device object)
  • GetProperty(string propertyName) (Obtain the value of a property based on its display name)
  • SetProperty(string propertyName, string value) (Set the value of a property based on its display name)
  • GetTopoNeighbors(int TopologyType) (Return the list of Device Interface object)
  • GetTopoNeighbors(string TopologyType) (Return the list of Device Interface object)
  • A special function: ToString() (Return $Hostname.$Interface_Name, such as ‘R1.e0/1’)

Interface can be used in the return value of the following functions:

  • Device.GetTopoNeighbors(string TopologyType)
  • Map.GetDeviceInterfaceList
  • Path.GetLastResult()

Related Global Functions:

  • Interface Interface(string Hostname, string InterfaceName, string InterfaceType="Interface")
  • Interface InterfaceByIP(string IPAddress)
  • bool DoesInterfaceExist(string Hostname, string InterfaceName)

Related Diagnosis Logics:

  • Find Objects in Domain
    • Find Interfaces in Domain
    • Find Interfaces in a Selected Device Group
    • Find Interfaces in a Selected Map
Path
  • string PathName
  • string ApplicationName
  • string Type ("Unicast" or ”Multicast")
  • string SourceIP, string:DestinationIP (for Unicast path)
  • int SourcePort, DestinationPort (for TCP/UDP Unicast path only)
  • string MulticastReceiver, MulticastSource, MulticastGroup
  • string Protocal (IP, TCP, UDP, IPv4, IPv6, etc)  
  • PathName
  • ApplicationName
  • GetLastResult() (Return a List of Interface Object)
  • GetDeviceList() (Return all devices of the last result, the list of Device Object)
  • A special function: ToString() (Return $ApplicationName.$PathName, such as ServiceNow.WebServerToDB)

Related Global Functions:

  • Path Path(string ApplicationName, string PathName)

Related Diagnosis Logics:

  • Find Objects in Domain
    • Find Paths in Domain
Map
  • string Name
  • string FullPath (Folder + FileName)
  • string Author (the last modifier of the map
  • string Type (Common Map, Site Map, Path Map, Intent Map)
  • FullPath
  • GetPageNameList() (Return the list of page name)
  • GetDeviceList(string PageName) (Return the list of Device object. If no page is specified, return the device list of all pages)
  • GetDeviceInterfaceList(string PageName) (Return the list of Interface object)
  • Functions to Change Map Content: AddPage(string PageName, int PageIndex), RemovePage(string PageName), and RemovePage(int PageIndex)
  • GetURL() (Return URL string)
  • Add Map To Incident: AddToIncident(string IncidentID), AddToEmbeddedIncident()
  • SetAsIntentMap(int Option = OverwriteExistingMap=1, SkipIfExistAlready=2 ) (Set the current map as the intent map of the current intent. If the intent map already exists, users can choose either overwrite or skip. ‘skip’ is the default action)
  • SetActivePage(string pageName) (Activate the given page)
  • A special function: ToString() (Return map name)

Related Global Functions:

  • Map NewMap (string FullPath)
  • Map Map(string FullPath)
  • DeleteMap(string FullPath)

Note: Only common maps are supported in the above functions; function maps are not supported.

Related Diagnosis Logics:

  • Find Objects in Domain
    • Find Maps in a Selected Map Folder
  • Draw Map
    • Target Map can be $output_map or $map
    • Target Page Name
    • Draw Actions
Site
  • string Name
  • string FullPath (.../ParentSiteName/ThisSiteName)
  • bool IsLeafSite
  • FullPath
  • GetDeviceCount()
  • GetDeviceList() (Return the list of Device object)
  • Modify site: AddDevice(string hostname), RemoveDevice(string hostname)
  • GetSiteMap() (Return Map object)
  • GetProperty(string propertyName) (Obtain the value of a property based on its display name)
  • SetProperty(string propertyName, string value)
  • GetParentSite() (Return Parent Site Object)
  • GetChildSiteCount()
  • GetChildSite(int index) (Return Child Site object)
  • A special function: ToString() (Return site name)

Related Global Functions:  

  • Site NewSite (string Name, string ParentPath, bool IsLeafSite)
  • Site Site (string Name, string ParentPath)
  • Map GetSiteOverviewMap()

Related Diagnosis Logics:

  • Find Objects in Domain
    • Find Sites in Domain
DeviceGroup
  • string Name
  • string FullPath (folder1/folder2/groupName)
  • FullPath
  • GetDeviceCount()
  • GetDeviceList() (Return list of Device object)
  • GetDeviceInterfaceList() ((Return the list of Device Interface object)
  • GetDeviceGroupMap() (Return Map object)
  • AddDevice(string hostname)
  • RemoveDevice(string hostname)
  • A special function: ToString() (Return Device Group Name)

Related Global Functions:  

  • DeviceGroup NewDeviceGroup (string Name, string Folder)
  • DeviceGroup DeviceGroup (string FullPath)

Related Diagnosis Logics:

  • Find Objects in Domain
    • Find DeviceGroups in a Selected Device Group Folder
File
  • string Name
  • string FullPath  (Folder + FileName)
  • string Type ("Text", "CSV", "Json")
  • FullPath
  • string GetTextContent() (Return all the content of the current Text File)
  • GetStringList(string Separator) (Return the list of String)
  • WriteText(string Content, int Overwrite or Append) (Write the specified string to the current file)
  • WriteTable($table) (Write the contents of a given Table object to the current File in CSV format)
  • A special function: ToString() (Return File Name)

Related Global Functions:  

  • File NewFile (string FileName, string Folder, string Type="Text")
  • File File (string FullPath, string Type="Text")

Related Diagnosis Logics:

  • Find Objects in Domain
    • Find Files in a Selected Folder
  • Set Table By CSV (Fill the given Global/Local table with the contents of the csv file in the specified NetBrain Files)

For the parameters 'TopologyType' and 'InterfaceType' mentioned in the above Method column, you can input either a number or a string (enclosed in double quotes). It is recommended to use a string for better readability of the intent logic.

Parameter
Candidate Value
Related Object Methods
TopologyType
"L2 Topology" = 1
"IPv4 L3 Topology" = 2
"IPv6 L3 Topology" = 3
"L3 VPN Tunnel" = 4
"Logical Topology" = 5
"L2 Overlay Topology" = 6
Device: GetTopoNeighbors
Interface: GetTopoNeighbors
InterfaceType
"Interface" = 1
"IPv4 Interface" = 2
"IPv6 Interface" = 3
"IPsec VPN Interface" = 4
"GRE VPN Interface" = 5
Device: GetInterfaceList
Device: GetInterfaceNameList

Related Global Functions

See Supported Built-in Functions in Network Intent for more details.

Information

Note

  • For device and interface objects, they cannot be created in NI. You can only find the device or interface already in the current domain.
  • Map, site, device group, and file objects can be created in NI by the newly added functions.
  • Path object cannot be created in NI either. You can find the path that has been defined in the domain based on the application name and path name.
  • Find object in Domain

    You can use a diagnosis logic to find various types of objects in the domain. The found objects that meet the conditions will be placed in a specified result list.

    1. You can select one of the following 6 object types, and the ‘Find’ UI will change depending on the selected object type.
      图形用户界面, 应用程序

描述已自动生成
    2. For ‘Result List’, you can directly select a list variable in global variables or local variables, whose variable type should be consistent with the selected object.
      You can also define a new list variable by clicking Define Variable. The variable type is fixed, and you only need to enter the list variable name and specify whether it is a local variable or a global variable.
      图形用户界面, 应用程序

描述已自动生成

    After the above definition, all matching objects found according to the specified scope and condition will be put into a specified result list variable. If no condition is defined, all objects in the scope will be added to the list.

    Depending on the selected object type, the UI is displayed as follows:

    • Find Devices in Domain: You can find devices from a device group, site, map, or domain, and then define the criteria to narrow down the scope.
      图形用户界面, 应用程序

描述已自动生成
      $this_device can be used as a special device object so users can use the device property variable directly.
    • Find Interfaces in Domain: You can find interfaces from a device group, map, or domain, then define the criteria related to the device and interface to narrow down the scope.
      图形用户界面

描述已自动生成
    • Find Paths in Domain: The search scope is domain by default. You can search path from all application paths in a domain.

    • Find Maps in Folder: You just need to select a map folder as the search scope, then define the criteria to narrow down the scope.
      表格

中度可信度描述已自动生成
    • Find Device Groups in Folder: You just need to select a device group folder as the search scope, then define the criteria to narrow down the scope.
      图形用户界面, 应用程序

描述已自动生成
    • Find Sites in Domain: There is no need to specify the search scope, and the sites will be searched in all container/leaf sites of the current domain.
      表格

描述已自动生成