activity_log.history
This command is used to return activity log records.
TR50 Request
Last number of records request
{
"1": {
"command": "activity_log.history",
"params": {
"component": ["application"],
"operation": ["publish"],
"whoAmI": ["monitor"],
"tag": ["tag1", "tag2"],
"identifier": ["5af35166cea2067245b1b7a5"],
"identifierType": ["thing"],
"records": 100
}
}
}
Last period of time request
{
"1": {
"command": "activity_log.history",
"params": {
"offset": 0,
"limit": 10,
"component": ["application"],
"operation": ["publish"],
"whoAmI": ["monitor"],
"tag": ["tag1", "tag2"],
"identifier": ["5af35166cea2067245b1b7a5"],
"identifierType": ["thing"],
"last": "48h"
}
}
}
Definite time period request
{
"1": {
"command": "activity_log.history",
"params": {
"offset": 0,
"limit": 10,
"component": ["application"],
"operation": ["publish"],
"whoAmI": ["monitor"],
"tag": ["tag1", "tag2"],
"identifier": ["5af35166cea2067245b1b7a5"],
"identifierType": ["thing"],
"start": "2018-01-01T00:00:00.000Z",
"end": "2018-01-05T23:59:59.999Z"
}
}
}
Request Parameters
Name |
Type |
Description |
---|---|---|
offset |
Integer |
The starting list offset, used for pagination, defaults to 0 if not specified. |
limit |
Integer |
Limits the number of results returned. Defaults to the maximum configured size. |
component |
Array |
An array of components to match. |
operation |
Array |
An array of operations to match. |
whoAmI |
Array |
An array of whoAmI to match. |
tags |
Array |
An array of tags to match. |
start |
String |
When doing a definite time period request this is the timestamp for the start of the specified time window. |
end |
String |
When doing a definite time period request this is the timestamp for the end of the specified time window. If start is specified, but end is not specified, end will use the current time as the default value. |
last |
String |
When doing a last period of time request this specifies the last X amount of time in seconds (s), minutes (m), hours (h), or days (d). |
records |
Integer |
When doing a last number of records request this specifies the number of records to return. A value of zero returns the global maximum number of records. |
You must specify start, last or records.
TR50 Response
If the command is sent successfully a success message and the log list is returned. Otherwise, an error and error message will be returned.
{
"1": {
"success": true,
"params": {
"count": 4,
"result": [
{
"id":"5af35166cea2067245b1b7a5",
"createdOn":"2018-05-01T00:00:00.000Z",
"operation":"publish",
"component":"activity_log",
"message":"Executing activity_log.publish"
},
...
]
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
count |
Integer |
The total number of results. |
result |
Array |
The array of activity log objects. |
Result Array Object
Name |
Type |
Description |
---|---|---|
id |
String |
The object id of the activity log entry. |
createdOn |
String |
The date the activity log entry was published. |
whoAmI |
String |
The application, thing, or user that made this activity log entry. |
operation |
String |
The operation this activity log references. |
component |
String |
The component this activity log references. |
message |
String |
The activity log message. |
identifier |
String |
The identification value. |
identifierType |
String |
The type of object that the identifier refers to. |
tags |
Array |
An array of tags to associate with this log entry. |