related.hostingNode
related.hostingNode( ["fallback_kind"], attributes...)
Returns a Host or Cluster node that is associated with the node that triggered the pattern.The parameter attributes contain key-value pairs corresponding to attributes, they are used to determine whether the hosting node is a Host or a Cluster. The function examines the hosting node and returns either a Host or a Cluster depending on what is found:
- If no Cluster is found, the returned node is a Host.
- If there is a Cluster and attributes are empty, the fallback kind determines the returned node kind. For example, "Cluster" shown in the code example. The default is Host.
- If there is a Cluster but no cluster configuration has been discovered, the fallback kind determines the returned node kind. The default is Host.
- If there is a Cluster but no ClusterResource matches all items in the attributes, the returned node is a Host.
- If there is a Cluster and a ClusterResource matches all items in the attributes, the returned node is a Cluster.
In all cases, if the triggers cannot be associated with any Host, the action returns None.
The following code example is taken from the pattern to discover Microsoft SQL Server instances.
// Get the Cluster or Host node that is logically hosting this // SoftwareInstance. required_properties := table(); required_properties['InstanceName'] := servername; hosting_node := related.hostingNode( "Cluster", type := "SQL Server", properties := required_properties);
Was this page helpful? Yes No
Submitting...
Thank you
Comments
Log in or register to comment.