Objects: watchAll

Watch for changes on all objects in a bucket. Try it now.

Request

HTTP request

POST https://www.googleapis.com/storage/v1/b/bucket/o/watch

Parameters

Parameter name Value Description
Path parameters
bucket string Name of the bucket in which to look for objects.
Optional query parameters
delimiter string Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.
maxResults unsigned integer Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.
pageToken string A previously-returned page token representing part of the larger set of results to view.
prefix string Filter results to objects whose names begin with this prefix.
projection string Set of properties to return. Defaults to noAcl.

Acceptable values are:
  • "full": Include all properties.
  • "noAcl": Omit the owner, acl property.
userProject string The project to be billed for this request. Required for Requester Pays buckets.
versions boolean If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.

Request body

In the request body, supply data with the following structure:

{
  "kind": "api#channel",
  "id": string,
  "resourceId": string,
  "resourceUri": string,
  "token": string,
  "expiration": long,
  "type": string,
  "address": string,
  "payload": boolean,
  "params": {
    (key): string
  }
}
Property name Value Description Notes
kind string Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
id string A UUID or similar unique string that identifies this channel.
resourceId string An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
resourceUri string A version-specific identifier for the watched resource.
token string An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
expiration long Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
type string The type of delivery mechanism used for this channel. Value: the fixed string "WEBHOOK".
address string The address where notifications are delivered for this channel.
params object Additional parameters controlling delivery channel behavior. Optional.
params.(key) string Declares a new parameter by name.
payload boolean A Boolean value to indicate whether payload is wanted. Optional.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "api#channel",
  "id": string,
  "resourceId": string,
  "resourceUri": string,
  "token": string,
  "expiration": long,
  "type": string,
  "address": string,
  "payload": boolean,
  "params": {
    (key): string
  }
}
Property name Value Description Notes
kind string Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
id string A UUID or similar unique string that identifies this channel.
resourceId string An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
resourceUri string A version-specific identifier for the watched resource.
token string An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
expiration long Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
type string The type of delivery mechanism used for this channel.
address string The address where notifications are delivered for this channel.
params object Additional parameters controlling delivery channel behavior. Optional.
params.(key) string Declares a new parameter by name.
payload boolean A Boolean value to indicate whether payload is wanted. Optional.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Storage Documentation