FindObject

FindObject(key, currentNode): NetObj

Look up any object inherited from NetObj (Node, Interface, Cluster, etc.) by either name or object id.

If trusted node validation is enforced, currentNode should point to execution context object (instance of NetObj, $node in most cases). If trusted nodes are disabled (default server configuration), currentNode can be omitted or set to null.

Table 1. Parameters

key

String

Object name or id.

currentNode

NetObj

Lookup context or null if trusted nodes validation is disabled. Optional parameter.

Return

Instance of object inherited from NetObj or null if not found or not accessible. Type of the object can be verified using function classof.

node = FindObject("Infrastructure Services"); //Will find node with name "Infrastructure Services"
println(node.name); //Will print "Infrastructure Services"
println(node.id); //Will print "2"