Moogsoft Docs

getSituationsWithFlag

A Graze API GET request that returns all the Situations which have the specified flag.

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

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getSituationsWithFlag takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

flag

Number

Yes

Flag to search for.

start

Number

No

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

llimit

Number

No

Maximum number of results to return. Default is 1000.

Response

Endpoint getSituationsWithFlag returns the following response:

Successful requests return a JSON object containing the following:

Type

Description

JSON Array

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

API behavior in active and historic databases

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

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of endpoint getSituationsWithFlag:

Request example

Example cURL request to retrieve all Situations that have the specified flag associated with them.

curl -X GET -u graze:graze -k -v  https://localhost/graze/v1/getSituationsWithFlag?flag=NOTIFIED

Response example

Example response returning an array of all of the Situations that have the specified flag associated with them:

[
    1,
    2,
    5
]