getSituationTopology

A MoogDb v2 method that returns the topology of all alerts connected to a Situation. This is sent as a JSON object in NetJSON format that represents the nodes affected by the Situation.

Back to MoogDb V2 API Method Reference.

Request arguments

Method getSituationTopology takes the following request arguments:

Name

Type

Required

Description

sigId

Number

Yes

Situation ID.

context

Integer

Yes

fieldName

String

Yes

Attribute of the alert that defines the node. The default is the alert 'source' but you can specify any valid alert field, including custom_info attributes. For example, field_name=custom_info.eventDetails.line.

properties

Array of Strings

Yes

Response

Method getSituationTopology returns the following response:

Type

Description

Object

A JSON object in NetJSON format that represents the nodes affected by the Situation.

API update behavior

The behavior of this method depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This method updates or returns information about the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method getSituationTopology:

Request example

Example request to retrieve the topology link and node details for Situation ID 12 in the "host" topology within 4 hops:

var sigId = 12;
var context = 4;
var topologyName = "host";
var properties = ["severity", "vertex_entropy", "prc", "description"];
var situationTopology = moogdb.getSituationTopology(sigId, context, topologyName, properties);

Response example

Example response returning the links and nodes for the Situation:

{
    "links": [
        {
            "source": "host2728",
            "target": "host2736"
        },
        {
            "source": "host2728",
            "target": "host1156"
        },
        {
            "source": "host2835",
            "target": "host2728"
        },
        {
            "source": "host2801",
            "target": "host2827"
        },
        {
            "source": "host2800",
            "target": "host2801"
        },
        {
            "source": "host2801",
            "target": "host2835"
        },
        {
            "source": "host2835",
            "target": "host2736"
        }
    ],
    "nodes": [
        {
            "id": "host2835",
            "properties": {
                "severity": 5,
                "prc": 0.9862626716344282,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.1794592472207979
            }
        },
        {
            "id": "host2736",
            "properties": {
                "severity": 4,
                "prc": 0.42722191049803876,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.08976540495989357
            }
        },
        {
            "id": "host2728",
            "properties": {
                "severity": 3,
                "prc": 0.007672752075071621,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.1794592472207979
            }
        },
        ]
}