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

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.

Response

Endpoint getSituationVisualization returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

sig_id

Integer

Situation ID.

origin

String

Process that caused the Situation to be created, for example, cookbook or manual_merge.

cause

Object

Details of the origin of the Situation, for example the cookbook_name, recipe_id, cookbook_id, recipe_name, reference_alert_id and reference_event_id.

thresholds

Object

The saved and original threshold values for the Situation, if the Recipe has been updated.

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 saved and original values are returned.

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
}