Recipe Watch Drive Changes

作者 googleworkspacea3768d0e82ad无许可证31K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库昨天更新

Subscribe to change notifications on a Google Drive file or folder.

仅含说明DevOps & Cloud
AI 生成的概览

使用 gws events 命令行工具创建并维护 Google Drive 变更通知订阅。

功能
该配方说明如何订阅 Google Drive 文件或文件夹的变更通知。它给出 gws events subscriptions create 命令,包含目标资源、事件类型、Pub/Sub 通知端点和负载选项,并说明如何列出活动订阅以及在到期前续订。产出是一个处于活动状态并持续维护的订阅,而不是文件或报告。
适用场景
当需要获知某个 Google Drive 文件或云盘的更新时使用,或在现有订阅即将到期需要续订时使用。适用于通过 Pub/Sub 转发 Drive 事件的运维监控场景。
运行要求
需要 gws 命令行工具和 gws-events 技能;需要 Google Drive 资源、用于通知端点的 Pub/Sub 主题与项目,以及访问 Google Workspace 事件的授权。不包含脚本,仅为操作说明。

Watch for Drive Changes

PREREQUISITE: Load the following skills to execute this recipe: gws-events

Subscribe to change notifications on a Google Drive file or folder.

Steps

  1. Create subscription: gws events subscriptions create --json '{"targetResource": "//drive.googleapis.com/drives/DRIVE_ID", "eventTypes": ["google.workspace.drive.file.v1.updated"], "notificationEndpoint": {"pubsubTopic": "projects/PROJECT/topics/TOPIC"}, "payloadOptions": {"includeResource": true}}'
  2. List active subscriptions: gws events subscriptions list
  3. Renew before expiry: gws events +renew --subscription SUBSCRIPTION_ID

来源与署名

来源:googleworkspace/cli位于skills/recipe-watch-drive-changes提交a3768d0

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架