Tiyi v3.8.0

alert.proto — Alerting: rules, channels, alerts, silences

Schema: tiyi.v1 · alert.proto · English guide · 中文指南 · Full RPC index

Services

AlertService

RPC Kind Required permission
ListAlerts unary (alert:read)
GetAlert unary (alert:read)
AckAlert unary (alert:ack)
ResolveAlert unary (alert:resolve)
ListAlertRules unary (alert:read)
GetAlertRule unary (alert:read)
UpsertAlertRule unary (alert:write)
ReplayAlertRule unary (alert:write)
DeleteAlertRule unary (alert:write)
ListAlertChannels unary (alert:read)
GetAlertChannel unary (alert:read)
UpsertAlertChannel unary (alert:write)
DeleteAlertChannel unary (alert:write)
TestAlertChannel unary (alert:write)
PreviewAlertRuleNotification unary (alert:write)
ApplyAlertChannelToRules unary (alert:write)
ListAlertNotes unary (alert:read)
ListAlertSilences unary (alert:read)
CreateAlertSilence unary (alert:write)
DeleteAlertSilence unary (alert:write)
PreviewAlertSilence unary (alert:write)

RPCs

AlertService.ListAlerts

Request — tiyi.v1.ListAlertsRequest

Field JSON key Type Cardinality Description
page page PageRequest singular —
status status AlertStatus singular —
severity severity AlertSeverity singular —
site_id siteId string singular —
active_only activeOnly bool singular Unresolved occurrences: both OPEN and ACKED. Mutually exclusive with status.
rule_id ruleId string singular —
query query string singular —
start start google.protobuf.Timestamp singular Filters occurrence opening time in [start, end). RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
end end google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.

Response — tiyi.v1.ListAlertsResponse

Field JSON key Type Cardinality Description
items items Alert repeated —
page page PageResponse singular —

AlertService.GetAlert

Request — tiyi.v1.GetAlertRequest

Field JSON key Type Cardinality Description
id id string singular —

Response — tiyi.v1.GetAlertResponse

Field JSON key Type Cardinality Description
alert alert Alert singular —

AlertService.AckAlert

Request — tiyi.v1.AckAlertRequest

Field JSON key Type Cardinality Description
id id string singular —
note note string singular —

Response — tiyi.v1.AckAlertResponse

Field JSON key Type Cardinality Description
alert alert Alert singular —

AlertService.ResolveAlert

Request — tiyi.v1.ResolveAlertRequest

Field JSON key Type Cardinality Description
id id string singular —
note note string singular —

Response — tiyi.v1.ResolveAlertResponse

Field JSON key Type Cardinality Description
alert alert Alert singular —

AlertService.ListAlertRules

Request — tiyi.v1.ListAlertRulesRequest

Field JSON key Type Cardinality Description
page page PageRequest singular —

Response — tiyi.v1.ListAlertRulesResponse

Field JSON key Type Cardinality Description
items items AlertRule repeated —
page page PageResponse singular —

AlertService.GetAlertRule

Request — tiyi.v1.GetAlertRuleRequest

Field JSON key Type Cardinality Description
id id string singular —

Response — tiyi.v1.GetAlertRuleResponse

Field JSON key Type Cardinality Description
rule rule AlertRule singular —

AlertService.UpsertAlertRule

Request — tiyi.v1.UpsertAlertRuleRequest

Field JSON key Type Cardinality Description
rule rule AlertRule singular —
update_mask updateMask google.protobuf.FieldMask singular comma-joined field paths, e.g. "name,status".

Response — tiyi.v1.UpsertAlertRuleResponse

Field JSON key Type Cardinality Description
rule rule AlertRule singular —

AlertService.ReplayAlertRule

Replays an unsaved security-threshold condition against immutable facts from the preceding 24 hours. The response is read-only and does not create alerts, lifecycle events, or notification jobs.

Request — tiyi.v1.ReplayAlertRuleRequest

Field JSON key Type Cardinality Description
expression expression string singular The same JSON condition expression accepted by AlertRule.expression.

Response — tiyi.v1.ReplayAlertRuleResponse

Field JSON key Type Cardinality Description
started_at startedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
ended_at endedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
matching_event_count matchingEventCount int64 singular JSON string (64-bit ints are quoted).
trigger_count triggerCount int64 singular JSON string (64-bit ints are quoted).
resolved_count resolvedCount int64 singular JSON string (64-bit ints are quoted).
firing_notification_count firingNotificationCount int64 singular Logical lifecycle notification events before channel fan-out, silencing, channel severity floors, retries, or delivery failures. JSON string (64-bit ints are quoted).
resolved_notification_count resolvedNotificationCount int64 singular JSON string (64-bit ints are quoted).
open_at_end openAtEnd bool singular —

