Skip to main content

listSituationHosts

A Workflow Engine function that adds the current hostnames in the Situation into the workflow context under “situationHosts”. By default, this is a JSON list (an array). Optionally, you can convert this information to a CSV string. The resulting object or string can be used in subsequent actions as needed. When you use this function with a sweep up filter, the final list contains the unique hosts from all in-scope Situations.

The listSituationHosts function uses the underlying MoogDbV2 API call getSituationHosts().

This function is available as a feature of the Add-ons v2.2 download and later.

This function is available for Situation workflows only.

The workflow sweep up filter applies to this function.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function listSituationHosts takes the following arguments:

Name

Required

Type

Description

convertToCSV

no

string (true|false)

Convert the resulting list to a CSV.

Example

The resulting workflow context when the default (list) is used:

WORKFLOW CONTEXT: SITUATION: 186 :  : 
{
    "situationHosts": [
        "localhost",
        "10.0.1.2",
        "10.0.1.1"
    ]
}

When convertToCSV is set to true, the resulting workflow context is:

WORKFLOW CONTEXT: SITUATION: 186 :  :

WORKFLOW CONTEXT: SITUATION: 186 :  : 
{
    "situationHosts": "localhost,10.0.1.2,10.0.1.1"
}