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 從公開儲存庫中收錄這些內容。

檢舉或申請下架