AlertService.DeleteAlertRule

Request — tiyi.v1.DeleteAlertRuleRequest

Field JSON key Type Cardinality Description
id id string singular —

Response — tiyi.v1.DeleteAlertRuleResponse

Field JSON key Type Cardinality Description
result result MutationResult singular —

AlertService.ListAlertChannels

Request — tiyi.v1.ListAlertChannelsRequest

Field JSON key Type Cardinality Description
page page PageRequest singular —

Response — tiyi.v1.ListAlertChannelsResponse

Field JSON key Type Cardinality Description
items items AlertChannel repeated —
page page PageResponse singular —

AlertService.GetAlertChannel

Request — tiyi.v1.GetAlertChannelRequest

Field JSON key Type Cardinality Description
id id string singular —

Response — tiyi.v1.GetAlertChannelResponse

Field JSON key Type Cardinality Description
channel channel AlertChannel singular —

AlertService.UpsertAlertChannel

Request — tiyi.v1.UpsertAlertChannelRequest

Field JSON key Type Cardinality Description
channel channel AlertChannel singular —
update_mask updateMask google.protobuf.FieldMask singular comma-joined field paths, e.g. "name,status".

Response — tiyi.v1.UpsertAlertChannelResponse

Field JSON key Type Cardinality Description
channel channel AlertChannel singular —

AlertService.DeleteAlertChannel

Request — tiyi.v1.DeleteAlertChannelRequest

Field JSON key Type Cardinality Description
id id string singular —

Response — tiyi.v1.DeleteAlertChannelResponse

Field JSON key Type Cardinality Description
result result MutationResult singular —

AlertService.TestAlertChannel

Request — tiyi.v1.TestAlertChannelRequest

Field JSON key Type Cardinality Description
channel channel AlertChannel singular —

Response — tiyi.v1.TestAlertChannelResponse

Field JSON key Type Cardinality Description
success success bool singular —
message message string singular —

AlertService.PreviewAlertRuleNotification

Renders an unsaved rule for a saved destination and lifecycle event, without delivery.

Request — tiyi.v1.PreviewAlertRuleNotificationRequest

Field JSON key Type Cardinality Description
rule rule AlertRule singular The complete, potentially unsaved rule, including condition and content.
channel_id channelId string singular A saved destination in the authenticated tenant. No secrets are hydrated.
lifecycle_event lifecycleEvent string singular —

Response — tiyi.v1.PreviewAlertRuleNotificationResponse

Field JSON key Type Cardinality Description
title title string singular —
message message string singular —
markdown markdown string singular —
locale locale string singular —
timezone timezone string singular —

AlertService.ApplyAlertChannelToRules

Request — tiyi.v1.ApplyAlertChannelToRulesRequest

Field JSON key Type Cardinality Description
channel_id channelId string singular —
rule_ids ruleIds string repeated —

Response — tiyi.v1.ApplyAlertChannelToRulesResponse

Field JSON key Type Cardinality Description
channel channel AlertChannel singular —
rules rules AlertRule repeated —
changed_count changedCount int32 singular —

AlertService.ListAlertNotes

Request — tiyi.v1.ListAlertNotesRequest

Field JSON key Type Cardinality Description
alert_id alertId string singular —

Response — tiyi.v1.ListAlertNotesResponse

Field JSON key Type Cardinality Description
items items AlertNote repeated —

AlertService.ListAlertSilences

Request — tiyi.v1.ListAlertSilencesRequest

Field JSON key Type Cardinality Description
active_only activeOnly bool singular —
page page PageRequest singular —

Response — tiyi.v1.ListAlertSilencesResponse

Field JSON key Type Cardinality Description
items items AlertSilence repeated —
page page PageResponse singular —

AlertService.CreateAlertSilence

Request — tiyi.v1.CreateAlertSilenceRequest

Field JSON key Type Cardinality Description
matchers matchers map<string, string> map —
starts_at startsAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
ends_at endsAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
reason reason string singular —

Response — tiyi.v1.CreateAlertSilenceResponse

Field JSON key Type Cardinality Description
silence silence AlertSilence singular —

