Understanding the alerting.edgelq.com service APIv1, in proto package ntt.alerting.v1.

Service alerting.edgelq.com in version v1, proto package ntt.alerting.v1

Here is the list of resources supported in Alerting service APIv1:

Alert Resource

Alert describes an abnormal situation indicated by TimeSeries or Logs. Alert is always associated with a single resource type, as indicated in Policy object. It contains relevant information: TimeSeries/Logs values that caused the issue, starting time, ending time, if alert stopped, current handling state (by both operator and AI agent). Each Alert belongs to a single TsCondition/LogCondition resource, and is always associated with some unique TsEntry - they share alerting resource reference. Relationship Alert <-> TsEntry is N <-> 1 Relationship Alert <-> TsCondition/LogCondition is N <-> 1

Name patterns:

  • projects/{project}/policies/{policy}/tsConditions/{ts_condition}/regions/{region}/alerts/{alert}
  • projects/{project}/policies/{policy}/logConditions/{log_condition}/regions/{region}/alerts/{alert}

Parent resources:

This section covers the methods and messages to interact with Alert resource.

Alert Methods

Here is the list of Alert resource methods:

GetAlert Method

GetAlert

rpc GetAlert(GetAlertRequest) returns (Alert)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*} 
GET /v1/{name=projects/*/policies/*/logConditions/*/regions/*/alerts/*} 

BatchGetAlerts Method

BatchGetAlerts

rpc BatchGetAlerts(BatchGetAlertsRequest) returns (BatchGetAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.batchGet

The equivalent REST API is:

GET /v1/alerts:batchGet 

ListAlerts Method

ListAlerts

rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/alerts 
GET /v1/{parent=projects/*/policies/*/logConditions/*/regions/*}/alerts 

WatchAlert Method

WatchAlert

rpc WatchAlert(WatchAlertRequest) returns (WatchAlertResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*}:watch 
POST /v1/{name=projects/*/policies/*/logConditions/*/regions/*/alerts/*}:watch 

WatchAlerts Method

WatchAlerts

rpc WatchAlerts(WatchAlertsRequest) returns (WatchAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/alerts:watch 
POST /v1/{parent=projects/*/policies/*/logConditions/*/regions/*}/alerts:watch 

CreateAlert Method

CreateAlert

rpc CreateAlert(CreateAlertRequest) returns (Alert)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/alerts (BODY: alert)
POST /v1/{parent=projects/*/policies/*/logConditions/*/regions/*}/alerts 

UpdateAlert Method

UpdateAlert

rpc UpdateAlert(UpdateAlertRequest) returns (Alert)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.update

The equivalent REST API is:

PUT /v1/{alert.name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*} (BODY: alert)
PUT /v1/{alert.name=projects/*/policies/*/logConditions/*/regions/*/alerts/*} 

DeleteAlert Method

DeleteAlert

rpc DeleteAlert(DeleteAlertRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*} 
DELETE /v1/{name=projects/*/policies/*/logConditions/*/regions/*/alerts/*} 

BulkSaveAlerts Method

BulkSaveAlerts

rpc BulkSaveAlerts(BulkSaveAlertsRequest) returns (BulkSaveAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.bulkSave

The equivalent REST API is:

POST /v1/alerts:bulkSaveAlerts 

BulkMarkAsNotified Method

BulkMarkAsNotified

rpc BulkMarkAsNotified(BulkMarkAsNotifiedRequest) returns (BulkMarkAsNotifiedResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.bulkMarkAsNotified

The equivalent REST API is:

POST /v1/alerts:bulkMarkAsNotified 

Alert Messages

Here is the list of Alert resource messages:

Alert Message

Name Type Description
name string (name of Alert) Name of Alert When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-zA-Z0-9_.:-]{1,128}
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display name informing about basic params (condition display name and alerting resource)
alerting_resource OwnerReference Alerting resource points to the original resource which generated alert. This meta reference works like dynamic type (any service, any resource). TODO: We could use of “DynamicReference” message type. It can be similar to OwnerReference, except it works more like reference (uses EstablishReferences…). It can support most normal behaviors, like CASCADE DELETE/UNSET.
ts_info Alert.TsInfo Informs about alert based on TimeSeries data.
log_info Alert.LogInfo Informs about alert based on Log data.
state Alert.State State of alert
internal Alert.Internal Internal field.

Alert.TsInfo Message

TsInfo contains Alert data created based on TimeSeries data.

Name Type Description
type Alert.TsInfo.Type Type of TimeSeries alert - based on ANOMALY or THRESHOLD.
anomaly_window_size .google.protobuf.Duration If alert type is ANOMALY, then this field is populated and informs for what window size anomaly was detected.
common_key bytes Binary key describing common metric/resource labels
metric_types repeated string List of metric types used in TsCondition
resource_types repeated string List of resource types used in TsCondition
common_metric_labels map<string, string> Metric labels by which we grouped TimeSeries data.
common_resource_labels map<string, string> Resource labels by which we grouped TimeSeries data.
time_series repeated Alert.TsInfo.TimeSeries All TimeSeries corresponding to each TsCondition.Spec.Query object, according to unique combination of group by fields: resource/metric labels.

Alert.LogInfo Message

LogInfo contains Alert data created based on Log data.

Name Type Description
common_key bytes Binary key describing common labels
log_types repeated string List of log descriptor types specified in parent LogCondition
common_log_labels map<string, string> Log labels by which we grouped Logs data.
violating_log string Content of violating log

Alert.State Message

State is responsible for managing lifecycle of Alert. Each Alert

Name Type Description
is_firing bool Informs if alert is still firing
start_time .google.protobuf.Timestamp Time when alert was raised
end_time .google.protobuf.Timestamp Time when alert was silenced, if no longer firing
notification_statuses repeated Alert.State.Notification Informs where notifications about alert state changes must be sent.
escalation_level Alert.State.EscalationLevel Informs who is handling alert as of now.
ai_agent_handling_state Alert.State.AiHandlingState Informs current state of alert handling by AI Agent if escalation level is AI_AGENT. If alert is on operator side, it will contain last decision made by AI agent.
ai_agent_last_state_change_time .google.protobuf.Timestamp Informs when was the last state change of ai_agent_handling_state field.
ai_agent_diagnosis_notes string Contains AI Agent troubleshooting notes. If agent SSHed to alerting resource, it will also contain history of shell for visibility purposes.
ai_remediation_arg string Optional remediation information from AI Agent. This field may be populated when field ai_agent_handling_state switches to AI_REMEDIATION_PROPOSED, if necessary. For example, if AI Agent wants to SSH and execute some commands, it will contain these commands.
ai_remediation PolicySpec.AIAgentHandling.Remediation Remediation type proposed by AI Agent to fix an alert. This field is populated when field ai_agent_handling_state switches to AI_REMEDIATION_PROPOSED. Informs what kind of remediation AI Agent wants to execute.
operator_handling_state Alert.State.OperatorHandlingState Informs current state of alert handling by Operator if escalation level is OPERATOR. If alert is on AI_AGENT side, it will contain last decision made by operator.
operator_last_state_change_time .google.protobuf.Timestamp Informs when was the last state change of operator_handling_state field.
operator_notes string Optional operator notes.
lifecycle_completed bool Alert has ended and any needed notifications are processed

Alert.Internal Message

Internal data.

Name Type Description
alerting_location PolicySpec.ProcessingLocation

Alert.TsInfo.TimeSeries Message

TimeSeries object matches single TsCondition.Spec.Query object in parent TsCondition. It contains TimeSeries data points at a time of violation, along with relevant information, like thresholds specified in TsEntry.

Name Type Description
query_name string Query name of the matching TsCondition.Spec.Query object
values repeated double TimeSeries data values during violation start. They will be outside of lower/upper thresholds range for THRESHOLD type alerts.
anomalies repeated double Corresponding detected anomaly values (square errors). Populated for ANOMALY type of alerts. They will be larger than anomaly threshold for ANOMALY type of alerts.
upper_threshold AlertingThreshold Upper threshold that was active during violation. Populated for THRESHOLD type of alerts.
lower_threshold AlertingThreshold Lower threshold that was active during violation. Populated for THRESHOLD type of alerts.
anomaly_threshold double Anomaly threshold that was active during violation. Populated for ANOMALY type of alerts.
after_duration .google.protobuf.Duration Informs how long violation was active at the time of raising alert.

Alert.State.Notification Message

Notification informs about pending notifications that must be sent due to changes in Alert state.

Name Type Description
kind NotificationChannelSpec.EventKind Kind informs what type of State has changed, and for which we need to send notifications.
pending_channels repeated string (reference to NotificationChannel) Informs about list of channels to where notification should be sent according to the corresponding kind.

GetAlertRequest Message

A request message of the GetAlert method.

Name Type Description
name string (name of Alert) Name of ntt.alerting.v1.Alert
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetAlertsRequest Message

A request message of the BatchGetAlerts method.

Name Type Description
names repeated string (name of Alert) Names of Alerts
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetAlertsResponse Message

A response message of the BatchGetAlerts method.

Name Type Description
alerts repeated Alert found Alerts
missing repeated string (name of Alert) list of not found Alerts

ListAlertsRequest Message

A request message of the ListAlerts method.

Name Type Description
parent string (parent name of Alert) Parent name of ntt.alerting.v1.Alert
page_size int32 Requested page size. Server may return fewer Alerts than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Alert) A token identifying a page of results the server should return. Typically, this is the value of ListAlertsResponse.next_page_token.
order_by string (orderBy of Alert) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Alert) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListAlertsResponse Message

A response message of the ListAlerts method.

Name Type Description
alerts repeated Alert The list of Alerts
prev_page_token string (cursor of Alert) A token to retrieve previous page of results. Pass this value in the ListAlertsRequest.page_token.
next_page_token string (cursor of Alert) A token to retrieve next page of results. Pass this value in the ListAlertsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total Alerts across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchAlertRequest Message

A request message of the WatchAlert method.

Name Type Description
name string (name of Alert) Name of ntt.alerting.v1.Alert
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchAlertResponse Message

A response message of the WatchAlert method.

Name Type Description
change AlertChange

WatchAlertsRequest Message

A request message of the WatchAlerts method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of Alert) Parent name of ntt.alerting.v1.Alert
page_size int32 Requested page size. Server may return fewer Alerts than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of Alert) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of Alert) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of Alert) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to Alert that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to Alert that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchAlertsResponse Message

A response message of the WatchAlerts method.

Name Type Description
alert_changes repeated AlertChange Changes of Alerts
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All Alerts will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchAlertsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (Alerts will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchAlertsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of Alert) New token to retrieve previous page of results.
next_page_token string (cursor of Alert) New token to retrieve next page of results.

CreateAlertRequest Message

A request message of the CreateAlert method.

Name Type Description
parent string (parent name of Alert) Parent name of ntt.alerting.v1.Alert
alert Alert Alert resource body
response_mask CreateAlertRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateAlertRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateAlertRequest Message

A request message of the UpdateAlert method.

Name Type Description
alert Alert Alert resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateAlertRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateAlertRequest.ResponseMask

UpdateAlertRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state Alert Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateAlertRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteAlertRequest Message

A request message of the DeleteAlert method.

Name Type Description
name string (name of Alert) Name of ntt.alerting.v1.Alert
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

BulkSaveAlertsRequest Message

A request message of the BulkSaveAlerts method.

Name Type Description
project string (name of Project)
alerts repeated Alert
update_mask .google.protobuf.FieldMask

BulkSaveAlertsResponse Message

A response message of the BulkSaveAlerts method.

Name Type Description
alerts repeated Alert

BulkMarkAsNotifiedRequest Message

Name Type Description
project string (name of Project)
alerts repeated string (name of Alert)
channels repeated string (name of NotificationChannel)

BulkMarkAsNotifiedResponse Message

Name Type Description
none none none

Alert Enumerations

Here is the list of Alert resource enumerations:

Alert.TsInfo.Type Enumeration

Type of TimeSeries based alert

Name Description
UNDEFINED
ANOMALY ANOMALY indicates that irregular data pattern was spotted in time series data (anomaly values crossed anomaly thresholds).
THRESHOLD THRESHOLD indicates that time series values crossed specified thresholds (lower or upper threshold).

Alert.State.AiHandlingState Enumeration

AiHandlingState informs what is a handling state of an alert from AI agent point of view. It is active when escalation_level points to AI_AGENT.

Name Description
AI_AGENT_NOT_INVOLVED AI Agent is not involved in handling this alert.
AI_AWAITING_HANDLING Alert is new and awaits handling by AI agent. This is always initial state for AI agent after firing. It can move to AI_ESCALATED_TO_OPERATOR, AI_IGNORE_AS_TEMPORARY, AI_ADJUST_CND_ENTRY, or AI_REMEDIATION_PROPOSED.
AI_ESCALATED_TO_OPERATOR This state is active is AI agent escalated alert to an operator, due to inability to solve it. This is terminal state after which handling is passed to OPERATOR, escalation_level changes.
AI_IGNORE_AS_TEMPORARY AI Agent informed that, while TimeSeries/Logs data indeed contain abnormal values, they are caused by transient and unharmful reason, and it should stop firing soon. This is false positive alert. This is semi-terminal state. It can move to AI_ESCALATED_TO_OPERATOR if alert persist despite being flagged as transient issue.
AI_ADJUST_CND_ENTRY AI Agent informed that this alert is a false positive, and TimeSeries/Logs violating entries in fact should not be classified as a violation. Switching alert to this state will cause corresponding TsEntry to adjust its thresholds, or retrain AI anomaly detection models. This is usually a terminal state, after which alert is silenced and TsEntry tries to assume violating data is normal. However, if thresholds cannot be updated, alert will switch to AI_ESCALATED_TO_OPERATOR.
AI_REMEDIATION_PROPOSED AI Agent identified this is a genuine alert, but for which it is able to fix. Remediation is only proposed, and requires approval from OPERATOR. Note that this is unique situation, where field escalation_level in State object points to AI_AGENT, but OPERATOR is requires to provide an update. Alert is technically still being handled by AI Agent, but waiting for OPERATOR confirmation.
AI_REMEDIATION_APPROVED This state is followed by AI_REMEDIATION_PROPOSED after OPERATOR agrees to execute, or if automatic approval is enabled. AI Agent will then proceed to applying remediation. It will move to AI_REMEDIATION_APPLIED after remediation is applied.
AI_REMEDIATION_APPLIED This state indicates that remediation has been applied. If after some time issue persists, then it switches to AI_ESCALATED_TO_OPERATOR.

Alert.State.OperatorHandlingState Enumeration

AiHandlingState informs what is a handling state of an alert from OPERATOR point of view.

Name Description
OP_NOT_INVOLVED Operator is not involved in handling this alert.
OP_AWAITING_HANDLING Alert waits for Operator to handle it. This is initial state when escalation level switches to OPERATOR. From here, it can switch to any of remaining states. It may be also switched back to AI Agent if operator will it.
OP_ACKNOWLEDGED This can be a first state of Alert after OP_AWAITING_HANDLING, if operator wants to acknowledge alert without informing about final decision.
OP_IGNORE_AS_TEMPORARY Operator informed that, while TimeSeries/Logs data indeed contain abnormal values, they are caused by transient and unharmful reason, and it should stop firing soon. This is false positive alert. This may be terminal state if alert stops firing soon. Otherwise, it will go back to OP_AWAITING_HANDLING.
OP_ADJUST_CND_ENTRY Operator informed that this alert is a false positive, and TimeSeries/Logs violating entries in fact should not be classified as a violation. Switching alert to this state will cause corresponding TsEntry to adjust its thresholds, or retrain AI anomaly detection models, whatever is relevant. This is usually a terminal state, after which alert is silenced and TsEntry tries to assume violating data is normal. However, if thresholds cannot be updated, alert will switch to OP_AWAITING_HANDLING automatically.
OP_REMEDIATION_APPLIED This state indicates that remediation has been applied. If after some time issue persists, then it switches to OP_AWAITING_HANDLING.

Alert.State.EscalationLevel Enumeration

EscalationLevel informs who is handling an alert.

Name Description
NONE None is invalid state.
AI_AGENT Alert is handled by AI Agent now
OPERATOR Alert is handled by OPERATOR now.

Document Resource

Document can be attached to Policy, TsCondition or LogCondition resources. They should contain documentation that can be relevant when diagnosing & resolving alerts. They are especially important for AI Agent handling.

Name patterns:

  • projects/{project}/documents/{document}

Parent resources:

This section covers the methods and messages to interact with Document resource.

Document Methods

Here is the list of Document resource methods:

GetDocument Method

GetDocument

rpc GetDocument(GetDocumentRequest) returns (Document)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.get

The equivalent REST API is:

GET /v1/{name=projects/*/documents/*} 

BatchGetDocuments Method

BatchGetDocuments

rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (BatchGetDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.batchGet

The equivalent REST API is:

GET /v1/documents:batchGet 

ListDocuments Method

ListDocuments

rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/documents 

WatchDocument Method

WatchDocument

rpc WatchDocument(WatchDocumentRequest) returns (WatchDocumentResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.watch

The equivalent REST API is:

POST /v1/{name=projects/*/documents/*}:watch 

WatchDocuments Method

WatchDocuments

rpc WatchDocuments(WatchDocumentsRequest) returns (WatchDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/documents:watch 

CreateDocument Method

CreateDocument

rpc CreateDocument(CreateDocumentRequest) returns (Document)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/documents (BODY: document)

UpdateDocument Method

UpdateDocument

rpc UpdateDocument(UpdateDocumentRequest) returns (Document)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.update

The equivalent REST API is:

PUT /v1/{document.name=projects/*/documents/*} (BODY: document)

DeleteDocument Method

DeleteDocument

rpc DeleteDocument(DeleteDocumentRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/documents/*} 

SearchDocuments Method

SearchDocuments

rpc SearchDocuments(SearchDocumentsRequest) returns (SearchDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.search

The equivalent REST API is:

GET /v1/{parent=projects/*}/documents:search 

Document Messages

Here is the list of Document resource messages:

Document Message

Name Type Description
name string (name of Document) Name of Document When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
title string Document title
content string Documentation content for operators
mime_type string documentation mime type. Only "text/markdown" is supported.

GetDocumentRequest Message

A request message of the GetDocument method.

Name Type Description
name string (name of Document) Name of ntt.alerting.v1.Document
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetDocumentsRequest Message

A request message of the BatchGetDocuments method.

Name Type Description
names repeated string (name of Document) Names of Documents
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetDocumentsResponse Message

A response message of the BatchGetDocuments method.

Name Type Description
documents repeated Document found Documents
missing repeated string (name of Document) list of not found Documents

ListDocumentsRequest Message

A request message of the ListDocuments method.

Name Type Description
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
page_size int32 Requested page size. Server may return fewer Documents than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Document) A token identifying a page of results the server should return. Typically, this is the value of ListDocumentsResponse.next_page_token.
order_by string (orderBy of Document) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Document) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListDocumentsResponse Message

A response message of the ListDocuments method.

Name Type Description
documents repeated Document The list of Documents
prev_page_token string (cursor of Document) A token to retrieve previous page of results. Pass this value in the ListDocumentsRequest.page_token.
next_page_token string (cursor of Document) A token to retrieve next page of results. Pass this value in the ListDocumentsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total Documents across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchDocumentRequest Message

A request message of the WatchDocument method.

Name Type Description
name string (name of Document) Name of ntt.alerting.v1.Document
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchDocumentResponse Message

A response message of the WatchDocument method.

Name Type Description
change DocumentChange

WatchDocumentsRequest Message

A request message of the WatchDocuments method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
page_size int32 Requested page size. Server may return fewer Documents than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of Document) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of Document) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of Document) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to Document that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to Document that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchDocumentsResponse Message

A response message of the WatchDocuments method.

Name Type Description
document_changes repeated DocumentChange Changes of Documents
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All Documents will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchDocumentsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (Documents will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchDocumentsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of Document) New token to retrieve previous page of results.
next_page_token string (cursor of Document) New token to retrieve next page of results.

CreateDocumentRequest Message

A request message of the CreateDocument method.

Name Type Description
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
document Document Document resource body
response_mask CreateDocumentRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateDocumentRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateDocumentRequest Message

A request message of the UpdateDocument method.

Name Type Description
document Document Document resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateDocumentRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateDocumentRequest.ResponseMask

UpdateDocumentRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state Document Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateDocumentRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteDocumentRequest Message

A request message of the DeleteDocument method.

Name Type Description
name string (name of Document) Name of ntt.alerting.v1.Document
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchDocumentsRequest Message

A request message of the SearchDocuments method.

Name Type Description
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
page_size int32 Requested page size. Server may return fewer Documents than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Document) A token identifying a page of results the server should return. Typically, this is the value of SearchDocumentsResponse.next_page_token.
order_by string (orderBy of Document) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Document) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchDocumentsResponse Message

A response message of the SearchDocuments method.

Name Type Description
documents repeated Document The list of Documents
prev_page_token string (cursor of Document) A token to retrieve previous page of results. Pass this value in the SearchDocumentsRequest.page_token.
next_page_token string (cursor of Document) A token to retrieve next page of results. Pass this value in the SearchDocumentsRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total Documents across all pages.

LogCondition Resource

LogCondition describes when Alert based on Logs data should be raised.

Name patterns:

  • projects/{project}/policies/{policy}/logConditions/{log_condition}

Parent resources:

This section covers the methods and messages to interact with LogCondition resource.

LogCondition Methods

Here is the list of LogCondition resource methods:

GetLogCondition Method

GetLogCondition

rpc GetLogCondition(GetLogConditionRequest) returns (LogCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/logConditions/*} 

BatchGetLogConditions Method

BatchGetLogConditions

rpc BatchGetLogConditions(BatchGetLogConditionsRequest) returns (BatchGetLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.batchGet

The equivalent REST API is:

GET /v1/logConditions:batchGet 

ListLogConditions Method

ListLogConditions

rpc ListLogConditions(ListLogConditionsRequest) returns (ListLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/logConditions 

WatchLogCondition Method

WatchLogCondition

rpc WatchLogCondition(WatchLogConditionRequest) returns (WatchLogConditionResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/logConditions/*}:watch 

WatchLogConditions Method

WatchLogConditions

rpc WatchLogConditions(WatchLogConditionsRequest) returns (WatchLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/logConditions:watch 

CreateLogCondition Method

CreateLogCondition

rpc CreateLogCondition(CreateLogConditionRequest) returns (LogCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/logConditions (BODY: log_condition)

UpdateLogCondition Method

UpdateLogCondition

rpc UpdateLogCondition(UpdateLogConditionRequest) returns (LogCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.update

The equivalent REST API is:

PUT /v1/{log_condition.name=projects/*/policies/*/logConditions/*} (BODY: log_condition)

DeleteLogCondition Method

DeleteLogCondition

rpc DeleteLogCondition(DeleteLogConditionRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/logConditions/*} 

SearchLogConditions Method

SearchLogConditions

rpc SearchLogConditions(SearchLogConditionsRequest) returns (SearchLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/logConditions:search 

LogCondition Messages

Here is the list of LogCondition resource messages:

LogCondition Message

Name Type Description
name string (name of LogCondition) Name of LogCondition When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of documents useful for troubleshooting and fixing alerts triggered by this condition.
spec LogCndSpec Defines what query is being monitored, and what content must trigger an Alert.
internal LogCondition.Internal Internal field.
template_source LogCondition.TemplateSource template source for current LogCondition

LogCondition.Internal Message

Internal data.

Name Type Description
alerting_location PolicySpec.ProcessingLocation Informs if log condition is processed at the backend or on edge.

LogCondition.TemplateSource Message

TemplateSource describes where condition is coming from originally.

Name Type Description
template string (reference to LogConditionTemplate) Reference to template
updated_fields .google.protobuf.FieldMask List of modified fields compared to the template. It is a mask of Spec object.

GetLogConditionRequest Message

A request message of the GetLogCondition method.

Name Type Description
name string (name of LogCondition) Name of ntt.alerting.v1.LogCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionsRequest Message

A request message of the BatchGetLogConditions method.

Name Type Description
names repeated string (name of LogCondition) Names of LogConditions
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionsResponse Message

A response message of the BatchGetLogConditions method.

Name Type Description
log_conditions repeated LogCondition found LogConditions
missing repeated string (name of LogCondition) list of not found LogConditions

ListLogConditionsRequest Message

A request message of the ListLogConditions method.

Name Type Description
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
page_size int32 Requested page size. Server may return fewer LogConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogCondition) A token identifying a page of results the server should return. Typically, this is the value of ListLogConditionsResponse.next_page_token.
order_by string (orderBy of LogCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListLogConditionsResponse Message

A response message of the ListLogConditions method.

Name Type Description
log_conditions repeated LogCondition The list of LogConditions
prev_page_token string (cursor of LogCondition) A token to retrieve previous page of results. Pass this value in the ListLogConditionsRequest.page_token.
next_page_token string (cursor of LogCondition) A token to retrieve next page of results. Pass this value in the ListLogConditionsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total LogConditions across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchLogConditionRequest Message

A request message of the WatchLogCondition method.

Name Type Description
name string (name of LogCondition) Name of ntt.alerting.v1.LogCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchLogConditionResponse Message

A response message of the WatchLogCondition method.

Name Type Description
change LogConditionChange

WatchLogConditionsRequest Message

A request message of the WatchLogConditions method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
page_size int32 Requested page size. Server may return fewer LogConditions than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of LogCondition) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of LogCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of LogCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to LogCondition that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to LogCondition that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchLogConditionsResponse Message

A response message of the WatchLogConditions method.

Name Type Description
log_condition_changes repeated LogConditionChange Changes of LogConditions
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All LogConditions will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchLogConditionsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (LogConditions will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchLogConditionsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of LogCondition) New token to retrieve previous page of results.
next_page_token string (cursor of LogCondition) New token to retrieve next page of results.

CreateLogConditionRequest Message

A request message of the CreateLogCondition method.

Name Type Description
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
log_condition LogCondition LogCondition resource body
response_mask CreateLogConditionRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateLogConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateLogConditionRequest Message

A request message of the UpdateLogCondition method.

Name Type Description
log_condition LogCondition LogCondition resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateLogConditionRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateLogConditionRequest.ResponseMask

UpdateLogConditionRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state LogCondition Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateLogConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteLogConditionRequest Message

A request message of the DeleteLogCondition method.

Name Type Description
name string (name of LogCondition) Name of ntt.alerting.v1.LogCondition
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchLogConditionsRequest Message

A request message of the SearchLogConditions method.

Name Type Description
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
page_size int32 Requested page size. Server may return fewer LogConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogCondition) A token identifying a page of results the server should return. Typically, this is the value of SearchLogConditionsResponse.next_page_token.
order_by string (orderBy of LogCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchLogConditionsResponse Message

A response message of the SearchLogConditions method.

Name Type Description
log_conditions repeated LogCondition The list of LogConditions
prev_page_token string (cursor of LogCondition) A token to retrieve previous page of results. Pass this value in the SearchLogConditionsRequest.page_token.
next_page_token string (cursor of LogCondition) A token to retrieve next page of results. Pass this value in the SearchLogConditionsRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total LogConditions across all pages.

LogConditionTemplate Resource

LogConditionTemplate provides pre-defined templates for LogCondition resources. They may be public ones (available for all projects to be copied), but also can be private and available in selected projects only. They are always provided within Policy template.

Name patterns:

  • projects/{project}/policyTemplates/{policy_template}/logConditionTemplates/{log_condition_template}

Parent resources:

This section covers the methods and messages to interact with LogConditionTemplate resource.

LogConditionTemplate Methods

Here is the list of LogConditionTemplate resource methods:

GetLogConditionTemplate Method

GetLogConditionTemplate

rpc GetLogConditionTemplate(GetLogConditionTemplateRequest) returns (LogConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.get

The equivalent REST API is:

GET /v1/{name=projects/*/policyTemplates/*/logConditionTemplates/*} 

BatchGetLogConditionTemplates Method

BatchGetLogConditionTemplates

rpc BatchGetLogConditionTemplates(BatchGetLogConditionTemplatesRequest) returns (BatchGetLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.batchGet

The equivalent REST API is:

GET /v1/logConditionTemplates:batchGet 

ListLogConditionTemplates Method

ListLogConditionTemplates

rpc ListLogConditionTemplates(ListLogConditionTemplatesRequest) returns (ListLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates 

WatchLogConditionTemplate Method

WatchLogConditionTemplate

rpc WatchLogConditionTemplate(WatchLogConditionTemplateRequest) returns (WatchLogConditionTemplateResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policyTemplates/*/logConditionTemplates/*}:watch 

WatchLogConditionTemplates Method

WatchLogConditionTemplates

rpc WatchLogConditionTemplates(WatchLogConditionTemplatesRequest) returns (WatchLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates:watch 

CreateLogConditionTemplate Method

CreateLogConditionTemplate

rpc CreateLogConditionTemplate(CreateLogConditionTemplateRequest) returns (LogConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates (BODY: log_condition_template)

UpdateLogConditionTemplate Method

UpdateLogConditionTemplate

rpc UpdateLogConditionTemplate(UpdateLogConditionTemplateRequest) returns (LogConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.update

The equivalent REST API is:

PUT /v1/{log_condition_template.name=projects/*/policyTemplates/*/logConditionTemplates/*} (BODY: log_condition_template)

DeleteLogConditionTemplate Method

DeleteLogConditionTemplate

rpc DeleteLogConditionTemplate(DeleteLogConditionTemplateRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policyTemplates/*/logConditionTemplates/*} 

SearchLogConditionTemplates Method

SearchLogConditionTemplates

rpc SearchLogConditionTemplates(SearchLogConditionTemplatesRequest) returns (SearchLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates:search 

LogConditionTemplate Messages

Here is the list of LogConditionTemplate resource messages:

LogConditionTemplate Message

Name Type Description
name string (name of LogConditionTemplate) Name of LogConditionTemplate When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of supporting documents. Pointed documents must be copied if LogCondition is created in different project.
spec_template LogCndSpec Pre defined template for LogCondition.Spec.

GetLogConditionTemplateRequest Message

A request message of the GetLogConditionTemplate method.

Name Type Description
name string (name of LogConditionTemplate) Name of ntt.alerting.v1.LogConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionTemplatesRequest Message

A request message of the BatchGetLogConditionTemplates method.

Name Type Description
names repeated string (name of LogConditionTemplate) Names of LogConditionTemplates
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionTemplatesResponse Message

A response message of the BatchGetLogConditionTemplates method.

Name Type Description
log_condition_templates repeated LogConditionTemplate found LogConditionTemplates
missing repeated string (name of LogConditionTemplate) list of not found LogConditionTemplates

ListLogConditionTemplatesRequest Message

A request message of the ListLogConditionTemplates method.

Name Type Description
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
page_size int32 Requested page size. Server may return fewer LogConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of ListLogConditionTemplatesResponse.next_page_token.
order_by string (orderBy of LogConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListLogConditionTemplatesResponse Message

A response message of the ListLogConditionTemplates method.

Name Type Description
log_condition_templates repeated LogConditionTemplate The list of LogConditionTemplates
prev_page_token string (cursor of LogConditionTemplate) A token to retrieve previous page of results. Pass this value in the ListLogConditionTemplatesRequest.page_token.
next_page_token string (cursor of LogConditionTemplate) A token to retrieve next page of results. Pass this value in the ListLogConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total LogConditionTemplates across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchLogConditionTemplateRequest Message

A request message of the WatchLogConditionTemplate method.

Name Type Description
name string (name of LogConditionTemplate) Name of ntt.alerting.v1.LogConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchLogConditionTemplateResponse Message

A response message of the WatchLogConditionTemplate method.

Name Type Description
change LogConditionTemplateChange

WatchLogConditionTemplatesRequest Message

A request message of the WatchLogConditionTemplates method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
page_size int32 Requested page size. Server may return fewer LogConditionTemplates than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of LogConditionTemplate) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of LogConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of LogConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to LogConditionTemplate that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to LogConditionTemplate that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchLogConditionTemplatesResponse Message

A response message of the WatchLogConditionTemplates method.

Name Type Description
log_condition_template_changes repeated LogConditionTemplateChange Changes of LogConditionTemplates
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All LogConditionTemplates will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchLogConditionTemplatesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (LogConditionTemplates will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchLogConditionTemplatesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of LogConditionTemplate) New token to retrieve previous page of results.
next_page_token string (cursor of LogConditionTemplate) New token to retrieve next page of results.

CreateLogConditionTemplateRequest Message

A request message of the CreateLogConditionTemplate method.

Name Type Description
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
log_condition_template LogConditionTemplate LogConditionTemplate resource body
response_mask CreateLogConditionTemplateRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateLogConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateLogConditionTemplateRequest Message

A request message of the UpdateLogConditionTemplate method.

Name Type Description
log_condition_template LogConditionTemplate LogConditionTemplate resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateLogConditionTemplateRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateLogConditionTemplateRequest.ResponseMask

UpdateLogConditionTemplateRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state LogConditionTemplate Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateLogConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteLogConditionTemplateRequest Message

A request message of the DeleteLogConditionTemplate method.

Name Type Description
name string (name of LogConditionTemplate) Name of ntt.alerting.v1.LogConditionTemplate
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchLogConditionTemplatesRequest Message

A request message of the SearchLogConditionTemplates method.

Name Type Description
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
page_size int32 Requested page size. Server may return fewer LogConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of SearchLogConditionTemplatesResponse.next_page_token.
order_by string (orderBy of LogConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchLogConditionTemplatesResponse Message

A response message of the SearchLogConditionTemplates method.

Name Type Description
log_condition_templates repeated LogConditionTemplate The list of LogConditionTemplates
prev_page_token string (cursor of LogConditionTemplate) A token to retrieve previous page of results. Pass this value in the SearchLogConditionTemplatesRequest.page_token.
next_page_token string (cursor of LogConditionTemplate) A token to retrieve next page of results. Pass this value in the SearchLogConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total LogConditionTemplates across all pages.

NotificationChannel Resource

NotificationChannel specifies channel where notifications about alert updates can be sent.

Name patterns:

  • projects/{project}/notificationChannels/{notification_channel}

Parent resources:

This section covers the methods and messages to interact with NotificationChannel resource.

NotificationChannel Methods

Here is the list of NotificationChannel resource methods:

GetNotificationChannel Method

GetNotificationChannel

rpc GetNotificationChannel(GetNotificationChannelRequest) returns (NotificationChannel)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.get

The equivalent REST API is:

GET /v1/{name=projects/*/notificationChannels/*} 

BatchGetNotificationChannels Method

BatchGetNotificationChannels

rpc BatchGetNotificationChannels(BatchGetNotificationChannelsRequest) returns (BatchGetNotificationChannelsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.batchGet

The equivalent REST API is:

GET /v1/notificationChannels:batchGet 

ListNotificationChannels Method

ListNotificationChannels

rpc ListNotificationChannels(ListNotificationChannelsRequest) returns (ListNotificationChannelsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/notificationChannels 

WatchNotificationChannel Method

WatchNotificationChannel

rpc WatchNotificationChannel(WatchNotificationChannelRequest) returns (WatchNotificationChannelResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.watch

The equivalent REST API is:

POST /v1/{name=projects/*/notificationChannels/*}:watch 

WatchNotificationChannels Method

WatchNotificationChannels

rpc WatchNotificationChannels(WatchNotificationChannelsRequest) returns (WatchNotificationChannelsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/notificationChannels:watch 

CreateNotificationChannel Method

CreateNotificationChannel

rpc CreateNotificationChannel(CreateNotificationChannelRequest) returns (NotificationChannel)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/notificationChannels (BODY: notification_channel)

UpdateNotificationChannel Method

UpdateNotificationChannel

rpc UpdateNotificationChannel(UpdateNotificationChannelRequest) returns (NotificationChannel)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.update

The equivalent REST API is:

PUT /v1/{notification_channel.name=projects/*/notificationChannels/*} (BODY: notification_channel)

DeleteNotificationChannel Method

DeleteNotificationChannel

rpc DeleteNotificationChannel(DeleteNotificationChannelRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/notificationChannels/*} 

TestNotificationChannel Method

TestNotificationChannel

rpc TestNotificationChannel(TestNotificationChannelRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.test

The equivalent REST API is:

POST /v1/{name=projects/*/notificationChannels/*}:test 

NotificationChannel Messages

Here is the list of NotificationChannel resource messages:

NotificationChannel Message

Name Type Description
name string (name of NotificationChannel) Name of NotificationChannel When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string description
spec NotificationChannelSpec Specification
state NotificationChannel.State State

NotificationChannel.State Message

State of NotificationChannel

Name Type Description
status NotificationChannel.State.Status Status
error NotificationChannel.State.Error Error

NotificationChannel.State.Error Message

Error of NotificationChannel

Name Type Description
time .google.protobuf.Timestamp
message string

GetNotificationChannelRequest Message

A request message of the GetNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetNotificationChannelsRequest Message

A request message of the BatchGetNotificationChannels method.

Name Type Description
names repeated string (name of NotificationChannel) Names of NotificationChannels
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetNotificationChannelsResponse Message

A response message of the BatchGetNotificationChannels method.

Name Type Description
notification_channels repeated NotificationChannel found NotificationChannels
missing repeated string (name of NotificationChannel) list of not found NotificationChannels

ListNotificationChannelsRequest Message

A request message of the ListNotificationChannels method.

Name Type Description
parent string (parent name of NotificationChannel) Parent name of ntt.alerting.v1.NotificationChannel
page_size int32 Requested page size. Server may return fewer NotificationChannels than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of NotificationChannel) A token identifying a page of results the server should return. Typically, this is the value of ListNotificationChannelsResponse.next_page_token.
order_by string (orderBy of NotificationChannel) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of NotificationChannel) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListNotificationChannelsResponse Message

A response message of the ListNotificationChannels method.

Name Type Description
notification_channels repeated NotificationChannel The list of NotificationChannels
prev_page_token string (cursor of NotificationChannel) A token to retrieve previous page of results. Pass this value in the ListNotificationChannelsRequest.page_token.
next_page_token string (cursor of NotificationChannel) A token to retrieve next page of results. Pass this value in the ListNotificationChannelsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total NotificationChannels across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchNotificationChannelRequest Message

A request message of the WatchNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchNotificationChannelResponse Message

A response message of the WatchNotificationChannel method.

Name Type Description
change NotificationChannelChange

WatchNotificationChannelsRequest Message

A request message of the WatchNotificationChannels method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of NotificationChannel) Parent name of ntt.alerting.v1.NotificationChannel
page_size int32 Requested page size. Server may return fewer NotificationChannels than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of NotificationChannel) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of NotificationChannel) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of NotificationChannel) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to NotificationChannel that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to NotificationChannel that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchNotificationChannelsResponse Message

A response message of the WatchNotificationChannels method.

Name Type Description
notification_channel_changes repeated NotificationChannelChange Changes of NotificationChannels
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All NotificationChannels will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchNotificationChannelsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (NotificationChannels will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchNotificationChannelsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of NotificationChannel) New token to retrieve previous page of results.
next_page_token string (cursor of NotificationChannel) New token to retrieve next page of results.

CreateNotificationChannelRequest Message

A request message of the CreateNotificationChannel method.

Name Type Description
parent string (parent name of NotificationChannel) Parent name of ntt.alerting.v1.NotificationChannel
notification_channel NotificationChannel NotificationChannel resource body
response_mask CreateNotificationChannelRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateNotificationChannelRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateNotificationChannelRequest Message

A request message of the UpdateNotificationChannel method.

Name Type Description
notification_channel NotificationChannel NotificationChannel resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateNotificationChannelRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateNotificationChannelRequest.ResponseMask

UpdateNotificationChannelRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state NotificationChannel Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateNotificationChannelRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteNotificationChannelRequest Message

A request message of the DeleteNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

TestNotificationChannelRequest Message

A request message of the TestNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel

NotificationChannel Enumerations

Here is the list of NotificationChannel resource enumerations:

NotificationChannel.State.Status Enumeration

State of NotificationChannel

Name Description
STATE_UNSPECIFIED State is unknown
ACTIVE NotificationChannel is active
DISABLED NotificationChannel is disabled
ERROR Error of NotificationChannel

Policy Resource

Policy groups log or time series based conditions that focus on monitoring same alerting resources. For example, one Policy should be created for alerts triggered by devices, and another for alerts triggered by Pods. Policy also provides common specification parts for all conditions within: It binds them with notification channels, defines processing location (Backend or Edge), instructs if and how AI agent should be investigating issues.

Name patterns:

  • projects/{project}/policies/{policy}

Parent resources:

This section covers the methods and messages to interact with Policy resource.

Policy Methods

Here is the list of Policy resource methods:

GetPolicy Method

GetPolicy

rpc GetPolicy(GetPolicyRequest) returns (Policy)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*} 

BatchGetPolicies Method

BatchGetPolicies

rpc BatchGetPolicies(BatchGetPoliciesRequest) returns (BatchGetPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.batchGet

The equivalent REST API is:

GET /v1/policies:batchGet 

ListPolicies Method

ListPolicies

rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/policies 

WatchPolicy Method

WatchPolicy

rpc WatchPolicy(WatchPolicyRequest) returns (WatchPolicyResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*}:watch 

WatchPolicies Method

WatchPolicies

rpc WatchPolicies(WatchPoliciesRequest) returns (WatchPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/policies:watch 

CreatePolicy Method

CreatePolicy

rpc CreatePolicy(CreatePolicyRequest) returns (Policy)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/policies (BODY: policy)

UpdatePolicy Method

UpdatePolicy

rpc UpdatePolicy(UpdatePolicyRequest) returns (Policy)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.update

The equivalent REST API is:

PUT /v1/{policy.name=projects/*/policies/*} (BODY: policy)

DeletePolicy Method

DeletePolicy

rpc DeletePolicy(DeletePolicyRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*} 

SearchPolicies Method

SearchPolicies

rpc SearchPolicies(SearchPoliciesRequest) returns (SearchPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.search

The equivalent REST API is:

GET /v1/{parent=projects/*}/policies:search 

Policy Messages

Here is the list of Policy resource messages:

Policy Message

Name Type Description
name string (name of Policy) Name of Policy When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string display name
description string Long description
supporting_docs repeated string (reference to Document) List of documents useful for troubleshooting and fixing alerts triggered by conditions in this policy.
spec PolicySpec Policy specification
template_source Policy.TemplateSource template source for current Policy
notification_channels repeated string (reference to NotificationChannel) List of attached notification channels

Policy.TemplateSource Message

TemplateSource describes where policy is coming from originally.

Name Type Description
template string (reference to PolicyTemplate) Reference to template
updated_fields .google.protobuf.FieldMask List of modified fields compared to the template. It is a mask of Spec object.

GetPolicyRequest Message

A request message of the GetPolicy method.

Name Type Description
name string (name of Policy) Name of ntt.alerting.v1.Policy
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPoliciesRequest Message

A request message of the BatchGetPolicies method.

Name Type Description
names repeated string (name of Policy) Names of Policies
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPoliciesResponse Message

A response message of the BatchGetPolicies method.

Name Type Description
policies repeated Policy found Policies
missing repeated string (name of Policy) list of not found Policies

ListPoliciesRequest Message

A request message of the ListPolicies method.

Name Type Description
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
page_size int32 Requested page size. Server may return fewer Policies than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Policy) A token identifying a page of results the server should return. Typically, this is the value of ListPoliciesResponse.next_page_token.
order_by string (orderBy of Policy) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Policy) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListPoliciesResponse Message

A response message of the ListPolicies method.

Name Type Description
policies repeated Policy The list of Policies
prev_page_token string (cursor of Policy) A token to retrieve previous page of results. Pass this value in the ListPoliciesRequest.page_token.
next_page_token string (cursor of Policy) A token to retrieve next page of results. Pass this value in the ListPoliciesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total Policies across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchPolicyRequest Message

A request message of the WatchPolicy method.

Name Type Description
name string (name of Policy) Name of ntt.alerting.v1.Policy
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchPolicyResponse Message

A response message of the WatchPolicy method.

Name Type Description
change PolicyChange

WatchPoliciesRequest Message

A request message of the WatchPolicies method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
page_size int32 Requested page size. Server may return fewer Policies than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of Policy) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of Policy) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of Policy) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to Policy that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to Policy that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchPoliciesResponse Message

A response message of the WatchPolicies method.

Name Type Description
policy_changes repeated PolicyChange Changes of Policies
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All Policies will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchPoliciesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (Policies will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchPoliciesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of Policy) New token to retrieve previous page of results.
next_page_token string (cursor of Policy) New token to retrieve next page of results.

CreatePolicyRequest Message

A request message of the CreatePolicy method.

Name Type Description
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
policy Policy Policy resource body
response_mask CreatePolicyRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreatePolicyRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdatePolicyRequest Message

A request message of the UpdatePolicy method.

Name Type Description
policy Policy Policy resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdatePolicyRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdatePolicyRequest.ResponseMask

UpdatePolicyRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state Policy Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdatePolicyRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeletePolicyRequest Message

A request message of the DeletePolicy method.

Name Type Description
name string (name of Policy) Name of ntt.alerting.v1.Policy
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchPoliciesRequest Message

A request message of the SearchPolicies method.

Name Type Description
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
page_size int32 Requested page size. Server may return fewer Policies than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Policy) A token identifying a page of results the server should return. Typically, this is the value of SearchPoliciesResponse.next_page_token.
order_by string (orderBy of Policy) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Policy) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchPoliciesResponse Message

A response message of the SearchPolicies method.

Name Type Description
policies repeated Policy The list of Policies
prev_page_token string (cursor of Policy) A token to retrieve previous page of results. Pass this value in the SearchPoliciesRequest.page_token.
next_page_token string (cursor of Policy) A token to retrieve next page of results. Pass this value in the SearchPoliciesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total Policies across all pages.

PolicyTemplate Resource

PolicyTemplate provides pre-defined templates for Policy resources. They may be public ones (available for all projects to be copied), but also can be private and available in selected projects only.

Name patterns:

  • projects/{project}/policyTemplates/{policy_template}

Parent resources:

This section covers the methods and messages to interact with PolicyTemplate resource.

PolicyTemplate Methods

Here is the list of PolicyTemplate resource methods:

GetPolicyTemplate Method

GetPolicyTemplate

rpc GetPolicyTemplate(GetPolicyTemplateRequest) returns (PolicyTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.get

The equivalent REST API is:

GET /v1/{name=projects/*/policyTemplates/*} 

BatchGetPolicyTemplates Method

BatchGetPolicyTemplates

rpc BatchGetPolicyTemplates(BatchGetPolicyTemplatesRequest) returns (BatchGetPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.batchGet

The equivalent REST API is:

GET /v1/policyTemplates:batchGet 

ListPolicyTemplates Method

ListPolicyTemplates

rpc ListPolicyTemplates(ListPolicyTemplatesRequest) returns (ListPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/policyTemplates 

WatchPolicyTemplate Method

WatchPolicyTemplate

rpc WatchPolicyTemplate(WatchPolicyTemplateRequest) returns (WatchPolicyTemplateResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policyTemplates/*}:watch 

WatchPolicyTemplates Method

WatchPolicyTemplates

rpc WatchPolicyTemplates(WatchPolicyTemplatesRequest) returns (WatchPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/policyTemplates:watch 

CreatePolicyTemplate Method

CreatePolicyTemplate

rpc CreatePolicyTemplate(CreatePolicyTemplateRequest) returns (PolicyTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/policyTemplates (BODY: policy_template)

UpdatePolicyTemplate Method

UpdatePolicyTemplate

rpc UpdatePolicyTemplate(UpdatePolicyTemplateRequest) returns (PolicyTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.update

The equivalent REST API is:

PUT /v1/{policy_template.name=projects/*/policyTemplates/*} (BODY: policy_template)

DeletePolicyTemplate Method

DeletePolicyTemplate

rpc DeletePolicyTemplate(DeletePolicyTemplateRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policyTemplates/*} 

SearchPolicyTemplates Method

SearchPolicyTemplates

rpc SearchPolicyTemplates(SearchPolicyTemplatesRequest) returns (SearchPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.search

The equivalent REST API is:

GET /v1/{parent=projects/*}/policyTemplates:search 

PolicyTemplate Messages

Here is the list of PolicyTemplate resource messages:

PolicyTemplate Message

Name Type Description
name string (name of PolicyTemplate) Name of PolicyTemplate When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of supporting documents. Pointed documents must be copied if Policy is created in different project.
spec_template PolicySpec Spec template

GetPolicyTemplateRequest Message

A request message of the GetPolicyTemplate method.

Name Type Description
name string (name of PolicyTemplate) Name of ntt.alerting.v1.PolicyTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPolicyTemplatesRequest Message

A request message of the BatchGetPolicyTemplates method.

Name Type Description
names repeated string (name of PolicyTemplate) Names of PolicyTemplates
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPolicyTemplatesResponse Message

A response message of the BatchGetPolicyTemplates method.

Name Type Description
policy_templates repeated PolicyTemplate found PolicyTemplates
missing repeated string (name of PolicyTemplate) list of not found PolicyTemplates

ListPolicyTemplatesRequest Message

A request message of the ListPolicyTemplates method.

Name Type Description
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
page_size int32 Requested page size. Server may return fewer PolicyTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of PolicyTemplate) A token identifying a page of results the server should return. Typically, this is the value of ListPolicyTemplatesResponse.next_page_token.
order_by string (orderBy of PolicyTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of PolicyTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListPolicyTemplatesResponse Message

A response message of the ListPolicyTemplates method.

Name Type Description
policy_templates repeated PolicyTemplate The list of PolicyTemplates
prev_page_token string (cursor of PolicyTemplate) A token to retrieve previous page of results. Pass this value in the ListPolicyTemplatesRequest.page_token.
next_page_token string (cursor of PolicyTemplate) A token to retrieve next page of results. Pass this value in the ListPolicyTemplatesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total PolicyTemplates across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchPolicyTemplateRequest Message

A request message of the WatchPolicyTemplate method.

Name Type Description
name string (name of PolicyTemplate) Name of ntt.alerting.v1.PolicyTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchPolicyTemplateResponse Message

A response message of the WatchPolicyTemplate method.

Name Type Description
change PolicyTemplateChange

WatchPolicyTemplatesRequest Message

A request message of the WatchPolicyTemplates method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
page_size int32 Requested page size. Server may return fewer PolicyTemplates than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of PolicyTemplate) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of PolicyTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of PolicyTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to PolicyTemplate that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to PolicyTemplate that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchPolicyTemplatesResponse Message

A response message of the WatchPolicyTemplates method.

Name Type Description
policy_template_changes repeated PolicyTemplateChange Changes of PolicyTemplates
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All PolicyTemplates will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchPolicyTemplatesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (PolicyTemplates will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchPolicyTemplatesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of PolicyTemplate) New token to retrieve previous page of results.
next_page_token string (cursor of PolicyTemplate) New token to retrieve next page of results.

CreatePolicyTemplateRequest Message

A request message of the CreatePolicyTemplate method.

Name Type Description
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
policy_template PolicyTemplate PolicyTemplate resource body
response_mask CreatePolicyTemplateRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreatePolicyTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdatePolicyTemplateRequest Message

A request message of the UpdatePolicyTemplate method.

Name Type Description
policy_template PolicyTemplate PolicyTemplate resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdatePolicyTemplateRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdatePolicyTemplateRequest.ResponseMask

UpdatePolicyTemplateRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state PolicyTemplate Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdatePolicyTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeletePolicyTemplateRequest Message

A request message of the DeletePolicyTemplate method.

Name Type Description
name string (name of PolicyTemplate) Name of ntt.alerting.v1.PolicyTemplate
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchPolicyTemplatesRequest Message

A request message of the SearchPolicyTemplates method.

Name Type Description
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
page_size int32 Requested page size. Server may return fewer PolicyTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of PolicyTemplate) A token identifying a page of results the server should return. Typically, this is the value of SearchPolicyTemplatesResponse.next_page_token.
order_by string (orderBy of PolicyTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of PolicyTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchPolicyTemplatesResponse Message

A response message of the SearchPolicyTemplates method.

Name Type Description
policy_templates repeated PolicyTemplate The list of PolicyTemplates
prev_page_token string (cursor of PolicyTemplate) A token to retrieve previous page of results. Pass this value in the SearchPolicyTemplatesRequest.page_token.
next_page_token string (cursor of PolicyTemplate) A token to retrieve next page of results. Pass this value in the SearchPolicyTemplatesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total PolicyTemplates across all pages.

TsCondition Resource

TsCondition describes when Alert based on TimeSeries data should be raised.

Name patterns:

  • projects/{project}/policies/{policy}/tsConditions/{ts_condition}

Parent resources:

This section covers the methods and messages to interact with TsCondition resource.

TsCondition Methods

Here is the list of TsCondition resource methods:

GetTsCondition Method

GetTsCondition

rpc GetTsCondition(GetTsConditionRequest) returns (TsCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/tsConditions/*} 

BatchGetTsConditions Method

BatchGetTsConditions

rpc BatchGetTsConditions(BatchGetTsConditionsRequest) returns (BatchGetTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.batchGet

The equivalent REST API is:

GET /v1/tsConditions:batchGet 

ListTsConditions Method

ListTsConditions

rpc ListTsConditions(ListTsConditionsRequest) returns (ListTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/tsConditions 

WatchTsCondition Method

WatchTsCondition

rpc WatchTsCondition(WatchTsConditionRequest) returns (WatchTsConditionResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/tsConditions/*}:watch 

WatchTsConditions Method

WatchTsConditions

rpc WatchTsConditions(WatchTsConditionsRequest) returns (WatchTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/tsConditions:watch 

CreateTsCondition Method

CreateTsCondition

rpc CreateTsCondition(CreateTsConditionRequest) returns (TsCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/tsConditions (BODY: ts_condition)

UpdateTsCondition Method

UpdateTsCondition

rpc UpdateTsCondition(UpdateTsConditionRequest) returns (TsCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.update

The equivalent REST API is:

PUT /v1/{ts_condition.name=projects/*/policies/*/tsConditions/*} (BODY: ts_condition)

DeleteTsCondition Method

DeleteTsCondition

rpc DeleteTsCondition(DeleteTsConditionRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/tsConditions/*} 

SearchTsConditions Method

SearchTsConditions

rpc SearchTsConditions(SearchTsConditionsRequest) returns (SearchTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/tsConditions:search 

TsCondition Messages

Here is the list of TsCondition resource messages:

TsCondition Message

Name Type Description
name string (name of TsCondition) Name of TsCondition When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of documents useful for troubleshooting and fixing alerts triggered by this condition.
spec TsCndSpec Spec defines queries, thresholds and anomaly detector specs.
internal TsCondition.Internal Internal field.
filter_selector TsCondition.Selector filter selector simplifies querying TsCondition resources. For example, it allows to make query like: * List TsConditions WHERE filter_selector.metric.types CONTAINS “device/cpu”
template_source TsCondition.TemplateSource template source for current TsCondition

TsCondition.Internal Message

Internal data.

Name Type Description
common_key_kset bytes
entry_spec_generation int32
alerting_location PolicySpec.ProcessingLocation

TsCondition.Selector Message

Selector contains detected metric/resource types and common labels used in filters from all queries. Selector facilitates filtering TsCondition resources. It is generated when TsCondition is saved (on the fly).

Name Type Description
metric_types repeated string
resource_types repeated string
common_metric_labels map<string, TsCondition.Selector.Strings>
common_resource_labels map<string, TsCondition.Selector.Strings>

TsCondition.TemplateSource Message

TemplateSource describes where condition is coming from originally.

Name Type Description
template string (reference to TsConditionTemplate) Reference to template
updated_fields .google.protobuf.FieldMask List of modified fields compared to the template. It is a mask of Spec object.

TsCondition.Selector.Strings Message

Name Type Description
values repeated string

GetTsConditionRequest Message

A request message of the GetTsCondition method.

Name Type Description
name string (name of TsCondition) Name of ntt.alerting.v1.TsCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionsRequest Message

A request message of the BatchGetTsConditions method.

Name Type Description
names repeated string (name of TsCondition) Names of TsConditions
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionsResponse Message

A response message of the BatchGetTsConditions method.

Name Type Description
ts_conditions repeated TsCondition found TsConditions
missing repeated string (name of TsCondition) list of not found TsConditions

ListTsConditionsRequest Message

A request message of the ListTsConditions method.

Name Type Description
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
page_size int32 Requested page size. Server may return fewer TsConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsCondition) A token identifying a page of results the server should return. Typically, this is the value of ListTsConditionsResponse.next_page_token.
order_by string (orderBy of TsCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListTsConditionsResponse Message

A response message of the ListTsConditions method.

Name Type Description
ts_conditions repeated TsCondition The list of TsConditions
prev_page_token string (cursor of TsCondition) A token to retrieve previous page of results. Pass this value in the ListTsConditionsRequest.page_token.
next_page_token string (cursor of TsCondition) A token to retrieve next page of results. Pass this value in the ListTsConditionsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total TsConditions across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchTsConditionRequest Message

A request message of the WatchTsCondition method.

Name Type Description
name string (name of TsCondition) Name of ntt.alerting.v1.TsCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchTsConditionResponse Message

A response message of the WatchTsCondition method.

Name Type Description
change TsConditionChange

WatchTsConditionsRequest Message

A request message of the WatchTsConditions method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
page_size int32 Requested page size. Server may return fewer TsConditions than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of TsCondition) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of TsCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of TsCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to TsCondition that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to TsCondition that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchTsConditionsResponse Message

A response message of the WatchTsConditions method.

Name Type Description
ts_condition_changes repeated TsConditionChange Changes of TsConditions
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All TsConditions will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchTsConditionsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (TsConditions will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchTsConditionsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of TsCondition) New token to retrieve previous page of results.
next_page_token string (cursor of TsCondition) New token to retrieve next page of results.

CreateTsConditionRequest Message

A request message of the CreateTsCondition method.

Name Type Description
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
ts_condition TsCondition TsCondition resource body
response_mask CreateTsConditionRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateTsConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateTsConditionRequest Message

A request message of the UpdateTsCondition method.

Name Type Description
ts_condition TsCondition TsCondition resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateTsConditionRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateTsConditionRequest.ResponseMask

UpdateTsConditionRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state TsCondition Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateTsConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteTsConditionRequest Message

A request message of the DeleteTsCondition method.

Name Type Description
name string (name of TsCondition) Name of ntt.alerting.v1.TsCondition
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchTsConditionsRequest Message

A request message of the SearchTsConditions method.

Name Type Description
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
page_size int32 Requested page size. Server may return fewer TsConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsCondition) A token identifying a page of results the server should return. Typically, this is the value of SearchTsConditionsResponse.next_page_token.
order_by string (orderBy of TsCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchTsConditionsResponse Message

A response message of the SearchTsConditions method.

Name Type Description
ts_conditions repeated TsCondition The list of TsConditions
prev_page_token string (cursor of TsCondition) A token to retrieve previous page of results. Pass this value in the SearchTsConditionsRequest.page_token.
next_page_token string (cursor of TsCondition) A token to retrieve next page of results. Pass this value in the SearchTsConditionsRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total TsConditions across all pages.

TsConditionTemplate Resource

TsConditionTemplate provides pre-defined templates for TsCondition resources. They may be public ones (available for all projects to be copied), but also can be private and available in selected projects only. They are always provided within Policy template.

Name patterns:

  • projects/{project}/policyTemplates/{policy_template}/tsConditionTemplates/{ts_condition_template}

Parent resources:

This section covers the methods and messages to interact with TsConditionTemplate resource.

TsConditionTemplate Methods

Here is the list of TsConditionTemplate resource methods:

GetTsConditionTemplate Method

GetTsConditionTemplate

rpc GetTsConditionTemplate(GetTsConditionTemplateRequest) returns (TsConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.get

The equivalent REST API is:

GET /v1/{name=projects/*/policyTemplates/*/tsConditionTemplates/*} 

BatchGetTsConditionTemplates Method

BatchGetTsConditionTemplates

rpc BatchGetTsConditionTemplates(BatchGetTsConditionTemplatesRequest) returns (BatchGetTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.batchGet

The equivalent REST API is:

GET /v1/tsConditionTemplates:batchGet 

ListTsConditionTemplates Method

ListTsConditionTemplates

rpc ListTsConditionTemplates(ListTsConditionTemplatesRequest) returns (ListTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates 

WatchTsConditionTemplate Method

WatchTsConditionTemplate

rpc WatchTsConditionTemplate(WatchTsConditionTemplateRequest) returns (WatchTsConditionTemplateResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policyTemplates/*/tsConditionTemplates/*}:watch 

WatchTsConditionTemplates Method

WatchTsConditionTemplates

rpc WatchTsConditionTemplates(WatchTsConditionTemplatesRequest) returns (WatchTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates:watch 

CreateTsConditionTemplate Method

CreateTsConditionTemplate

rpc CreateTsConditionTemplate(CreateTsConditionTemplateRequest) returns (TsConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates (BODY: ts_condition_template)

UpdateTsConditionTemplate Method

UpdateTsConditionTemplate

rpc UpdateTsConditionTemplate(UpdateTsConditionTemplateRequest) returns (TsConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.update

The equivalent REST API is:

PUT /v1/{ts_condition_template.name=projects/*/policyTemplates/*/tsConditionTemplates/*} (BODY: ts_condition_template)

DeleteTsConditionTemplate Method

DeleteTsConditionTemplate

rpc DeleteTsConditionTemplate(DeleteTsConditionTemplateRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policyTemplates/*/tsConditionTemplates/*} 

SearchTsConditionTemplates Method

SearchTsConditionTemplates

rpc SearchTsConditionTemplates(SearchTsConditionTemplatesRequest) returns (SearchTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates:search 

TsConditionTemplate Messages

Here is the list of TsConditionTemplate resource messages:

TsConditionTemplate Message

Name Type Description
name string (name of TsConditionTemplate) Name of TsConditionTemplate When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of supporting documents. Pointed documents must be copied if TsCondition is created in different project.
spec_template TsCndSpec Pre defined template for TsCondition.Spec.

GetTsConditionTemplateRequest Message

A request message of the GetTsConditionTemplate method.

Name Type Description
name string (name of TsConditionTemplate) Name of ntt.alerting.v1.TsConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionTemplatesRequest Message

A request message of the BatchGetTsConditionTemplates method.

Name Type Description
names repeated string (name of TsConditionTemplate) Names of TsConditionTemplates
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionTemplatesResponse Message

A response message of the BatchGetTsConditionTemplates method.

Name Type Description
ts_condition_templates repeated TsConditionTemplate found TsConditionTemplates
missing repeated string (name of TsConditionTemplate) list of not found TsConditionTemplates

ListTsConditionTemplatesRequest Message

A request message of the ListTsConditionTemplates method.

Name Type Description
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
page_size int32 Requested page size. Server may return fewer TsConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of ListTsConditionTemplatesResponse.next_page_token.
order_by string (orderBy of TsConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListTsConditionTemplatesResponse Message

A response message of the ListTsConditionTemplates method.

Name Type Description
ts_condition_templates repeated TsConditionTemplate The list of TsConditionTemplates
prev_page_token string (cursor of TsConditionTemplate) A token to retrieve previous page of results. Pass this value in the ListTsConditionTemplatesRequest.page_token.
next_page_token string (cursor of TsConditionTemplate) A token to retrieve next page of results. Pass this value in the ListTsConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total TsConditionTemplates across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchTsConditionTemplateRequest Message

A request message of the WatchTsConditionTemplate method.

Name Type Description
name string (name of TsConditionTemplate) Name of ntt.alerting.v1.TsConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchTsConditionTemplateResponse Message

A response message of the WatchTsConditionTemplate method.

Name Type Description
change TsConditionTemplateChange

WatchTsConditionTemplatesRequest Message

A request message of the WatchTsConditionTemplates method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
page_size int32 Requested page size. Server may return fewer TsConditionTemplates than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of TsConditionTemplate) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of TsConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of TsConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to TsConditionTemplate that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to TsConditionTemplate that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchTsConditionTemplatesResponse Message

A response message of the WatchTsConditionTemplates method.

Name Type Description
ts_condition_template_changes repeated TsConditionTemplateChange Changes of TsConditionTemplates
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All TsConditionTemplates will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchTsConditionTemplatesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (TsConditionTemplates will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchTsConditionTemplatesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of TsConditionTemplate) New token to retrieve previous page of results.
next_page_token string (cursor of TsConditionTemplate) New token to retrieve next page of results.

CreateTsConditionTemplateRequest Message

A request message of the CreateTsConditionTemplate method.

Name Type Description
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
ts_condition_template TsConditionTemplate TsConditionTemplate resource body
response_mask CreateTsConditionTemplateRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateTsConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateTsConditionTemplateRequest Message

A request message of the UpdateTsConditionTemplate method.

Name Type Description
ts_condition_template TsConditionTemplate TsConditionTemplate resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateTsConditionTemplateRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateTsConditionTemplateRequest.ResponseMask

UpdateTsConditionTemplateRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state TsConditionTemplate Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateTsConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteTsConditionTemplateRequest Message

A request message of the DeleteTsConditionTemplate method.

Name Type Description
name string (name of TsConditionTemplate) Name of ntt.alerting.v1.TsConditionTemplate
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchTsConditionTemplatesRequest Message

A request message of the SearchTsConditionTemplates method.

Name Type Description
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
page_size int32 Requested page size. Server may return fewer TsConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of SearchTsConditionTemplatesResponse.next_page_token.
order_by string (orderBy of TsConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchTsConditionTemplatesResponse Message

A response message of the SearchTsConditionTemplates method.

Name Type Description
ts_condition_templates repeated TsConditionTemplate The list of TsConditionTemplates
prev_page_token string (cursor of TsConditionTemplate) A token to retrieve previous page of results. Pass this value in the SearchTsConditionTemplatesRequest.page_token.
next_page_token string (cursor of TsConditionTemplate) A token to retrieve next page of results. Pass this value in the SearchTsConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total TsConditionTemplates across all pages.

TsEntry Resource

TsEntry contains stateful data for each unique Group by fields combination within individual TsCondition resource. Each TsEntry has own set of alerts too. TsEntry contains dynamic thresholds or anomaly detection models.

Name patterns:

  • projects/{project}/policies/{policy}/tsConditions/{ts_condition}/regions/{region}/tsEntries/{ts_entry}

Parent resources:

This section covers the methods and messages to interact with TsEntry resource.

TsEntry Methods

Here is the list of TsEntry resource methods:

GetTsEntry Method

GetTsEntry

rpc GetTsEntry(GetTsEntryRequest) returns (TsEntry)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*} 

BatchGetTsEntries Method

BatchGetTsEntries

rpc BatchGetTsEntries(BatchGetTsEntriesRequest) returns (BatchGetTsEntriesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.batchGet

The equivalent REST API is:

GET /v1/tsEntries:batchGet 

ListTsEntries Method

ListTsEntries

rpc ListTsEntries(ListTsEntriesRequest) returns (ListTsEntriesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/tsEntries 

WatchTsEntry Method

WatchTsEntry

rpc WatchTsEntry(WatchTsEntryRequest) returns (WatchTsEntryResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*}:watch 

WatchTsEntries Method

WatchTsEntries

rpc WatchTsEntries(WatchTsEntriesRequest) returns (WatchTsEntriesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/tsEntries:watch 

CreateTsEntry Method

CreateTsEntry

rpc CreateTsEntry(CreateTsEntryRequest) returns (TsEntry)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/tsEntries (BODY: ts_entry)

UpdateTsEntry Method

UpdateTsEntry

rpc UpdateTsEntry(UpdateTsEntryRequest) returns (TsEntry)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.update

The equivalent REST API is:

PUT /v1/{ts_entry.name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*} (BODY: ts_entry)

DeleteTsEntry Method

DeleteTsEntry

rpc DeleteTsEntry(DeleteTsEntryRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*} 

TsEntry Messages

Here is the list of TsEntry resource messages:

TsEntry Message

Name Type Description
name string (name of TsEntry) Name of TsEntry When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [\w+/=]{1,256}
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
info TsEntry.Info Identification information
state TsEntry.State State with anomaly detection models and dynamic thresholds.
internal TsEntry.Internal Internal field.

TsEntry.Info Message

Info provides unique description of a resource.

Name Type Description
alerting_resource OwnerReference Alerting resource points to the original resource associated with this TsEntry. This meta reference works like dynamic type (any service, any resource). TODO: We could use of “DynamicReference” message type. It can be similar to OwnerReference, except it works more like reference (uses EstablishReferences…). It can support most normal behaviors, like CASCADE DELETE/UNSET.
group_by_key bytes Binary time series key containing labels information.
common_metric_labels map<string, string> Common metric labels
common_resource_labels map<string, string> Common resource labels.

TsEntry.State Message

State contains all stateful data that is necessary for alert detection: Individualised adaptive thresholds and anomaly detection models.

Name Type Description
models repeated TsEntry.State.AnomalyModelData Anomaly detection models for each analysis window.
thresholds repeated TsEntry.State.AdaptiveThresholdInfo Adaptive thresholds (per each query in TsCondition).

TsEntry.Internal Message

Internal data.

Name Type Description
alerting_location PolicySpec.ProcessingLocation
spec_generation int32

TsEntry.State.AnomalyModelData Message

AnomalyModelData contains data for specific analysis window.

Name Type Description
analysis_window .google.protobuf.Duration Analysis window size.
model_data bytes Model binary data.
training_mean_err repeated double Average training errors (one float per each query)
training_max_err repeated double Maximum training errors (one float per each query)
trained_in_epochs int32 Number of epochs used to train model
trained_in .google.protobuf.Duration Informs how long it took to train this model.
train_after .google.protobuf.Timestamp Indicates if another training should be executed, and when.
training_period TimeInterval Training period that was selected for this model.
sensitiveness repeated TsEntry.State.AnomalyModelSensitiveness Sensitiveness (also called anomaly thresholds) per each query in TsCondition. Alert is raised when anomaly is detected for any of time series data.

TsEntry.State.AnomalyModelSensitiveness Message

AnomalyModelSensitiveness defines when anomaly is considered large enough to warrant new alert creation.

Name Type Description
query_name string Name of the matching query in TsCondition
anomaly_threshold double Threshold after which anomaly is considered too big.

TsEntry.State.AdaptiveThresholdInfo Message

AdaptiveThresholdInfo contains dynamic adaptive thresholds.

Name Type Description
query_name string Matching query name in TsCondition
lower AlertingThreshold Lower threshold value. Values below are considered violations.
upper AlertingThreshold Upper threshold value. Values above are considered violations.
next_check .google.protobuf.Timestamp Contains timestamp when thresholds should be adapted and checked after.

GetTsEntryRequest Message

A request message of the GetTsEntry method.

Name Type Description
name string (name of TsEntry) Name of ntt.alerting.v1.TsEntry
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsEntriesRequest Message

A request message of the BatchGetTsEntries method.

Name Type Description
names repeated string (name of TsEntry) Names of TsEntries
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsEntriesResponse Message

A response message of the BatchGetTsEntries method.

Name Type Description
ts_entries repeated TsEntry found TsEntries
missing repeated string (name of TsEntry) list of not found TsEntries

ListTsEntriesRequest Message

A request message of the ListTsEntries method.

Name Type Description
parent string (parent name of TsEntry) Parent name of ntt.alerting.v1.TsEntry
page_size int32 Requested page size. Server may return fewer TsEntries than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsEntry) A token identifying a page of results the server should return. Typically, this is the value of ListTsEntriesResponse.next_page_token.
order_by string (orderBy of TsEntry) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsEntry) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListTsEntriesResponse Message

A response message of the ListTsEntries method.

Name Type Description
ts_entries repeated TsEntry The list of TsEntries
prev_page_token string (cursor of TsEntry) A token to retrieve previous page of results. Pass this value in the ListTsEntriesRequest.page_token.
next_page_token string (cursor of TsEntry) A token to retrieve next page of results. Pass this value in the ListTsEntriesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total TsEntries across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchTsEntryRequest Message

A request message of the WatchTsEntry method.

Name Type Description
name string (name of TsEntry) Name of ntt.alerting.v1.TsEntry
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchTsEntryResponse Message

A response message of the WatchTsEntry method.

Name Type Description
change TsEntryChange

WatchTsEntriesRequest Message

A request message of the WatchTsEntries method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of TsEntry) Parent name of ntt.alerting.v1.TsEntry
page_size int32 Requested page size. Server may return fewer TsEntries than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of TsEntry) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of TsEntry) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of TsEntry) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to TsEntry that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to TsEntry that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchTsEntriesResponse Message

A response message of the WatchTsEntries method.

Name Type Description
ts_entry_changes repeated TsEntryChange Changes of TsEntries
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All TsEntries will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchTsEntriesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (TsEntries will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchTsEntriesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of TsEntry) New token to retrieve previous page of results.
next_page_token string (cursor of TsEntry) New token to retrieve next page of results.

CreateTsEntryRequest Message

A request message of the CreateTsEntry method.

Name Type Description
parent string (parent name of TsEntry) Parent name of ntt.alerting.v1.TsEntry
ts_entry TsEntry TsEntry resource body
response_mask CreateTsEntryRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateTsEntryRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateTsEntryRequest Message

A request message of the UpdateTsEntry method.

Name Type Description
ts_entry TsEntry TsEntry resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateTsEntryRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateTsEntryRequest.ResponseMask

UpdateTsEntryRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state TsEntry Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateTsEntryRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteTsEntryRequest Message

A request message of the DeleteTsEntry method.

Name Type Description
name string (name of TsEntry) Name of ntt.alerting.v1.TsEntry
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

Alerting Service Shared Methods and Messages

Alerting Service Shared Methods

Here is the list of Alerting service shared methods:

WatchAlertData Method

WatchAlertData

rpc WatchAlertData(WatchAlertDataRequest) returns (WatchAlertDataResponse)

Alerting Service Shared Messages

Here is the list of Alerting service shared messages:

AlertChange Message

AlertChange is used by Watch notifications Responses to describe change of single Alert One of Added, Modified, Removed

Name Type Description
added AlertChange.Added Added is returned when watched document is added, either created or enters Query view
modified AlertChange.Modified Modified is returned when watched document is modified
current AlertChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed AlertChange.Removed Removed is returned when Alert is deleted or leaves Query view

AlertChange.Added Message

Alert has been added to query view

Name Type Description
alert Alert
view_index int32 Integer describing index of added Alert in resulting query view.

AlertChange.Current Message

Alert has been added or modified in a query view. Version used for stateless watching

Name Type Description
alert Alert

AlertChange.Modified Message

Alert changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of Alert) Name of modified Alert
alert Alert New version of Alert or masked difference, depending on mask_changes instrumentation of issued [WatchAlertRequest] or [WatchAlertsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified Alert. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying Alert new index in resulting query view.

AlertChange.Removed Message

Removed is returned when Alert is deleted or leaves Query view

Name Type Description
name string (name of Alert)
view_index int32 Integer specifying removed Alert index. Not populated in stateless watch type.

AlertingThreshold Message

AlertingThreshold defines threshold value for alerting.

Name Type Description
value double Value that must not be crossed.
is_inclusive bool If true, then alert is raised when exact specified value is reached. Otherwise, it has to be crossed.

DocumentChange Message

DocumentChange is used by Watch notifications Responses to describe change of single Document One of Added, Modified, Removed

Name Type Description
added DocumentChange.Added Added is returned when watched document is added, either created or enters Query view
modified DocumentChange.Modified Modified is returned when watched document is modified
current DocumentChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed DocumentChange.Removed Removed is returned when Document is deleted or leaves Query view

DocumentChange.Added Message

Document has been added to query view

Name Type Description
document Document
view_index int32 Integer describing index of added Document in resulting query view.

DocumentChange.Current Message

Document has been added or modified in a query view. Version used for stateless watching

Name Type Description
document Document

DocumentChange.Modified Message

Document changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of Document) Name of modified Document
document Document New version of Document or masked difference, depending on mask_changes instrumentation of issued [WatchDocumentRequest] or [WatchDocumentsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified Document. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying Document new index in resulting query view.

DocumentChange.Removed Message

Removed is returned when Document is deleted or leaves Query view

Name Type Description
name string (name of Document)
view_index int32 Integer specifying removed Document index. Not populated in stateless watch type.

LogCndSpec Message

LogCndSpec informs what Logging queries should be monitored for alerting, and what content should be considered as violation.

Name Type Description
query LogCndSpec.Query Specifies logging query
group_by_labels repeated string Group by labels inform how to split monitored Logs stream. Each unique combination of label values is considered separately as own alerting bucket. All labels defined in Policy must be defined here.

LogCndSpec.Query Message

Query specifies what logging query should be monitored.

Name Type Description
filter string (filter of Log) Filter used to continuously observe log query output.
trigger LogCndSpec.Query.TriggerCnd Trigger under which Alert is raised
min_duration .google.protobuf.Duration Informs how long alert should be maintained in firing state since last occurrence.

LogCndSpec.Query.CompositeTrigger Message

CompositeTrigger collects multiple triggers together.

Name Type Description
triggers repeated LogCndSpec.Query.TriggerCnd List of triggers.
operator LogCndSpec.Query.CompositeTrigger.Operator Operator combining triggers

LogCndSpec.Query.LabelTrigger Message

LabelTrigger informs what label Log must have to be considered as a violation.

Name Type Description
key string Label key
values repeated string Triggering label values.

LogCndSpec.Query.StringPayloadTrigger Message

StringPayloadTrigger informs what text content of log is triggering an alert.

Name Type Description
object_selector string Optional selector inside log data field. It should be ignored if log entry is just a string or byte array. It can be used if log is some JSON object, and we search for specific fields.
regex string Regex that log content must satisfy to trigger an alert

LogCndSpec.Query.TriggerCnd Message

TriggerCnd wraps a trigger deciding when to trigger an alert. It inspects each Log individually.

Name Type Description
label LogCndSpec.Query.LabelTrigger Trigger based on label
string_content LogCndSpec.Query.StringPayloadTrigger Trigger based on log textual content
composite LogCndSpec.Query.CompositeTrigger Composite trigger combining multiple smaller ones

LogConditionChange Message

LogConditionChange is used by Watch notifications Responses to describe change of single LogCondition One of Added, Modified, Removed

Name Type Description
added LogConditionChange.Added Added is returned when watched document is added, either created or enters Query view
modified LogConditionChange.Modified Modified is returned when watched document is modified
current LogConditionChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed LogConditionChange.Removed Removed is returned when LogCondition is deleted or leaves Query view

LogConditionChange.Added Message

LogCondition has been added to query view

Name Type Description
log_condition LogCondition
view_index int32 Integer describing index of added LogCondition in resulting query view.

LogConditionChange.Current Message

LogCondition has been added or modified in a query view. Version used for stateless watching

Name Type Description
log_condition LogCondition

LogConditionChange.Modified Message

LogCondition changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of LogCondition) Name of modified LogCondition
log_condition LogCondition New version of LogCondition or masked difference, depending on mask_changes instrumentation of issued [WatchLogConditionRequest] or [WatchLogConditionsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified LogCondition. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying LogCondition new index in resulting query view.

LogConditionChange.Removed Message

Removed is returned when LogCondition is deleted or leaves Query view

Name Type Description
name string (name of LogCondition)
view_index int32 Integer specifying removed LogCondition index. Not populated in stateless watch type.

LogConditionTemplateChange Message

LogConditionTemplateChange is used by Watch notifications Responses to describe change of single LogConditionTemplate One of Added, Modified, Removed

Name Type Description
added LogConditionTemplateChange.Added Added is returned when watched document is added, either created or enters Query view
modified LogConditionTemplateChange.Modified Modified is returned when watched document is modified
current LogConditionTemplateChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed LogConditionTemplateChange.Removed Removed is returned when LogConditionTemplate is deleted or leaves Query view

LogConditionTemplateChange.Added Message

LogConditionTemplate has been added to query view

Name Type Description
log_condition_template LogConditionTemplate
view_index int32 Integer describing index of added LogConditionTemplate in resulting query view.

LogConditionTemplateChange.Current Message

LogConditionTemplate has been added or modified in a query view. Version used for stateless watching

Name Type Description
log_condition_template LogConditionTemplate

LogConditionTemplateChange.Modified Message

LogConditionTemplate changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of LogConditionTemplate) Name of modified LogConditionTemplate
log_condition_template LogConditionTemplate New version of LogConditionTemplate or masked difference, depending on mask_changes instrumentation of issued [WatchLogConditionTemplateRequest] or [WatchLogConditionTemplatesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified LogConditionTemplate. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying LogConditionTemplate new index in resulting query view.

LogConditionTemplateChange.Removed Message

Removed is returned when LogConditionTemplate is deleted or leaves Query view

Name Type Description
name string (name of LogConditionTemplate)
view_index int32 Integer specifying removed LogConditionTemplate index. Not populated in stateless watch type.

NotificationChannelChange Message

NotificationChannelChange is used by Watch notifications Responses to describe change of single NotificationChannel One of Added, Modified, Removed

Name Type Description
added NotificationChannelChange.Added Added is returned when watched document is added, either created or enters Query view
modified NotificationChannelChange.Modified Modified is returned when watched document is modified
current NotificationChannelChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed NotificationChannelChange.Removed Removed is returned when NotificationChannel is deleted or leaves Query view

NotificationChannelChange.Added Message

NotificationChannel has been added to query view

Name Type Description
notification_channel NotificationChannel
view_index int32 Integer describing index of added NotificationChannel in resulting query view.

NotificationChannelChange.Current Message

NotificationChannel has been added or modified in a query view. Version used for stateless watching

Name Type Description
notification_channel NotificationChannel

NotificationChannelChange.Modified Message

NotificationChannel changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of NotificationChannel) Name of modified NotificationChannel
notification_channel NotificationChannel New version of NotificationChannel or masked difference, depending on mask_changes instrumentation of issued [WatchNotificationChannelRequest] or [WatchNotificationChannelsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified NotificationChannel. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying NotificationChannel new index in resulting query view.

NotificationChannelChange.Removed Message

Removed is returned when NotificationChannel is deleted or leaves Query view

Name Type Description
name string (name of NotificationChannel)
view_index int32 Integer specifying removed NotificationChannel index. Not populated in stateless watch type.

NotificationChannelSpec Message

NotificationChannelSpec informs what kind of channel it is, and how to send there messages.

Name Type Description
enabled bool Enabled flag. Whether the NotificationChannel is enabled or not. Disabled channels will not be used for alerting.
type NotificationChannelSpec.Type Type. Corresponding spec should a oneof field.
enabled_kinds repeated NotificationChannelSpec.EventKind List of alert state event kinds when we want to send a notification.
email NotificationChannelSpec.Email Email
slack NotificationChannelSpec.Slack Slack
webhook NotificationChannelSpec.Webhook Webhook endpoint
notification_language_code string Default language for invitation is english (eng) Configuring unsupported language will fallback to english Currently only sendgrid uses this.
notification_mask .google.protobuf.FieldMask Notification mask contains list of fields to include in the message. It must match NotificationMsg
max_alert_bodies_in_msg int32 If bigger than 0, then number of alert bodies in message will be cut to this value.
put_only_alerts_counter_when_overflowing bool This field matters if max_alert_bodies_in_msg is bigger than 0. If this field has value true, then notification message will only inform how many alerts additionally were raised on top of provided in the notification. If false, multiple notifications will be generated.

NotificationChannelSpec.Email Message

Email Spec

Name Type Description
addresses repeated string Email Addresses

NotificationChannelSpec.PagerDuty Message

PagerDuty Spec

Name Type Description
service_key string PagerDuty Service Key

NotificationChannelSpec.Slack Message

Slack Spec

Name Type Description
incoming_webhook string Slack Incoming Webhook URL

NotificationChannelSpec.Webhook Message

Webhook Spec

Name Type Description
url string Webhook URL
headers repeated NotificationChannelSpec.Webhook.Header Headers
max_message_size_mb double default is 0 means all the alerts in a notification are sent in single request. Breaking into multiple messages may be significantly slower than sending a single message. For example, to use 250KB chunks, set 0.25 MB

NotificationChannelSpec.Webhook.Header Message

Header

Name Type Description
key string
value string

NotificationMsg Message

NotificationMsg is a notification message sent to channels, according to NotificationChannel resource.

Name Type Description
project_fqn string (name of Project)
project_display_name string
organization_fqn string (name of Organization)
organization_display_name string
policy_fqn string (name of Policy)
policy_display_name string
new_firing_alerts NotificationMsg.AlertsGroup
alerts_escalated_by_ai_to_operator NotificationMsg.AlertsGroup
alerts_awaiting_for_approval_with_ai_remediation NotificationMsg.AlertsGroup
alerts_flagged_to_ignore_by_ai NotificationMsg.AlertsGroup
alerts_with_condition_marked_for_adjusting_by_ai NotificationMsg.AlertsGroup
alerts_with_ai_remediation_applied NotificationMsg.AlertsGroup
alerts_with_operator_remediation_applied NotificationMsg.AlertsGroup
stopped_alerts NotificationMsg.AlertsGroup

NotificationMsg.AlertsGroup Message

Name Type Description
by_condition repeated NotificationMsg.AlertsGroup.ConditionAlerts

NotificationMsg.AlertsGroup.ConditionAlerts Message

Name Type Description
time_series_condition NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType
log_condition NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType
alerts repeated NotificationMsg.AlertsGroup.ConditionAlerts.Alert
more_alerts_count int32

NotificationMsg.AlertsGroup.ConditionAlerts.Alert Message

Name Type Description
type NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Type
fqn string (name of Alert)
display_name string
is_firing bool
start_time .google.protobuf.Timestamp
stop_time .google.protobuf.Timestamp
identification NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Identification
violation_info NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo
escalation_level Alert.State.EscalationLevel
ai_handling NotificationMsg.AlertsGroup.ConditionAlerts.Alert.AiHandling
operator_handling NotificationMsg.AlertsGroup.ConditionAlerts.Alert.OperatorHandling

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.AiHandling Message

Name Type Description
current_state Alert.State.AiHandlingState
troubleshooting_notes string
ai_remediation PolicySpec.AIAgentHandling.Remediation
remediation_arg string

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Identification Message

Name Type Description
log_labels map<string, string>
metric_labels map<string, string>
resource_labels map<string, string>

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.OperatorHandling Message

Name Type Description
current_state Alert.State.OperatorHandlingState
notes string

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo Message

Name Type Description
log_value string
time_series repeated NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo.TimeSeries

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo.TimeSeries Message

Name Type Description
query string
values repeated double
upper_threshold AlertingThreshold
lower_threshold AlertingThreshold
raised_after .google.protobuf.Duration

NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType Message

Name Type Description
fqn string (name of LogCondition)
display_name string
queries repeated NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType.Query

NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType.Query Message

Name Type Description
description string
filter string

NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType Message

Name Type Description
fqn string (name of TsCondition)
display_name string
queries repeated NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType.Query

NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType.Query Message

Name Type Description
description string
filter string
aggregation Aggregation

PolicyChange Message

PolicyChange is used by Watch notifications Responses to describe change of single Policy One of Added, Modified, Removed

Name Type Description
added PolicyChange.Added Added is returned when watched document is added, either created or enters Query view
modified PolicyChange.Modified Modified is returned when watched document is modified
current PolicyChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed PolicyChange.Removed Removed is returned when Policy is deleted or leaves Query view

PolicyChange.Added Message

Policy has been added to query view

Name Type Description
policy Policy
view_index int32 Integer describing index of added Policy in resulting query view.

PolicyChange.Current Message

Policy has been added or modified in a query view. Version used for stateless watching

Name Type Description
policy Policy

PolicyChange.Modified Message

Policy changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of Policy) Name of modified Policy
policy Policy New version of Policy or masked difference, depending on mask_changes instrumentation of issued [WatchPolicyRequest] or [WatchPoliciesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified Policy. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying Policy new index in resulting query view.

PolicyChange.Removed Message

Removed is returned when Policy is deleted or leaves Query view

Name Type Description
name string (name of Policy)
view_index int32 Integer specifying removed Policy index. Not populated in stateless watch type.

PolicySpec Message

PolicySpec defines common specification parts shared by all conditions within:

  • Enabled flag
  • Processing location
  • Standard troubleshooting queries to be executed for triggered alerts.
  • Shared resource type identity
  • Whether and how AI agent should be handling alerts
Name Type Description
enabled bool Enabled controls whether conditions within are active or not.
processing_location PolicySpec.ProcessingLocation Decides whether alerting is executed in backend or at the edge. This field cannot be modified.
resource_identity PolicySpec.ResourceIdentity Resource identity shared by all conditions/alerts within policy.
supporting_queries repeated PolicySpec.SupportingAlertQuery List of all supporting queries to be executed for alerts within Policy.
ai_agent PolicySpec.AIAgentHandling Defines AI agent handling for alerts within this policy

PolicySpec.AIAgentHandling Message

AIAgentHandling defines instructions for AI agent how to handle alerts generated within current Policy.

Name Type Description
enabled bool Whether AI agent handling is enabled.
enabled_connectivity bool Whether AI agent is allowed to SSH into alerting resource for further investigation outside of defined queries. To have an effect, it is necessary to specify edge_connectivity field.
auto_accept_remediation bool Whether remediation’s proposed by AI agent should be automatically accepted without operator consent (full autonomous mode).
edge_connectivity PolicySpec.AIAgentHandling.EdgeConnectivity Describes how to connect to alerting resource in a context of Alert.
remediation_options repeated PolicySpec.AIAgentHandling.Remediation Specifies list of suggested remediations for AI agent to apply

PolicySpec.AIAgentHandling.EdgeConnectivity Message

EdgeConnectivity describes means of accessing alerting resource for troubleshooting purposes.

Name Type Description
device_ssh PolicySpec.AIAgentHandling.EdgeConnectivity.DeviceSSH Device SSH connectivity
proxies_ssh PolicySpec.AIAgentHandling.EdgeConnectivity.ProxiesSSH Proxies SSH connectivity
pod_ssh PolicySpec.AIAgentHandling.EdgeConnectivity.PodSSH Pod SSH connectivity
allowed_bins repeated string Optional list of allowed binaries that AI agent can use. This can be used to restrict potential errors, or indicate what utils are available.

PolicySpec.AIAgentHandling.EdgeConnectivity.DeviceSSH Message

DeviceSSH informs that AI agent can SSH into alerting resource using standard droplet-exposed SSH tunnel. It is necessary to provide LabelInfo with device_id key in resource identity, but its possible to use DeviceSSH connectivity for non-Device alerts too. It is only necessary that alerting resource runs a droplet process.

Name Type Description
client_name string Client name for self-identification. Can be any unique name like “llm-alerting-agent”.

PolicySpec.AIAgentHandling.EdgeConnectivity.PodSSH Message

PodSSH can be used if application is running as a Pod supported by droplet. TODO: Not implemented

Name Type Description
client_name string Client name for self-identification. Can be any unique name like “llm-alerting-agent”.
username string Username to use.

PolicySpec.AIAgentHandling.EdgeConnectivity.ProxiesSSH Message

ProxiesSSH informs that AI agent can SSH into alerting resource using proxies service, standard SSH connectivity messages. It is assumed that some process on alerting resource is connected to proxies exposing SSH tunnel. Refer to Connect method in Proxies.

Name Type Description
service_domain string Service domain to use in Connect request.
provider_name_tmpl string Provider name template to use in Connect request. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field, plus special <project_id> and <region_id>.
client_name string Client name for self-identification. Can be any unique name like “llm-alerting-agent”.
service_name string Service name to use in Connect request.

PolicySpec.AIAgentHandling.Remediation Message

Remediation indicates option available to AI agent.

Name Type Description
fix_in_ssh PolicySpec.AIAgentHandling.Remediation.FixInSSH FixInSSH remediation type.
reboot PolicySpec.AIAgentHandling.Remediation.Reboot Reboot remediation type. It can be specified only if resource identity points to devices.edgelq.com/Device, and if pod_id is specified as one of the available labels.

PolicySpec.AIAgentHandling.Remediation.FixInSSH Message

FixInSSH declares that issue should be fixed using SSH shell. AI Agent should provide a command to execute in shell. This option can be used only if EdgeConnectivity is specified.

Name Type Description
none none none

PolicySpec.AIAgentHandling.Remediation.Reboot Message

Reboot is a special type of remediation applicable only and only for pods -> it is necessary to provide LabelInfo with pod_id key. Pod will be restarted to remediate an issue.

Name Type Description
none none none

PolicySpec.ResourceIdentity Message

ResourceIdentity informs which MAIN resource type is generating time series/logs on which conditions are built. For core EdgeLQ, ResourceIdentity must point always to devices.edgelq.com/Device resource, even if we are creating policy for applications.edgelq.com/Pod conditions. 3rd party services can pick something else. In EdgeLQ, it will be necessary to create separate Policy objects, if one is for Device conditions, and other for Pod conditions. Both will point to devices.edgelq.com/Device as main resource identity, both will have to specify device_id LabelInfo. Second one will have to specify pod_id LabelInfo.

Name Type Description
alerting_resource string (reference to Resource) Reference to primary alerting resource kind. For EdgeLQ, it is services/devices.edgelq.com/resources/Device resource. Pods belong to device, so everything is device scoped. 3rd party services can provide different resource type.
labels repeated PolicySpec.ResourceIdentity.LabelInfo All interesting labels that can be found in ALL Log/Ts Conditions group by fields within Policy. It is necessary to provide labels to at least satisfy name pattern of main alerting_resource. It is optional to provide more labels, in order to identify auxiliary resources. By default, there are 2 built-in LabelInfo objects: * key: “project_id”, points to project name segment. It is mapped to project of TimeSeries or Log object * key: “region_id”, points to region name segment. It is mapped to region of TimeSeries or Log object.
name_patterns repeated string List of name patterns of main alerting resource kind. Note that all name segments (divided by each even “/” character) must be satisfied within labels.mapped_name_segment fields, with exception of “project” and “region”, which are built-in. TODO: As of now, only one pattern. However, it should be possible to deduce name patterns from meta.goten.com service, so they are not provided here at all. Name pattern must conform to standard goten style name pattern. For example, name pattern of devices.edgelq.com/Device is “projects/{project}/regions/{region}/devices/{device}”.

PolicySpec.ResourceIdentity.LabelInfo Message

LabelInfo binds a label from Log/TimeSeries object into specific name segment of a resource associated with an Alert raised within current Policy. Multiple LabelInfo instances within ResourceIdentity are used to reconstruct full resource names. For example, resource type devices.edgelq.com/Device has a single known name pattern projects/{project}/regions/{region}/devices/{device}. There are 3 name segments: project, region, and device. Segments “project” and “region” are built-in always and dont have to be defined. Policy owner will have to provide single LabelInfo in this case, for device segment only. LabelInfo may be used to point to other auxiliary resources. For example, if Policy focuses on conditions for applications.edgelq.com/Pod resource type, administrator can create Policy with 2 LabelInfo objects: One with device_id as primary key, because it will be Device generating all time series (also for pods), then other LabelInfo must contain object with key equal to pod_id.

Name Type Description
key string Label key that must be present in TsCondition/LogCondition group by fields list. Refer to labels defined in relevant monitoring.edgelq.com/MonitoredResourceDescriptor, monitoring.edgelq.com/MetricDescriptor, or logging.edgelq.com/LogDescriptor resources for which you want to create conditions. Note that “key” must match exactly one of a labels (byte to byte) specified in interesting descriptors. For example, in MonitoredResourceDescriptor of type devices.edgelq.com/Device you may find label with key “device_id”. This must be specified in LabelInfo.key if you want to create Policy focusing on Device resource.
contexts repeated PolicySpec.ResourceIdentity.LabelInfo.UsageContext List of all contexts where label with specified key can be found. It may be more than one position. For example device_id label can be found in LogDescriptor or MonitoredResourceDescriptor. In this case, we need to set 2 values in contexts field: RESOURCE_LABEL and LOG_LABEL.
mapped_name_segment string Name segment value in name pattern. This is always lowerSingularCamelCase resource type name. For example, for LabelInfo with key device_id, if it points to devices.edgelq.com/Device resource type, mapped_name_segment must be equal to “device” value (which is lower camel case).

PolicySpec.SupportingAlertQuery Message

SupportingAlertQuery specifies a common supporting troubleshooting query that can be used to investigate any Alert within current Policy. This is especially important for alerts handling by AI agent. Outputs from these queries can be used by AI agents.

Important: Many query spec string fields have _template suffix. It means that their values may contain variable values that are replaced for each specific Alert instance. Those variables have a format: <$LABEL_KEY>, where $LABEL_KEY must be one of the label keys specified in resource_identity field. For example, if we can have a Policy like this: { “resourceIdentity”: { “alertingResource”: “services/devices.edgelq.com/resources/Device”, “labels”: [ { “key”: “device_id”, “contexts”: [RESOURCE_LABEL, LOG_LABEL], “mappedNameSegment”: “device” } ], “namePatterns”: [“projects/{project}/regions/{region}/devices/{device}”] }, “supportingQueries”: [ { “tsQuery”: { “description”: “…” “filterTemplate”: “metric.type="devices.edgelq.com/Device/connected" AND resource.labels.device_id="<device_id>"” “aggregation”: {…} } } ] } In above example, we define one LabelInfo with device_id field. Therefore, alerting service will find and replace each substring <device_id> with specific value from Alert resource. If we have Alert with label device_id = “test-x”, Alerting service will execute TimeSeries query with filter metric.type="devices.edgelq.com/Device/connected" AND resource.labels.device_id="test-x"" Note that values <project_id> and <region_id> are always built-in, and will expand to project/region indicated by Alert.

Name Type Description
ts_query PolicySpec.SupportingAlertQuery.TsQuery Time Series query
log_query PolicySpec.SupportingAlertQuery.LogQuery Log query
rest_get_query PolicySpec.SupportingAlertQuery.RestGetQuery Rest Get query
rest_list_query PolicySpec.SupportingAlertQuery.RestListQuery Rest List query

PolicySpec.SupportingAlertQuery.LogQuery Message

LogQuery describes Log query to execute for each specific alert. Time interval will be set around alert time.

Name Type Description
description string Query description.
filter_template string Log filter template. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.

PolicySpec.SupportingAlertQuery.RestGetQuery Message

RestGetQuery allows to fetch specific resource body to be included in investigation data. It is optimized for fetching resources from EdgeLQ style services. It is not possible as of now to use GRPC API, because alerting resource can be used by 3rd party service on top of EdgeLQ platform.

Name Type Description
description string Description of resource we are fetching
endpoint string Endpoint (with scheme) from which we want to fetch resource. For example, it can be https://devices.apis.edgelq.com value, if we want to access a resource from devices.edgelq.com service. Endpoint may differ depending on environment (production or staging). TODO: Replace with reference to meta.goten.com/Service
path_template string Path template to be appended to access specific resource. EdgeLQ based services use standard paths for Get requests. It is: /$API_VERSION/$RESOURCE_NAME. For example, path_template for devices.edgelq.com/Device resource in version v1, path_template must have a format: “/v1/projects/<project_id>/regions/<region_id>/devices/<device_id>”. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.
view string It must be NAME, BASIC, DETAIL or FULL - like in each standard Get request in EdgeLQ based platform.
field_mask string List of additional fields to obtain on top of those defined within view. Fields must be comma separated, and use lower_snake_case notion.

PolicySpec.SupportingAlertQuery.RestListQuery Message

RestListQuery allows to fetch specific list of resource bodies to be included in investigation data. It is optimized for fetching resources from EdgeLQ style services. It is not possible as of now to use GRPC API, because alerting resource can be used by 3rd party service on top of EdgeLQ platform.

Name Type Description
description string Description of resources we are fetching
endpoint string Endpoint (with scheme) from which we want to fetch resource. For example, it can be https://applications.apis.edgelq.com value, if we want to access a resource from applications.edgelq.com service. Endpoint may differ depending on environment (production or staging). TODO: Replace with reference to meta.goten.com/Service
path_template string Path template to be appended to access specific resource. EdgeLQ based services use standard paths for List requests. It is: /$API_VERSION/$RESOURCE_PARENT_NAME/$PLURAL_RESOURCE_TYPE_NAME. For example, to fetch list of pods (applications.edgelq.com service), we would use path_template like this: “/v1/projects/<project_id>/regions/<region_id>/pods”. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.
view string It must be NAME, BASIC, DETAIL or FULL - like in each standard List request in EdgeLQ based platform.
field_mask string List of additional fields to obtain on top of those defined within view. Fields must be comma separated, and use lower_snake_case notion.
filter_template string Optional filter template to be used to filter collection. For example, if we want to obtain list of pods running on a device, we should populate it with value: “spec.node="projects/<project_id>/regions/<region_id>/devices/<device_id>"”.

PolicySpec.SupportingAlertQuery.TsQuery Message

TsQuery describes TimeSeries query to execute for each specific alert. Time interval will be set around alert time.

Name Type Description
description string Query description.
filter_template string TimeSeries filter template. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.
aggregation Aggregation TimeSeries aggregation object.

PolicyTemplateChange Message

PolicyTemplateChange is used by Watch notifications Responses to describe change of single PolicyTemplate One of Added, Modified, Removed

Name Type Description
added PolicyTemplateChange.Added Added is returned when watched document is added, either created or enters Query view
modified PolicyTemplateChange.Modified Modified is returned when watched document is modified
current PolicyTemplateChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed PolicyTemplateChange.Removed Removed is returned when PolicyTemplate is deleted or leaves Query view

PolicyTemplateChange.Added Message

PolicyTemplate has been added to query view

Name Type Description
policy_template PolicyTemplate
view_index int32 Integer describing index of added PolicyTemplate in resulting query view.

PolicyTemplateChange.Current Message

PolicyTemplate has been added or modified in a query view. Version used for stateless watching

Name Type Description
policy_template PolicyTemplate

PolicyTemplateChange.Modified Message

PolicyTemplate changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of PolicyTemplate) Name of modified PolicyTemplate
policy_template PolicyTemplate New version of PolicyTemplate or masked difference, depending on mask_changes instrumentation of issued [WatchPolicyTemplateRequest] or [WatchPolicyTemplatesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified PolicyTemplate. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying PolicyTemplate new index in resulting query view.

PolicyTemplateChange.Removed Message

Removed is returned when PolicyTemplate is deleted or leaves Query view

Name Type Description
name string (name of PolicyTemplate)
view_index int32 Integer specifying removed PolicyTemplate index. Not populated in stateless watch type.

TsCndSpec Message

TsCndSpec defines time series queries and thresholds/anomaly detectors.

Name Type Description
queries repeated TsCndSpec.Query List of observed queries. Each by default can raise alert by threshold. If anomaly detectors are specified, they try to learn all time series together.
query_group_by repeated string List of group by labels applied to all queries. Each unique combination of group_by is tracked separately. It has its own adaptive thresholds, its own anomaly detectors. One such representation has a form of resource TsEntry. Group by fields must define all labels defined in Policy.
threshold_alerting TsCndSpec.ThresholdAlertingCfg Threshold alerting configuration
anomaly_alerting repeated TsCndSpec.AnomalyAlertingCfg All anomaly detectors. Its possible to define multiple detectors with different analysis window. It is advisable to create one detector catching long window (1 day, step interval 15 minutes), followed by small window (15 minutes, step interval 1 minute). This should catch sudden and small anomalies, along with long term unexpected changes. Maintaining long window (1 day) along with small interval (1 minute) would be too costly. Other option detectors may be: 1 day / 30 minutes + 30 minutes / 1 minute.

TsCndSpec.AnomalyAlertingCfg Message

AnomalyDetector defines AI/ML based anomaly detector. It can catch anomalies that are more sophisticated than max/min thresholds.

Name Type Description
analysis_window .google.protobuf.Duration Sliding analysis window observed at once by AI model. For larger windows, it is highly advisable for query_ap to be accordingly larger.
step_interval .google.protobuf.Duration Duration of each time step in sliding analysis window. Anomaly detection is run after each step.
train_step_interval .google.protobuf.Duration It is like step interval, but special used for training only. For example, we may want to run anomaly detection of size 30 minutes each 5 minutes. But in training, to reduce number of batches, we may prefer larger value, like 15 minutes or maybe even 30.
alignment_period .google.protobuf.Duration Granularity of data points within each step.
lstm_autoencoder TsCndSpec.AnomalyAlertingCfg.LstmAutoEncoder
raise_after .google.protobuf.Duration
silence_after .google.protobuf.Duration

TsCndSpec.AnomalyAlertingCfg.LstmAutoEncoder Message

LstmAutoEncoder defines LSTM AutoEncoder model for anomaly detection.

Name Type Description
hidden_size int32 Hidden size. Larger increases model size.
learn_rate double Learn rate used in Adam optimizer. This is suggested value. System may iterate other well known working values for best detection.
max_training_epochs int32 Maximum number of epochs after which training must stop.
min_training_epochs int32 Minimum number of training epochs model must train.
acceptable_training_error double Minimum acceptable error after training stops. When it is achieved, check samples are used to determine actual error rates. Too large value may cause overfit. This is suggested value. System may find other values giving better results.
training_period .google.protobuf.Duration How much time must be obtained for training purposes.
check_period_fraction double Training period, analysis window and training step interval directly influence how many training samples are created. Fraction is then used for detecting practical anomalies and initializing anomaly thresholds.
teacher_force_at_inference bool Enables teacher force mode during inference. It greatly reduces false positives, but may silence some actual small anomalies. It is especially important when time series data can change behavior persistently. For example, new workload was added to CPU.

TsCndSpec.Query Message

Query defines a single TimeSeries query and basic alerting thresholds.

Name Type Description
name string Query description.
filter string (filter of TimeSerie) Time series query filter
aligner Aggregation.Aligner Aligner applied on individual TimeSeries.
reducer Aggregation.Reducer Reducer applied across TimeSeries according to Spec.query_group_by field in the Spec.
max_value double Maximum value (approximated) that time series values will have for this query. It is a soft value: If higher values are detected, thresholds/anomaly models will adjust to them. If set to 0, it will be auto-detected (heuristic). If time series are negative, max_value should indicate maximum value FROM zero: Therefore, it can be a negative value.

TsCndSpec.ThresholdAlertingCfg Message

ThresholdAlertingCfg describes when alerts of THRESHOLD type must be raised.

Name Type Description
operator TsCndSpec.ThresholdAlertingCfg.Operator Operator for threshold-type alerts
alignment_period .google.protobuf.Duration Alignment period for data points used to monitor thresholds.
raise_after .google.protobuf.Duration Violation duration after which alert must be raised.
silence_after .google.protobuf.Duration Duration after which Alert stops firing when violations no longer occur. By default, equals to raise_after.
per_query_thresholds repeated TsCndSpec.ThresholdAlertingCfg.AlertingThresholds Thresholds per each query (in same order).
adaptive_thresholds_detection_period .google.protobuf.Duration This field is recommended to be set if adaptive thresholds are used. For each unique group by fields combination, dynamic thresholds will be detected based on historic data of specified length. One week by default.

TsCndSpec.ThresholdAlertingCfg.AlertingThresholds Message

AlertingThresholds represents all thresholds. When they are crossed by time series values, alert will be raised. Max thresholds are active all the time. Adaptive thresholds are active when anomaly detectors are not available (not defined or in training). It is also possible to set minimal lower/upper thresholds, to avoid adaptive thresholds being to insensitive. Overall, alert is raised when value drops below lower threshold or above upper threshold. Working allowed range is between. Values must always satisfy condition: Upper max > Upper min > Lower min > Lower max

Name Type Description
auto_adapt_upper bool Whether upper threshold should be set and adaptive.
auto_adapt_lower bool Whether lower threshold should be set and adaptive.
max_upper AlertingThreshold Maximum allowed upper threshold. When crossed ABOVE, alert is raised. Can be set to nil, but in that case max_lower is mandatory. Adaptive upper threshold cannot be set below it.
max_lower AlertingThreshold Maximum allowed lower threshold. When crossed BELOW, alert is raised. Can be set to nil, but in that case max_upper is mandatory. Adaptive lower threshold cannot be set below it.
min_upper AlertingThreshold Minimal allowed adaptive upper threshold. It is applicable only if auto_adapt_upper is true. Adaptive upper threshold cannot be set below it. It must be smaller than max_upper.
min_lower AlertingThreshold Minimal allowed adaptive lower threshold. It is applicable only if auto_adapt_lower is true. Adaptive lower threshold cannot be set above it. It must be bigger than max_lower.

TsConditionChange Message

TsConditionChange is used by Watch notifications Responses to describe change of single TsCondition One of Added, Modified, Removed

Name Type Description
added TsConditionChange.Added Added is returned when watched document is added, either created or enters Query view
modified TsConditionChange.Modified Modified is returned when watched document is modified
current TsConditionChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed TsConditionChange.Removed Removed is returned when TsCondition is deleted or leaves Query view

TsConditionChange.Added Message

TsCondition has been added to query view

Name Type Description
ts_condition TsCondition
view_index int32 Integer describing index of added TsCondition in resulting query view.

TsConditionChange.Current Message

TsCondition has been added or modified in a query view. Version used for stateless watching

Name Type Description
ts_condition TsCondition

TsConditionChange.Modified Message

TsCondition changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of TsCondition) Name of modified TsCondition
ts_condition TsCondition New version of TsCondition or masked difference, depending on mask_changes instrumentation of issued [WatchTsConditionRequest] or [WatchTsConditionsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified TsCondition. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying TsCondition new index in resulting query view.

TsConditionChange.Removed Message

Removed is returned when TsCondition is deleted or leaves Query view

Name Type Description
name string (name of TsCondition)
view_index int32 Integer specifying removed TsCondition index. Not populated in stateless watch type.

TsConditionTemplateChange Message

TsConditionTemplateChange is used by Watch notifications Responses to describe change of single TsConditionTemplate One of Added, Modified, Removed

Name Type Description
added TsConditionTemplateChange.Added Added is returned when watched document is added, either created or enters Query view
modified TsConditionTemplateChange.Modified Modified is returned when watched document is modified
current TsConditionTemplateChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed TsConditionTemplateChange.Removed Removed is returned when TsConditionTemplate is deleted or leaves Query view

TsConditionTemplateChange.Added Message

TsConditionTemplate has been added to query view

Name Type Description
ts_condition_template TsConditionTemplate
view_index int32 Integer describing index of added TsConditionTemplate in resulting query view.

TsConditionTemplateChange.Current Message

TsConditionTemplate has been added or modified in a query view. Version used for stateless watching

Name Type Description
ts_condition_template TsConditionTemplate

TsConditionTemplateChange.Modified Message

TsConditionTemplate changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of TsConditionTemplate) Name of modified TsConditionTemplate
ts_condition_template TsConditionTemplate New version of TsConditionTemplate or masked difference, depending on mask_changes instrumentation of issued [WatchTsConditionTemplateRequest] or [WatchTsConditionTemplatesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified TsConditionTemplate. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying TsConditionTemplate new index in resulting query view.

TsConditionTemplateChange.Removed Message

Removed is returned when TsConditionTemplate is deleted or leaves Query view

Name Type Description
name string (name of TsConditionTemplate)
view_index int32 Integer specifying removed TsConditionTemplate index. Not populated in stateless watch type.

TsEntryChange Message

TsEntryChange is used by Watch notifications Responses to describe change of single TsEntry One of Added, Modified, Removed

Name Type Description
added TsEntryChange.Added Added is returned when watched document is added, either created or enters Query view
modified TsEntryChange.Modified Modified is returned when watched document is modified
current TsEntryChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed TsEntryChange.Removed Removed is returned when TsEntry is deleted or leaves Query view

TsEntryChange.Added Message

TsEntry has been added to query view

Name Type Description
ts_entry TsEntry
view_index int32 Integer describing index of added TsEntry in resulting query view.

TsEntryChange.Current Message

TsEntry has been added or modified in a query view. Version used for stateless watching

Name Type Description
ts_entry TsEntry

TsEntryChange.Modified Message

TsEntry changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of TsEntry) Name of modified TsEntry
ts_entry TsEntry New version of TsEntry or masked difference, depending on mask_changes instrumentation of issued [WatchTsEntryRequest] or [WatchTsEntriesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified TsEntry. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying TsEntry new index in resulting query view.

TsEntryChange.Removed Message

Removed is returned when TsEntry is deleted or leaves Query view

Name Type Description
name string (name of TsEntry)
view_index int32 Integer specifying removed TsEntry index. Not populated in stateless watch type.

WatchAlertDataRequest Message

A request message of the WatchAlertData method. This is special combined watch of 5 streams dedicated specifically for edge alerter component. It reduces number of watch streams and therefore connections maintained by server (and slightly agent).

Name Type Description
project string (name of Project)
alerting_resource_name string
alerting_resource_kind string

WatchAlertDataResponse Message

A response message of the WatchAlertData method.

Name Type Description
alerts_to_add repeated Alert
ts_entries_to_add repeated TsEntry
policies_to_add repeated Policy
ts_cnds_to_add repeated TsCondition
log_cnds_to_add repeated LogCondition
alert_names_to_remove repeated string (name of Alert)
ts_entry_names_to_remove repeated string (name of TsEntry)
policy_names_to_remove repeated string (name of Policy)
ts_cnd_names_to_remove repeated string (name of TsCondition)
log_cnd_names_to_remove repeated string (name of LogCondition)
reset_alerts bool
reset_ts_entries bool
reset_policies bool
reset_ts_cnds bool
reset_log_cnds bool

Alerting Service Shared Enumerations

Here is the list of Alerting service shared enumerations:

LogCndSpec.Query.CompositeTrigger.Operator Enumeration

Operator informs if only one trigger must be satisfied to trigger an Alert, or all.

Name Description
UNDEFINED UNDEFINED is not allowed
AND AND tells that all triggers must be on for Alert to be created
OR OR tells that Alert should be raised based on any trigger condition.

NotificationChannelSpec.EventKind Enumeration

EventKind specifies interesting alert state change which may trigger a notification generation.

Name Description
UNDEFINED Undefined is not allowed
NEW_FIRING This kind must be used if we want to generate a notification for a new firing alert.
AI_ESCALATED_TO_OPERATOR This kind must be used if we want to generate a notification for an alert that has been pushed to Operator (escalated by AI Agent).
AI_REMEDIATION_AWAITING_APPROVAL This kind must be used if we want to generate a notification for an alert which received remediation recommendation by AI Agent, and which requires operator approval.
AI_IGNORED_AS_TMP This kind must be used if we want to generate a notification for an alert which has been considered as a temporary violation by AI Agent.
AI_ADJUSTED_ENTRIES This kind must be used if we want to generate a notification for an alert which has been considered as a false positive, and for which alerting thresholds should be adjusted.
AI_REMEDIATION_APPLIED This kind must be used if we want to generate a notification for an alert for which AI agent applied recommendation.
OP_REMEDIATION_APPLIED This kind must be used if we want to generate a notification for an alert for which operator applied recommendation.
STOPPED_FIRING This kind must be used if we want to generate a notification for an alert that stopped firing.

NotificationChannelSpec.Type Enumeration

Type of NotificationChannel

Name Description
TYPE_UNSPECIFIED Type is unknown
EMAIL Email NotificationChannel
SLACK Slack NotificationChannel
WEBHOOK Webhook NotificationChannel

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Type Enumeration

Name Description
UNDEFINED
TS_BASED_ANOMALY
TS_BASED_THRESHOLD
LOG_BASED

PolicySpec.ProcessingLocation Enumeration

ProcessingLocation indicates if alerts should be detected on Edge or in backend. Edge may be preferred for various reasons:

  • Alerts can be raised closer to the source.
  • Conditions can use more sophisticated methods, like local small AI anomaly detector models. In backend, performance may not be guaranteed, if there are a lot of pending trainings. Backend is preferred when:
  • We want to alert based on metrics that dont make sense on edge (like connectivity).
  • Alerting resoucrce is not “edge” type. For example, we monitor some network targets monitored by multiple distributed probes.
Name Description
UNDEFINED UNDEFINED is invalid
BACKEND Alerts will be detected and generated in the backend.
EDGE Alerts will be detected and generated on the edge.

PolicySpec.ResourceIdentity.LabelInfo.UsageContext Enumeration

UsageContext exact descriptor type where label key can be found.

Name Description
UNDEFINED UNDEFINED - not allowed
METRIC_LABEL Indicates that label of given key can be found in monitoring.edgelq.com/MetricDescriptor resource.
RESOURCE_LABEL Indicates that label of given key can be found in monitoring.edgelq.com/MonitoredResourceDescriptor resource.
LOG_LABEL Indicates that label of given key can be found in logging.edgelq.com/LogDescriptor resource.

TsCndSpec.ThresholdAlertingCfg.Operator Enumeration

Operator informs if whether all or one of queries must be crossed for alert to be generated.

Name Description
UNDEFINED UNDEFINED is not allowed
AND AND indicates that all thresholds must be crossed for alert ti be triggered.
OR OR indicates that Alert should be raised if any of queries violates threshold.