警报集成
核心平台alarm_integrations_connections_write外部集成将设施连接到监控合作伙伴的模板并管理该连接:保存(模板、账号、防区映射、事件、设施字段)、移除、申请批准、发送测试信号、测试成功后激活,以及放弃暂存的更改。
生效中的连接(active 或 failing)只能通过 applyMode 更改:staged 会让警报继续使用生效中的设置,直到暂存测试成功并由你激活;immediate 立即应用。可以提交机密字段,但绝不会返回。需要该设施的 External Integrations 权限。先使用 alarm_integrations_read connections 读取。
操作:
- save:保存连接。新连接需要 templateId。fields 按键设置设施字段(null 清除该字段;机密会被加密封存)。对生效中的连接须传入 applyMode,否则调用会因 apply-mode-required 失败。需要 partnerId。需要确认。
- remove:移除连接。移除该设施与合作伙伴的连接及任何暂存的更改;此后该设施的警报不再发送到该监控中心。需要 partnerId。需要确认。
- request_approval:申请批准。请求监控中心批准连接或分配账号(适用于需合作伙伴批准的模板)。需要 partnerId。
- send_test_signal:发送测试信号。将一个真实测试信号排队发送到监控中心;轮询 test_signal_status。staged: true 表示测试暂存的更改而不是生效中的设置。需要 partnerId。需要确认。
- activate:激活连接或更改。使待处理的连接生效、推广暂存的更改,或确认未经测试的更改。激活需要最后一次更改后测试成功的 requestId:暂存测试 (staged: true) 用于推广暂存的更改,生效测试用于确认未经测试的更改。需要 partnerId、requestId。需要确认。
- discard_pending_change:放弃暂存的更改。删除暂存的更改;生效中的设置保持不变。没有暂存内容时 discarded 为 false。需要 partnerId。需要确认。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
action* | "save" | "remove" | "request_approval" | "send_test_signal" | "activate" | "discard_pending_change" | 要执行的操作;每个操作的说明见工具描述。 |
facilityId | string | 设施 ID。如果所指的就是已连接的设施,则可省略。 |
partnerId | string | 监控合作伙伴,来自 alarm_integrations_read connections(组织自有模板使用 org#<id>) |
templateId | string | 向此设施提供的已发布模板 (save) |
linkingIdentifier | stringnull | 监控中心用于识别该设施的账号 (save) |
zoneMap | objectnull | 按钮序列号到防区的映射,例如 { "DS-0001": "001" } (save) |
events | arraynull | 发送给合作伙伴的事件类型(null:使用模板的设置) (save) |
fields | object | 按键设置的设施字段值;null 清除该字段。绝不会返回。(save) |
applyMode | "staged" | "immediate" | 生效中的连接:staged(先测试再激活)或 immediate (save) |
staged | boolean | 测试暂存的更改(激活前必须执行) (send_test_signal) |
requestId | string | 测试信号请求 ID (tsr_...),来自 send_test_signal (activate) |
confirm | boolean | 仅在用户确认第一次调用返回的预览后设置 |
alarm_integrations_destinations_write外部集成Duress Configuration在设施(默认)、品牌或组织级别添加、更改、删除和测试触发自定义警报目标:你自己的监控接收器、继电器板、短信、语音、电子邮件、webhook、团队聊天或值班寻呼服务(见 channel 列表)。
非机密设置放在 config 中;机密(密码、webhook URL、密钥)按设置路径放在 fields 中,会被加密封存,绝不会返回。已启用的目标需要完整的 config。设施目标需要该设施的 External Integrations 或 Duress Configuration 权限;品牌和组织目标需要组织范围的访问权限。先使用 alarm_integrations_read destinations 读取。
操作:
- save:保存目标。不带 connectionId 时添加目标(需要 channel 和 name);带 connectionId 时更改目标(channel 保持不变)。传入 config 时会替换非机密设置;fields 中未提供的机密会保留。需要确认。
- remove:删除目标。删除该目标;设施继电器也会停止驱动警报继电器。需要 connectionId。需要确认。
- send_test_signal:向目标发送测试。将一条真实测试消息排队发送到该目标;使用该设施轮询 alarm_integrations_read test_signal_status。品牌和组织目标从 facilityId 进行测试。需要 connectionId。需要确认。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
action* | "save" | "remove" | "send_test_signal" | 要执行的操作;每个操作的说明见工具描述。 |
facilityId | string | 设施 ID。如果所指的就是已连接的设施,则可省略。 |
ownerScope | string | facility#<id>、brand#<id> 或 org#<id>(默认:该设施) |
connectionId | string | 要更改的目标;省略则添加新目标 |
channel | "cid-csvip" | "sentinel-http" | "relay" | "sms" | "voice" | "email" | "webhook" | "slack" | "teams" | "google-chat" | "pagerduty" | "opsgenie" | 目标类型;创建后无法更改 (save) |
name | string | 显示在设置和投递日志中 (save) |
enabled | boolean | 新目标默认为 true (save) |
events | arraynull | 其接收的事件类型(null:使用该渠道的默认值) (save) |
guestLink | "shared" | "none" | "null" | 仅限短信、电子邮件和团队聊天渠道:shared(一个只读警报页面,默认)或 none (save) |
config | object | 该渠道的非机密设置 (save) |
fields | object | 按路径设置的机密设置,例如 { "webhookUrl": "https://..." };null 清除该项 (save) |
confirm | boolean | 仅在用户确认第一次调用返回的预览后设置 |
alarm_integrations_read外部集成Duress Configuration读取设施的 Duress 警报在 Performance Hub 之外的去向:其监控中心连接(合作伙伴、模板、账号、防区映射、状态、就绪缺口、暂存的更改)、设施及其品牌和组织级别的自定义目标(监控接收器、继电器、短信、语音、电子邮件、webhook、聊天、寻呼)、路由预览、投递日志和测试信号结果。
需要该设施的 External Integrations 或 Duress Configuration 权限。机密和加密封存的值绝不会显示,只显示 { key, secret, hasValue };路由和投递中的个人号码和地址会被隐去。时间采用 ISO 格式。使用 alarm_integrations_connections_write 和 alarm_integrations_destinations_write 进行更改。
操作:
- connections:监控中心连接。设施的合作伙伴连接:模板、账号 (linkingIdentifier)、防区映射、事件、connectionStatus、missing(阻止上线的因素)、pendingChange(已暂存,尚未生效)和 untestedChange。canEdit:在此设施拥有 External Integrations 权限。
- destinations:自定义目标。可为该设施触发的目标(设施自身、其品牌和组织的目标,各自带 canEdit),或通过 ownerScope 指定单个范围的目标。设置在 config 中;机密以 fields { key, secret, hasValue } 形式显示。
- routing:路由预览。按 universal-api 的解析方式,显示警报此刻会发送到哪里(仅生效中的设置):带 lane、events 和不含机密的 config 的目标,说明遗漏原因的 problems,以及尚未路由的 pendingChanges。eventType 只保留接收该事件的目标。
- deliveries:投递日志。警报投递记录,最新的在前(状态、渠道、接收方、延迟、公开的错误说明)。经过筛选的页面可能条目较少但仍有 nextCursor。设备警报显示为 kind alert。
- test_signal_status:测试信号结果。在 universal-api 记录尝试之前为 queued,之后为 succeeded(接收方已确认或已发送)或 failed,并附投递记录。使用发送测试的设施。需要 requestId。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
action* | "connections" | "destinations" | "routing" | "deliveries" | "test_signal_status" | 要执行的操作;每个操作的说明见工具描述。 |
facilityId | string | 设施 ID。如果所指的就是已连接的设施,则可省略。 |
limit | integer | 每页条目数(默认 25,最多 100) (connections, destinations, deliveries) |
cursor | string | 上一页返回的 nextCursor (connections, destinations, deliveries) |
ownerScope | string | 仅此范围:brand#<id> 或 org#<id> (destinations) |
eventType | string | 例如 ph.duress.incident.created (routing, deliveries) |
from | string | ISO 日期时间,包含该时间 (deliveries) |
to | string | ISO 日期时间,不包含该时间 (deliveries) |
status | array | sent、acknowledged、failed、shadow 中的任意值 (deliveries) |
channel | string | 精确的渠道,例如 cid-csvip 或 sms (deliveries) |
destinationId | string | 精确的目标 ID (deliveries) |
incidentId | string | 单个警报的投递记录 (deliveries) |
requestId | string | 单个测试信号的投递记录 (deliveries, test_signal_status) |
search | string | 任意 ID、渠道或错误中包含的文本 (deliveries) |