Proto file alerts.proto
Service: AlertApi
AlertApi describes the common interactions a client would perform against a list of alerts.
Method | Request Type | Response Type | Description |
---|---|---|---|
ListAlerts | ListAlertsRequest | ListAlertsResponse | |
PullAlerts | PullAlertsRequest | PullAlertsResponse stream | |
AcknowledgeAlert | AcknowledgeAlertRequest | Alert | Acknowledge an existing alert. Acknowledgement allows tracking of which alerts have been seen by an actor that may be able to react to the alert. |
UnacknowledgeAlert | AcknowledgeAlertRequest | Alert | |
GetAlertMetadata | GetAlertMetadataRequest | AlertMetadata | Get alert metadata: how many alerts are there, what zones exist, etc. |
PullAlertMetadata | PullAlertMetadataRequest | PullAlertMetadataResponse stream |
Service: AlertAdminApi
AlertAdminApi allows for API access to the internal features of an alert management device. This API is typically only accessed by an administrator or internally by devices and automations that need to create automations in the system.
Method | Request Type | Response Type | Description |
---|---|---|---|
CreateAlert | CreateAlertRequest | Alert | |
UpdateAlert | UpdateAlertRequest | Alert | |
ResolveAlert | ResolveAlertRequest | Alert | |
DeleteAlert | DeleteAlertRequest | DeleteAlertResponse |
Alert
Alert describes an event in the system that can be acknowledged
Field Name | Type | Description |
---|---|---|
id | string | A unique id identifying this alert within the device. Assigned by the device when the alert is created. ID is used by update methods like AcknowledgeAlert to identify which alert to update. |
description | string | A human readable description of the alert condition. |
create_time | google.protobuf.Timestamp | The time the alert was created. Output only, set by the device when the alert is created. |
resolve_time | google.protobuf.Timestamp | The time the alert was resolved. Output only, set by the device when resolving an alert. Absent if the alert has not been resolved. If an alert is resolved more than once, this will be the earliest (first) time it was resolved. A resolved alert indicates that the alert condition is no longer present or has been fixed. |
acknowledgement | Alert.Acknowledgement | Present if the alert has been acknowledged. Acknowledgement is an indication that somebody is now aware that this alert exists. |
severity | Alert.Severity | |
floor | string | |
zone | string | |
source | string | |
federation | string | |
subsystem | string |
Alert.Acknowledgement
Field Name | Type | Description |
---|---|---|
acknowledge_time | google.protobuf.Timestamp | |
author | Alert.Acknowledgement.Author | Who acknowledged this alert |
Alert.Acknowledgement.Author
Field Name | Type | Description |
---|---|---|
id | string | |
display_name | string | |
string |
Alert.Query
Query allows filtering for list and pull requests. If multiple fields are present they are ANDed together.
Field Name | Type | Description |
---|---|---|
created_not_before | google.protobuf.Timestamp | Don't return alerts that were created before this time |
created_not_after | google.protobuf.Timestamp | Don't return alerts that were created after this time |
severity_not_below | Don't return alerts that have a severity below this value. Common values are specified by the Severity enum. | |
severity_not_above | Don't return alerts that have a severity above this value. Common values are specified by the Severity enum. | |
floor | string | Only return alerts that match this floor. |
zone | string | Only return alerts that match this zone. |
source | string | Only return alerts that match this source. |
federation | string | When collating alerts from multiple systems, federation records that remote system. |
subsystem | string | Only return alerts that match this subsystem. |
acknowledged | bool | When true, only include alerts that have an acknowledgement. When false, only include alerts that don't have an acknowledgement. When absent, acknowledgement does not affect whether an alert is returned or not. |
resolved | bool | When true, only include alerts that have a resolve time. When false, only include alerts that don't have a resolve time. When absent, resolve time does not affect whether an alert is returned or not. |
resolved_not_before | google.protobuf.Timestamp | Don't return alerts that were resolved before this time |
resolved_not_after | google.protobuf.Timestamp | Don't return alerts that were resolved after this time |
Alert.Severity
Name | Number | Description |
---|---|---|
SEVERITY_UNSPECIFIED | 0 | |
INFO | 9 | |
WARNING | 13 | |
SEVERE | 17 | |
LIFE_SAFETY | 21 |
AlertMetadata
Field Name | Type | Description |
---|---|---|
total_count | uint32 | |
floor_counts | map<string , uint32 > | |
zone_counts | map<string , uint32 > | |
acknowledged_counts | map<bool , uint32 > | map<string, uint32> source_counts = 4; // not sure this is needed and is likely to have poor performance |
severity_counts | map<, uint32 > | |
resolved_counts | map<bool , uint32 > | |
needs_attention_counts | map<string , uint32 > | Combines acknowledged and resolved in different combinations. The key will each combination of [ack, nack] x [resolved, unresolved], for example ack_resolved, nack_resolved. |
subsystem_counts | map<string , uint32 > |
ListAlertsRequest
Field Name | Type | Description |
---|---|---|
name | string | |
read_mask | google.protobuf.FieldMask | Fields to fetch relative to the Alert type |
page_size | int32 | The maximum number of modes 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 ListModesResponse call. Provide this to retrieve the subsequent page. |
query | Alert.Query | Query allows filtering of the alerts returned by this request. When paging the query should match for each page or INVALID_ARGUMENT will be returned. |
ListAlertsResponse
Field Name | Type | Description |
---|---|---|
alerts | repeated Alert | |
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 alerts after filtering is applied. This may be an estimate. |
PullAlertsRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device to fetch the state for |
read_mask | google.protobuf.FieldMask | Fields to fetch relative to the ElectricMode type |
query | Alert.Query | Query allows filtering of the alerts returned by this request. When paging the query should match for each page or INVALID_ARGUMENT will be returned. If an alert changes to become included or excluded from this query then it will act as though it were added/removed, that is to say the update type will ADDED or REMOVED not UPDATED. |
PullAlertsResponse
Field Name | Type | Description |
---|---|---|
changes | repeated PullAlertsResponse.Change | The list of changes which have occurred |
PullAlertsResponse.Change
Field Name | Type | Description |
---|---|---|
name | string | The name of the device that emitted this change |
type | smartcore.types.ChangeType | The type of change (e.g. ADD, UPDATE, etc...) |
new_value | Alert | The new value to use for ADD |
old_value | Alert | The old value to use for UPDATE |
change_time | google.protobuf.Timestamp | When the change occurred |
AcknowledgeAlertRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
id | string | The id of the alert. |
author | Alert.Acknowledgement.Author | The author of the acknowledgement. If the alert has already been acknowledged then this is ignored. |
allow_acknowledged | bool | When true, acknowledging an alert that is already acknowledged will not result in an error. Similarly un-acknowledging an alert that is not acknowledged will not result in an error. |
allow_missing | bool | When true, acknowledging an alert that does not exist will not result in an error |
GetAlertMetadataRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
read_mask | google.protobuf.FieldMask |
PullAlertMetadataRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
updates_only | bool | If true, only changes to the count are returned, otherwise the current total will be returned immediately. |
read_mask | google.protobuf.FieldMask |
PullAlertMetadataResponse
Field Name | Type | Description |
---|---|---|
changes | repeated PullAlertMetadataResponse.Change |
PullAlertMetadataResponse.Change
Field Name | Type | Description |
---|---|---|
name | string | The name of the device that emitted this change |
metadata | AlertMetadata | Information about the alerts in aggregate. |
change_time | google.protobuf.Timestamp | When the change occurred |
CreateAlertRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
alert | Alert | The alert information to use for the new record. Only description, floor, zone, severity, and source will contribute to the new alert. |
merge_source | bool | When true, merge this new alert with the most recent unresolved alert matching Alert.source. Alert.source must exist. If no such alert exists then a new alert will be created as if this were false. |
UpdateAlertRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
alert | Alert | The new properties of the alert. Alert.id must be present. Only description, floor, zone, severity, and source will contribute to the updated alert. |
update_mask | google.protobuf.FieldMask | Fields to update relative to the Alert type |
ResolveAlertRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
alert | Alert | The alert to resolve. One of Alert.id or Alert.source must be present. Prefers Alert.id to find the alert to resolve, if not will apply to the most recent alert matching Alert.source. |
allow_missing | bool | When true, resolving an alert that does not exist will not result in an error. |
DeleteAlertRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device exposing this trait. |
id | string | The id of the alert. |
allow_missing | bool | If set to true, and no alert with the given id exists, the request will succeed but no action will be taken. |
DeleteAlertResponse
No fields defined.