Status Trait
API Service: StatusApi
Provides access to device status and problems. Any device or group may implement this trait to provide visibility into the function of the device.
Method | Request Type | Response Type | Description |
---|---|---|---|
GetCurrentStatus | GetCurrentStatusRequest | StatusLog | |
PullCurrentStatus | PullCurrentStatusRequest | PullCurrentStatusResponse stream |
History Service: StatusHistory
Provides historical entries for changes to the status of a device.
Method | Request Type | Response Type | Description |
---|---|---|---|
ListCurrentStatusHistory | ListCurrentStatusHistoryRequest | ListCurrentStatusHistoryResponse |
StatusLog
Field Name | Type | Description |
---|---|---|
level | StatusLog.Level | What is the working status of the device. This will be the most severe level - the highest ordinal - from any problems the device currently has. For example if a printer is running low on paper (a NOTICE) and the printer head is jammed (a FAULTY) then the status will be FAULTY. |
description | string | I human readable message describing the problem. For example "printer head jammed" or "temperature out of range". |
record_time | google.protobuf.Timestamp | The time the problem was first recorded. This is tied to the status level and should not change if only the description is updated. If a critical problem is resolved but a less critical problem still exists, the timestamp should reflect the earlier problems time. |
problems | repeated StatusLog.Problem | Additional problems the device or its constituent parts are experiencing. None of these should report NOMINAL. |
StatusLog.Problem
Field Name | Type | Description |
---|---|---|
level | StatusLog.Level | |
description | string | |
record_time | google.protobuf.Timestamp | |
name | string |
StatusLog.Level
Name | Number | Description |
---|---|---|
LEVEL_UNDEFINED | 0 | |
NOMINAL | 1 | The device is working as intended. The device will respond to commands and is working within normal parameters. |
NOTICE | 2 | The device is functioning but if left unattended may fail in the future. For example the battery level may be low, or it is close to running out of paper. |
REDUCED_FUNCTION | 3 | Some functions of the device are unavailable or in fault, but not all. The intended function of the device is still available but at a reduced efficiency or capacity. For example if only 3/4 lights in a corridor are working, you can still see but there is a fault. |
NON_FUNCTIONAL | 4 | The device is not performing its desired function. Some of the device features may still be working but enough is faulty, or critical pieces are faulty such that the reason for the device to exist is not being fulfilled. For example an access control unit may have a working card reader but if the magnetic lock is broken then either everyone (or nobody) can open the door negating the function of the device. |
OFFLINE | 127 | No communication with the device was possible |
GetCurrentStatusRequest
Field Name | Type | Description |
---|---|---|
name | string | The device to get the status of. |
read_mask | google.protobuf.FieldMask |
PullCurrentStatusRequest
Field Name | Type | Description |
---|---|---|
name | string | The device to get the status of. |
read_mask | google.protobuf.FieldMask | |
updates_only | bool |
PullCurrentStatusResponse
Field Name | Type | Description |
---|---|---|
changes | repeated PullCurrentStatusResponse.Change |
PullCurrentStatusResponse.Change
Field Name | Type | Description |
---|---|---|
name | string | name for the device that issued the change |
change_time | google.protobuf.Timestamp | when the change occurred |
current_status | StatusLog | The new value for the color |
StatusLogRecord
Field Name | Type | Description |
---|---|---|
current_status | StatusLog | |
record_time | google.protobuf.Timestamp |
ListCurrentStatusHistoryRequest
Field Name | Type | Description |
---|---|---|
name | string | |
period | smartcore.types.time.Period | |
read_mask | google.protobuf.FieldMask | Fields to fetch relative to the StatusLog type |
page_size | int32 | The maximum number of devices to return. The service may return fewer than this value. If unspecified, at most 50 items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
page_token | string | A page token, received from a previous ListCurrentStatusHistoryResponse call. Provide this to retrieve the subsequent page. |
order_by | string | Specify the order of the returned records. The default is create_time asc - aka oldest record first. The format is `field_name [asc |
ListCurrentStatusHistoryResponse
Field Name | Type | Description |
---|---|---|
current_status_records | repeated StatusLogRecord | |
next_page_token | string | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
total_size | int32 | If non-zero this is the total number of records matched by the query. This may be an estimate. |