From 01395f3faf182a43860596248283a46c1905f747 Mon Sep 17 00:00:00 2001 From: Chandra Date: Fri, 30 Jan 2026 10:10:22 +0000 Subject: [PATCH] chore: Add README for running zonal buckets samples --- samples/README.md | 9 ++- samples/snippets/zonal_buckets/README.md | 74 ++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 samples/snippets/zonal_buckets/README.md diff --git a/samples/README.md b/samples/README.md index 490af710a..9999e8e53 100644 --- a/samples/README.md +++ b/samples/README.md @@ -34,8 +34,15 @@ for more detailed instructions. ``` source /bin/activate ``` +3. To run samples for [Zonal Buckets](https://github.com/googleapis/python-storage/tree/main/samples/snippets/zonal_buckets) -3. Install the dependencies needed to run the samples. + ``` + pip install -e ".[grpc]" + python samples/snippets/zonal_buckets/storage_create_and_write_appendable_object.py --bucket_name --object_name + + ``` + +4. Install the dependencies needed to run the samples. ``` cd samples/snippets pip install -r requirements.txt diff --git a/samples/snippets/zonal_buckets/README.md b/samples/snippets/zonal_buckets/README.md new file mode 100644 index 000000000..5f84b70ea --- /dev/null +++ b/samples/snippets/zonal_buckets/README.md @@ -0,0 +1,74 @@ +# Google Cloud Storage - Zonal Buckets Snippets + +This directory contains snippets for interacting with Google Cloud Storage zonal buckets. + +## Prerequisites + +- A Google Cloud Platform project with the Cloud Storage API enabled. +- A zonal Google Cloud Storage bucket. + +## Running the snippets + +### Create and write to an appendable object + +This snippet uploads an appendable object to a zonal bucket. + +```bash +python samples/snippets/zonal_buckets/storage_create_and_write_appendable_object.py --bucket_name --object_name +``` + +### Finalize an appendable object upload + +This snippet creates, writes to, and finalizes an appendable object. + +```bash +python samples/snippets/zonal_buckets/storage_finalize_appendable_object_upload.py --bucket_name --object_name +``` + +### Download a range of bytes from multiple objects concurrently + +This snippet downloads a range of bytes from multiple objects concurrently. + +```bash +python samples/snippets/zonal_buckets/storage_open_multiple_objects_ranged_read.py --bucket_name --object_names +``` + +### Download multiple ranges of bytes from a single object + +This snippet downloads multiple ranges of bytes from a single object into different buffers. + +```bash +python samples/snippets/zonal_buckets/storage_open_object_multiple_ranged_read.py --bucket_name --object_name +``` + +### Download the entire content of an object + +This snippet downloads the entire content of an object using a multi-range downloader. + +```bash +python samples/snippets/zonal_buckets/storage_open_object_read_full_object.py --bucket_name --object_name +``` + +### Download a range of bytes from an object + +This snippet downloads a range of bytes from an object. + +```bash +python samples/snippets/zonal_buckets/storage_open_object_single_ranged_read.py --bucket_name --object_name --start_byte --size +``` + +### Pause and resume an appendable object upload + +This snippet demonstrates pausing and resuming an appendable object upload. + +```bash +python samples/snippets/zonal_buckets/storage_pause_and_resume_appendable_upload.py --bucket_name --object_name +``` + +### Tail an appendable object + +This snippet demonstrates tailing an appendable GCS object, similar to `tail -f`. + +```bash +python samples/snippets/zonal_buckets/storage_read_appendable_object_tail.py --bucket_name --object_name --duration +```