AlertService.DeleteAlertSilence

Request — tiyi.v1.DeleteAlertSilenceRequest

Field JSON key Type Cardinality Description
id id string singular —

Response — tiyi.v1.DeleteAlertSilenceResponse

Field JSON key Type Cardinality Description
result result MutationResult singular —

AlertService.PreviewAlertSilence

Request — tiyi.v1.PreviewAlertSilenceRequest

Field JSON key Type Cardinality Description
matchers matchers map<string, string> map —

Response — tiyi.v1.PreviewAlertSilenceResponse

Field JSON key Type Cardinality Description
matching_count matchingCount int64 singular JSON string (64-bit ints are quoted).
items items Alert repeated At most 20 currently unresolved occurrences; this does not predict future alerts.

Messages

Alert

Field JSON key Type Cardinality Description
id id string singular —
tenant_id tenantId string singular —
site_id siteId string singular —
severity severity AlertSeverity singular —
status status AlertStatus singular —
title title string singular —
message message string singular —
payload payload google.protobuf.Struct singular free-form JSON object.
opened_at openedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
acked_at ackedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
resolved_at resolvedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
last_matched_at lastMatchedAt google.protobuf.Timestamp singular Last evaluation at which the rule condition matched. The payload is the evidence snapshot captured at this time and remains frozen after clear. RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
rule_id ruleId string singular —
agent_id agentId string singular —
kind kind string singular —
evaluation_state evaluationState string singular Condition state is independent of operator acknowledgement.
closed_reason closedReason string singular condition_cleared, operator, rule_changed, rule_disabled, rule_deleted
firing_at firingAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.

AlertChannel

Field JSON key Type Cardinality Description
id id string singular —
tenant_id tenantId string singular —
name name string singular —
kind kind AlertChannelKind singular —
enabled enabled bool singular —
config config google.protobuf.Struct singular free-form JSON object.
created_at createdAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
updated_at updatedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.

AlertNote

Field JSON key Type Cardinality Description
id id string singular —
alert_id alertId string singular —
kind kind string singular —
body body string singular —
actor_user_id actorUserId string singular —
created_at createdAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.

AlertNotificationLocale

Field JSON key Type Cardinality Description
templates templates map<string, AlertNotificationTemplate> map Exact lifecycle event keys; missing events/fields retain built-in content.
custom_fields customFields map<string, string> map —

AlertNotificationTemplate

Field JSON key Type Cardinality Description
title title string singular —
message message string singular —

AlertRule

Field JSON key Type Cardinality Description
id id string singular —
tenant_id tenantId string singular —
name name string singular —
enabled enabled bool singular —
severity severity AlertSeverity singular —
expression expression string singular —
channel_ids channelIds string repeated —
created_at createdAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
updated_at updatedAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
notification notification AlertRuleNotification singular —

AlertRuleNotification

Business content belongs to the rule; the destination selects the locale.

Field JSON key Type Cardinality Description
locales locales map<string, AlertNotificationLocale> map Supported keys: zh-CN and en-US. Missing locales use built-in content.

AlertSilence

Field JSON key Type Cardinality Description
id id string singular —
tenant_id tenantId string singular —
matchers matchers map<string, string> map —
starts_at startsAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
ends_at endsAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.
created_by createdBy string singular —
reason reason string singular —
created_at createdAt google.protobuf.Timestamp singular RFC 3339 string, e.g. 2026-07-26T09:00:00Z.

Enums

AlertChannelKind

Value Number Description
ALERT_CHANNEL_KIND_UNSPECIFIED 0 —
ALERT_CHANNEL_KIND_EMAIL 1 —
ALERT_CHANNEL_KIND_WEBHOOK 2 —
ALERT_CHANNEL_KIND_SLACK 3 —
ALERT_CHANNEL_KIND_PAGERDUTY 4 —
ALERT_CHANNEL_KIND_FEISHU 5 —
ALERT_CHANNEL_KIND_WECOM 6 —

AlertSeverity

Value Number Description
ALERT_SEVERITY_UNSPECIFIED 0 —
ALERT_SEVERITY_INFO 1 —
ALERT_SEVERITY_WARNING 2 —
ALERT_SEVERITY_CRITICAL 3 —

AlertStatus

Value Number Description
ALERT_STATUS_UNSPECIFIED 0 —
ALERT_STATUS_OPEN 1 —
ALERT_STATUS_ACKED 2 —
ALERT_STATUS_RESOLVED 3 —