Striim 3.9.4 / 3.9.5 documentation

Querying a WActionStore using the REST API

You may query a WActionStore using either a SELECT statement or keys from the REST API. The URI syntax for SELECT statements is:

http://<IPAddress>:<port>/wactions/search?'name=<namespace>.<WActionStore name>&query=<select statement>&<token>'

The SELECT statement uses the same syntax as a CQ or a dashboard query. See Getting a REST API authentication token. End the select statement with a semicolon.

The syntax for REST API keys is:

http://<IPAddress>:<port>/wactions/search?'name=<namespace>.<WActionStore name>
[&fields=<field name> ,...]
[&filter=
  [startTime:<query start time>,]
  [endTime:<query end time>,]
  [key:<key field value >,]
  [sortBy:<field name>,]
  [sortDir:asc,]
  [limit:<maximum number of results>,]
  [singleWactions:True]
]
&token=<token>'

Note

Key:value pairs in the URI are case-sensitive.

If &fields and &filter are omitted, the query will return the WAction key and context fields from all WActions in random order.

Include &fields to specify the names of the fields to return, separated by commas. Alternatively, use &fields=default-allEvents to return the WAction key, context fields, and all events, or &fields=eventList to return only the events.

Include &filter to filter and/or sort the results:

  • startTime: if specified (Unix time in milliseconds), only WActions with a timestamp of this value or later will be returned

  • endTime: if specified, only WActions with a timestamp of this value or earlier will be returned

  • key: if specified, only WActions with the specified key field value will be returned

  • <field name>:$IN$ <value>~...: if specified, only WActions with the specified value(s) will be returned, for example, State:$IN$ California~Missouri~Nevada

  • singleWactions:True: if specified, all WActions will be returned; omit to return only the most recent WAction for each key field value)

  • sortBy: if specified, results will be sorted by this field

  • sortDir:asc: use with sortBy to sort results in ascending order; omit to sort results in descending order

  • limit:<n>: if specified, only the first n results will be returned

The following operators may be used in URI values:

operator

URI string

example

>

$GT$

HourlyAve$GT$1000 returns WActions where the hourly average is greater than than 1000

<

$LT$

HourlyAve$GT$1000 returns WActions where the hourly average is less 1000

>=

$GTE$

HourlyAve$GT$1000 returns WActions where the hourly average is greater than or equal to 1000

<=

$LTE$

HourlyAve$GT$1000 returns WActions where the hourly average is less than or equal to 1000

!=

$NE$

HourlyAve$NE$0 returns WActions where the hourly average is not zero

WActions are returned in JSON format. For example, here is one WAction from PosApp:

 {
    "{\"id\":\"01e3baa6-06ea-6f0b-be8a-28cfe91e2b2b\",\"key\":\"JGudv50ThZhzaAz1s2EhbtIg8qHLXlnHfIg\"}": {
        "context-Category": "WARM", 
        "context-City": "Garfield", 
        "context-CompanyName": "RueLaLa.com", 
        "context-Count": 938, 
        "context-HourlyAve": 948, 
        "context-LatVal": 46.9946, 
        "context-LongVal": -117.1523, 
        "context-LowerLimit": 790.625, 
        "context-MerchantId": "JGudv50ThZhzaAz1s2EhbtIg8qHLXlnHfIg", 
        "context-StartTime": 1363146829000, 
        "context-State": "Washington", 
        "context-Status": "OK", 
        "context-UpperLimit": 1137.6, 
        "context-Zip": "99130", 
        "key": "JGudv50ThZhzaAz1s2EhbtIg8qHLXlnHfIg", 
        "timestamp": 1396470806180, 
        "totalEvents": 41
    }
}
  • The id portion of the second line is the universally unique identifier (UUID) for this WAction. The key portion is the value of the WActionStore's key field, in this case MerchantID.

  • Lines 3-16 are the WAction's context field names and values.

  • key is another copy of the value of the WActionStore's key field.

  • timestamp is the time when the WAction was created (not the timestamp for the event, which is the context-StartTime value).

  • totalEvents is the number of events associated with this WAction.

Some examples using cURL (which requires spaces to be escaped as %20):

Return all WActions in Samples.MerchantActivity:

curl -X GET http://localhost:9080/wactions/search?\
"name=Samples.MerchantActivity&\
query=select%20*%20from%20Samples.MerchantActivity&\
token=01e930a6-53c8-2201-8729-8cae4cf129d6"

Return WActions from Samples.MerchantActivity where the State field value is California, Missouri, or Nevada:

curl -X GET http://localhost:9080/wactions/search?\
"name=Samples.MerchantActivity&\
State:$IN$%20California~Missouri~Nevada&\
token=01e930a1-cc1e-cfb1-8729-8cae4cf129d6"

Returns only the State field value from all WActions in Samples.MerchantActivity:

curl -X GET http://localhost:9080/wactions/search?\
"name=Samples.MerchantActivity&fields=State&\
token=01e930a1-cc1e-cfb1-8729-8cae4cf129d6"