BindObject()

Deprecated in 3.0.

Please use bind() or bindTo() methods of NetObj class instead.

This function is enabled by default, but can be disabled by setting configuration parameter "NXSL.EnableContainerFunctions".
BindObject(parent, child): bool

Bind all NetXMS objects that can be bound from console (nodes, subnets, clusters, and another containers) to container objects.

Table 1. Parameters

parent

Parent object (NetObj referring to container, collector, facility, power domain, cooling zone, room, or infrastructure service root).

child

The NetXMS object to be linked to given parent object (Node or NetObj referring to subnet, container, or cluster).

Return

true if the objects were linked; false if the link is refused because deletion of either object has started, or the script lacks modify access to either object. Invalid object types, incompatible bindings and bindings that would create a loop cause a runtime error.

BindObject(FindObject(2), $node);    // Link current node directly to "Infrastructure Services"
BindObject(FindObject("Services"), FindObject("Service_1"));    // Link object named "Service_1" to container "Services"