Moogsoft Docs

getSituationsWithFlag

A MoogDb v2 method that returns all the Situations which have the specified flag.

See Situation Flags for more information on Moogsoft AIOps Situation flags.

Request arguments

Method getSituationsWithFlag takes the following request arguments:

Name

Type

Required

Description

flag

String

Yes

Flag to search for.

start

Number

No

Starting point of the result set to return. Default is 0.

limit

Number

No

Number of results to return. Default is 1000.

Response

Method getSituationsWithFlag returns the following response:

Type

Description

JSON Array

An array of the Situation IDs that have the specified flag associated with them.

API update behavior

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

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method getSituationsWithFlag:

Request example

Example request to return all Situations with flag "S1":

var result = JSON.stringify(moogdb.getSituationsWithFlag("S1",0,1000))
Response example

Example response returning the Situation IDs with the specified flag:

[1, 2, 3]