Difference between revisions of "NXSL:BindObject"

From NetXMS Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ Bind all NetXMS objects that can be bound from console (nodes, subnets, clusters, and another containers) to another NetXMS objects. == Syntax == BindObject(''id'...")
 
Line 1: Line 1:
__NOTOC__
__NOTOC__
Bind all NetXMS objects that can be bound from console (nodes, subnets, clusters, and another containers) to another NetXMS objects.
Bind all NetXMS objects that can be bound from console (nodes, subnets, clusters, and another containers) to container objects.




== Syntax ==
== Syntax ==


BindObject(''id'', ''objectbinded'');
BindObject(''parent'', ''child'');




Line 12: Line 12:
:{|
:{|
|-
|-
| ''id'' || ID or name of the object to bind.
| ''parent'' || Parent object ([[NXSL:NetObj|NetObj]] referring to container object or infrastructure service root).
|-
|-
| ''object'' || The NetXMS object to be linked to ID object.
| ''child'' || The NetXMS object to be linked to given parent object ([[NXSL:Node|Node]] or [[NXSL:NetObj|NetObj]] referring to subnet, container, or cluster).
|}
|}


Line 20: Line 20:
== Return Value ==
== Return Value ==


Reference to newly binded object.
None.




== Examples ==
== Examples ==


BindObject(FindObject(2), FindDCIByName($node, "Services.DataCenter1.CPD"));    // Link "Services.DataCenter1.CPD" object directly to "Infrastructure Services"
<syntaxhighlight lang="c">
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"
</syntaxhighlight>

Revision as of 10:55, 26 April 2012

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


Syntax

BindObject(parent, child);


Parameters

parent Parent object (NetObj referring to container object 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 Value

None.


Examples

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"