Moogsoft Docs

assignTeamsToSituation

A Graze API POST request that assigns one or more teams to a Situation. Once successfully run, Moogsoft AIOps marks the Situation as overridden and the Teams Manager Moolet can no longer modify its team assignment. See Teams Manager Moolet for more information.

This endpoint replaces any teams previously assigned to the Situation. You can also use it to deassign all teams from a Situation.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint assignTeamsToSituation 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_id

Number

Yes

Situation ID.

team_ids

List

No, if you specify team_names.

A list of team IDs to assign to the Situation. Specify an empty list to deassign all teams from the Situation.

team_names

List

No, if you specify team_ids.

A list of team names to assign to the Situation. Specify an empty list to deassign all teams from the Situation.

Response

Endpoint assignTeamsToSituation returns the following response:

Successful requests return a JSON object containing one of the following, depending on the request argument used:

Name

Type

Description

team_ids

List

A list of team IDs assigned to the Situation.

team_names

List

A list of team names assigned to the 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 assignTeamsToSituation:

Example assigning team IDs

Example cURL request to assign team IDs 1 and 2 to Situation 1:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/assignTeamsToSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{"sitn_id" : 1 , "team_ids" : [ 1, 2 ]}'

Example response returning the team IDs (1 and 2) that have been successfully assigned to the Situation:

{"team_ids" : [ 1,2 ]}

Example assigning team names

Example cURL request to assign teams "Network_US" and "Network_UK" to Situation 2:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/assignTeamsToSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{"sitn_id" : 2 , "team_names" : [ "Network_US", "Network_UK" ]'

Example response returning the team names ( "Network_US" and "Network_UK") that have been successfully assigned to the Situation:

{"team_names" : [ "Network_US", "Network_UK" ]}

Example unassigning teams

Example cURL request to unassign all teams from Situation 1:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/assignTeamsToSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{"sitn_id" : 1 , "team_ids" : []}'

Example response returning an empty list showing that all the teams have been successfully unassigned from the Situation:

{"team_ids" : []}