Moogsoft Docs

createSituation

A Graze API POST request that creates a manual Situation. The Situation description is set with the description parameter.

The following Situation settings are pre-set and not configurable here:

  • Status: Opened

  • Moderator: none assigned

Back to Graze API EndPoint Reference.

Request arguments

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

description

String

Yes

Description of the new Situation.

Response

Endpoint createSituation returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

sitn_id

Number

ID of the newly created Situation.

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 createSituation:

Request example

Example cURL request to create a Situation with the description "Database Outage 08/06/2019":

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/createSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{"description" : “Database Outage 08/06/2019”}'

Response example

Example response returning the ID of the newly created Situation:

{"sitn_id":2300}