Skip to main content

getSituationActions

A MoogDb v2 method that returns the actions for one or more Situations or for a time period. Created by passing an object with the information requested. You can use the from and to arguments to specify a period that you want to retrieve Situation actions for. If you do not specify these, all actions are returned.

Back to MoogDb V2 API Method Reference.

Request arguments

Method getSituationActions takes the following request arguments:

Name

Type

Required

Description

sitn_ids

JSON Array

No, if to and from are used.

Array of Situation IDs that the actions are requested for.

start

Number

Yes

Number of the first action to return.

limit

Number

Yes

Maximum number of actions that you want to return.

actions

JSON Array

No

List of action codes. Returns all action codes if no action codes are specified. See Situation Action Codes for a list of action codes and their descriptions.

from

Number

No

Start time of the period you want to retrieve Situation actions for. This is a Unix epoch timestamp in seconds.

to

Number

No

End time of the period you want to retrieve Situation actions for. This is a Unix epoch timestamp in seconds.

Response

Method getSituationActions returns the following response:

Type

Description

Native Object

A JSON object containing the activity for the specified Situations.

Examples

The following examples demonstrate typical use of method getSituationActions:

Request examples

Example request to return Situation actions:

var actions = moogdb.getSituationActions(request);

Example request object to return the first 100 actions for Situation IDs 1, 2, and 3 for action codes 1 (Situation Created) and 14 (Added Alerts To Situation):

{ 
    "sitn_ids" : [1, 2, 3],
    "start" : 0,
    "limit" : 100,
    "actions" : [1, 14] 
}

Response example

Example response returning the requested actions for the specified Situations:

[
    {
        "uid": 2,
        "action_code": 1,
        "description": "Situation Created",
        "details": {},
        "type": "event",
        "sig_id": 1,
        "timed_at": 1507039842
     }, 
    {
        "uid": 2,
        "action_code": 14,
        "description": "Added Alerts To Situation",
        "details": {},
        "alerts": [1, 2]
    }
]