addTopologyLink

A Workflow Engine function that attempts to create a link between two endpoints, A (source node) and Z (sink node), in a named topology. Creates and activates the named topology if it does not exist. Leaves existing inactive topologies inactive. Adds the referenced nodes if they do not exist.

This function is available for alert workflows.

Back to Workflow Engine Functions Reference.Workflow Engine Functions Reference

Arguments

Workflow Engine function addTopologyLink 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 $(<attribute_name>). For example $(custom_info.mySourceNode)

sinkNode

yes

string

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

description

no

string

Optional link description. When not supplied, defaults to the time, date, and the triggering alert id.

Example

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

If you want to create a 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, you can run the topologies API to see your new link:

curl -X GET 'https//example.com/api/v1/topologies/my%20network/links'

Returns the following:

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