您可以将提醒中心配置为在有更新时发送通知。如需配置提醒中心以发送通知,您需要使用所需的通知设置配置您的设置。
Google Cloud Pub/Sub 通知
提醒中心可以向 Google Pub/Sub 主题发布通知。
创建主题并向其授予 alerts-api-push-notifications@system.gserviceaccount.com 发布权限后,请使用 Alert Center update settings 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 格式。