getSituationVisualization
A Graze API GET request that returns the Visualize information for a Situation.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint getSituationVisualization
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Number | Yes | Situation ID. |
Response
Endpoint getSituationVisualization
returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| Integer | Situation ID. |
| String | Process that caused the Situation to be created, for example, |
| Object | Details of the origin of the Situation, for example the |
| Object | The If a threshold was removed from the Recipe after Situation creation, it is not returned in the response. If a threshold was added to the Recipe after Situation creation, the |
Examples
The following examples demonstrate typical use of the getSituationVisualization
endpoint:
Request example
Example cURL request to return information on the origin and cause of Situation ID 358:
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationVisualization" --data-urlencode "sitn_id=358"
Response examples
Example response for a Situation created by a Cookbook Recipe:
{ "thresholds": { "agent": { saved: 1.0, original: 0.7 }, "source": { saved: 0.97, original: 0.6 } }, "origin": "Cookbook", "cause": { "cookbook_name": "Default Cookbook", "recipe_id": 5, "cookbook_id": 7, "recipe_name": "Source", "reference_alert_id": 198, "reference_event_id": 210 }, "sig_id":5 }
Example response for a manually created Situation:
{ "origin": "Manual Creation", "cause": {"uid": 3}, "sig_id": 6 }
Example response when two Situations have been merged:
{ "origin": "Manual Merge", "cause": { "uid": 3, "merged_sigs": [8,7] }, "sig_id": 9 }
If there is no Situation visualization data, the response returns the following information:
{ "additional": { "debugMessage": "com.moogsoft.servletutils.CGeneralServerException: com.moogsoft.services.CGeneralServiceException: No visualize data found for Situation ID [2323]" }, "message": "Internal server error", "statusCode": 1000 }