Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions google/cloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,15 @@ def list_blobs(
:rtype: :class:`~google.api_core.page_iterator.Iterator`
:returns: Iterator of all :class:`~google.cloud.storage.blob.Blob`
in this bucket matching the arguments.

Example:
List blobs in the bucket with user_project.

>>> from google.cloud import storage
>>> client = storage.Client()

>>> bucket = storage.Bucket("my-bucket-name", user_project='my-project')
>>> all_blobs = list(bucket.list_blobs())
"""
extra_params = {"projection": projection}

Expand Down
9 changes: 9 additions & 0 deletions google/cloud/storage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,15 @@ def list_blobs(
Returns:
Iterator of all :class:`~google.cloud.storage.blob.Blob`
in this bucket matching the arguments.

Example:
List blobs in the bucket with user_project.

>>> from google.cloud import storage
>>> client = storage.Client()

>>> bucket = storage.Bucket("my-bucket-name", user_project='my-project')
>>> all_blobs = list(client.list_blobs(bucket))
"""
bucket = self._bucket_arg_to_bucket(bucket_or_name)
return bucket.list_blobs(
Expand Down