#Watcher
#Query event data
#Method
1watcher.getEvents
#Parameters
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
method |
string |
The method name. |
Yes |
params |
object |
The parameters of the request. |
Yes |
params.query |
object |
Query. |
Yes |
params.query.$limit |
number |
Data limit. |
No |
params.query.$offset |
number |
Data offset. |
No |
params.query.$order |
object |
Data offset. |
No |
params.query.event |
string |
Event name. |
No |
params.query.data |
object |
Query nested event data. |
No |
#Result
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
result |
object |
Result. |
Yes |
result.total |
number |
Total number of entries matching given query. |
Yes |
result.limit |
number |
Data limit. |
Yes |
result.offset |
number |
Data offset. |
Yes |
result.data |
array |
Query response data. |
Yes |
result.data.id |
number |
Query response data id. |
Yes |
result.data.event |
string |
Query response data event name. |
Yes |
result.data.data |
object |
Query response data event data. |
Yes |
result.data.timestamp |
string |
Query response data timestamp (YYYY-MM-DD hh:mm:ss). |
Yes |
#Request
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "watcher.getEvents",
5 "params": {
6 "query": {
7 "$limit": 100,
8 "$offset": 0,
9 "$order": { "id": "DESC" },
10 "event": { "$like": "database%" },
11 "data": { "query": { "$eq": "COMMIT" } }
12 }
13 }
14}
#Response
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {
5 "total": 1,
6 "limit": 100,
7 "offset": 0,
8 "data": [
9 {
10 "id": 4251,
11 "event": "database.query.log",
12 "data": {
13 "query": "COMMIT"
14 },
15 "timestamp": "2021-05-17 14:20:08"
16 }
17 ]
18 }
19}
#Supported query parameters
Name |
Type |
$eq |
equal |
$ne |
not equal |
$lt |
less than |
$lte |
less than or equal |
$gt |
greater than |
$gte |
greater than or equal |
$like |
like |
#Query example
1"data": {
2 name: { $like: "starts_with_string%" }
3}