property.stats
The property.stats command is used to acquire information about the property values stored, including the number of property values stored, the number of pre-calculated aggregates stored, as well as the date/time of the first and last record stored. It is possible to acquire this information for a single thing, all things within the organization, limited to a particular property (defined by the key), or for all properties.
TR50 Request
{
"cmd": {
"command": "property.stats",
"params": {
"thingKey": "mything",
"key": "myprop"
}
}
}
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
thingKey | String | Yes* | The thing key. |
thingid | String | Id of the thing | |
*One of the above parameters is required to identify the Thing. The thingId takes precedence over the thingKey. The thingKey associated to the session is not used | |||
key | String | Yes | The key for the property that you wish to retrieve. |
If the command is sent successfully a success message and the property value are returned. Otherwise, an error and error message will be returned.
TR50 Response
{
"cmd": {
"success": true,
"params": {
"propertyRecords": 32044,
"aggregateRecords": 4,
"firstPublish": "2018-03-10T03:22:46.871Z",
"lastPublish": "2019-06-13T21:37:00.969Z"
}
}
}
Response Parameters
Name | Type | Description |
---|---|---|
propertyRecords | Integer | The number of property records stored. |
aggregateRecords | Integer | The number of aggregate records stored. |
firstPublish | String | The timestamp of the earliest property record stored. |
lastPublish | String | The timestamp of the latest property record stored. |