您可以将提醒中心配置为在有更新时发送通知。如需配置提醒中心以发送通知,您需要根据所需的通知设置来配置设置。
Google Cloud Pub/Sub 通知
提醒中心可以向 Google Pub/Sub 主题发布通知。
创建主题并向其授予 alerts-api-push-notifications@system.gserviceaccount.com 发布权限后,使用 Alert Center 更新设置 API 将该主题设置为通知目的地。配置完成后,每次更新(例如收到新提醒时),提醒中心都会向该主题发布一条消息。
Pub/Sub 消息属性
常用属性
alertcenter_resource_type- 资源的类型。目前支持的值为"ALERT"。alertcenter_resource_status- 资源的状态。目前支持的值为"CREATED", "DELETED", "UNDELETED", "MODIFIED"。alertcenter_payload_format- 载荷的格式(根据通知设置)。 目前支持的值为"JSON"。
提醒属性
alertcenter_start_time- 导致此提醒的事件的开始时间或检测时间。alertcenter_end_time- 导致此提醒的事件停止处于活跃状态的时间。alertcenter_type- 提醒的类型。如需查看可用的提醒类型列表,请参阅 Google Workspace 提醒类型。alertcenter_source- 报告提醒的系统的唯一标识符。alertcenter_create_time- 相应提醒的创建时间。alertcenter_update_time- 上次更新此提醒的时间。
消息载荷
消息的载荷取决于 alertcenter_resource_type。当资源类型为 "ALERT" 时,载荷将是提醒中心的某个提醒类型。
载荷的格式取决于 alertcenter_payload_format。如果格式为 "JSON",则载荷将是 base64 编码的
JSON。