Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Buckets: list

Retrieves a list of buckets for a given project. Try it now or see an example .

The authenticated user must be a member of the project's team .

Request

HTTP request

GET https://www.googleapis.com/storage/v1beta1/b

Parameters

Parameter name Value Description
Required parameters
projectId unsigned long A valid API project identifier.
Optional parameters
max-results unsigned integer Maximum number of buckets to return.
pageToken string A previously-returned page token representing part of the larger set of results to view.
projection string Set of properties to return. Defaults to no_acl .

Acceptable values are:
  • " full ": Include all properties.
  • " no_acl ": Omit acl and defaultObjectAcl properties.

Request body

Do not supply a request body with this method.

Response

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

{
  "kind": "storage#buckets",
  "nextPageToken": string,
  "items": [
    buckets Resource
  ]
}
Property name Value Description Notes
kind string The kind of item this is. For lists of buckets, this is always storage#buckets .
nextPageToken string The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
items[] list The list of items.

Examples

Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).

Ruby

Uses the Ruby client library

# List all buckets in the project
bucket_list_result = client.execute(
  api_method: storage.buckets.list,
  parameters: {projectId: PROJECTID}
)
puts "List of buckets: "
puts bucket_list_result.data.items.map(&:id)

Try it!

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

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.