通知

可以将提醒中心配置为在有更新时发送通知。如需配置提醒中心以发送通知,您需要使用所需的通知设置配置设置。

Google Cloud Pub/Sub 通知

提醒中心可以向 Google Pub/Sub 主题发布通知。创建主题并授予 alerts-api-push-notifications@system.gserviceaccount.com 的发布权限后,请使用提醒中心 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