Moogsoft Docs

getSituationHosts

A Graze API GET request that returns the hosts for a specified Situation.

Back to Graze API EndPoint Reference.

Request arguments

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

for_unique_alerts

Boolean

No

Response

Endpoint getSituationHosts returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

hosts

JSON object

An array of all hosts that sent alerts contained in the specified Situation.

API update behavior

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

Request example

Example cURL request to return all the hosts that sent alerts to Situation ID 447:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationHosts" --data-urlencode 'sitn_id=447'
Response example

Example response returning all the hosts that sent alerts to Situation ID 447:

{  
   hosts:[  
      "xldn1204pap",
      "xldn1215pap",
      "xldn1220pap",
      "vxldn1230pap",
      "xldn1241pap",
      "xldn1252pap",
      "xldn1271pap",
      "xldn1278pap",
      "xldn1297pap",
      "xldn1299pap"
   ]
}