Skip to main content

getSituationHosts

A Graze API GET request that returns the hosts for a specified Situation, either for all the alerts in the Situation or just for the unique alerts.

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

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.

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"
     ]
}