setSituationFlags

A Graze API POST request that updates the flags associated with a specified Situation. You can add flags to or remove them from a Situation.

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

Back to Graze API EndPoint Reference.

Request arguments

Endpoint setSituationFlags 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.

sitn_ids

Array of Numbers

Yes

An array of IDs for the Situations you want to update.

to_add

Array of Strings

Yes

Flags to be added to those Situations. If this is an empty list, no flags are added to the Situation.

to_remove

Array of Strings

Yes

Flags you want to remove from the Situation. If this is an empty list, no flags are removed from the Situation.

Response

Endpoint setSituationFlags returns the following response:

API update behavior

The behavior of this endpoint 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 endpoint updates the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of endpoint setSituationFlags:

Request example

Example cURL request to change the flags assigned to a situation. This change can include adding and/or removing flags. If one of the change arguments is left empty, nothing will change for that action.

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/setSituationFlags" -H "Content-Type: application/json; charset=UTF-8" -d '{"sitn_ids":[ 1 ], "to_add": [ "NOTIFIED","TICKETED"],"to_remove": [] }'

Response example