Skip to main content

getSituationsWithFlag

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

See Situation Flags for more information on Moogsoft Enterprise 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. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

flag

String

Yes

Name of the flag to search for.

start

Number

No

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

limit

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.

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 -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationsWithFlag" --data-urlencode '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 ]