Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring region tags #222

Closed
wants to merge 2 commits into from
Closed
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
7 changes: 6 additions & 1 deletion storage/api/list_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START all]

"""Command-line sample application for listing all objects in a bucket using
the Cloud Storage API.

Expand Down Expand Up @@ -56,6 +59,7 @@ def get_bucket_metadata(bucket):


def list_bucket(bucket):
# [START list_bucket]
"""Returns a list of metadata of the objects within the given bucket."""
service = create_service()

Expand All @@ -72,7 +76,7 @@ def list_bucket(bucket):
all_objects.extend(resp.get('items', []))
req = service.objects().list_next(req, resp)
return all_objects

# [END list_bucket]

def main(bucket):
print(json.dumps(get_bucket_metadata(bucket), indent=2))
Expand All @@ -88,3 +92,4 @@ def main(bucket):
args = parser.parse_args()

main(args.bucket)
# [END all]