checkTopologyLink

A Workflow Engine function that returns true when a link exists between two endpoints, A (source node) and Z (sink node), in a named topology. Assumes direct connection when no hop count is supplied. For hop counts greater than 1, returns true when the a connection exists and the distance between nodes is less than or equal to the hop count. Otherwise returns false.

This function is available for alert workflows.

Back to Workflow Engine Functions Reference.Workflow Engine Functions Reference

Arguments

Workflow Engine function checkTopologyLink takes the following arguments:

Name

Required

Type

Description

topologyName

yes

string

The name or substited value for the topology. To substitute a value, use $(<attribute_name>). For example $(custom_info.myTopology)

sourceNode

yes

string

The name or substituted value for the 'A' endpoint (source node). To substitute a value, use $(&lt;attribute_name&gt;). For example $(custom_info.mySourceNode)

sinkNode

yes

string

The name or substituted value for the 'Z' endpoint (sink node). To substitute a value, use $(&lt;attribute_name&gt;). For example $(custom_info.mySinkNode)

hopCount

no

string

Optional distance in hops between the nodes. Defaults to 1 when not specified.

Example

The following example demonstrates typical use of Workflow Engine function checkTopologyLink.

If you want to check for direct link in the topology "my network" between the alert source and another node you have previously added to the workflow context, set the following:

  • topologyName: my network

  • sourceNode: $(source)

  • sinkNode: $(workflowContext.destination)

The UI translates your settings to the following JSON:

{"topologyName":"my network",
"sourceNode":"$(source)","sinkNode":"$(workflowContext.destination)"}

For an alert where source = sflinux101 and the corresponding workflowContext.destination = sflinux102, the function returns true when a direct link exists as follows:

[{
    "description": "Automatically created link:
triggering alert # 35 @ 2020-05-08T02:14:05.680Z",
    "sourceNode": "sflinux101",
    "sinkNode": "sflinux102"
}]