|
| 1 | +# Google Cloud Storage - Zonal Buckets Snippets |
| 2 | + |
| 3 | +This directory contains snippets for interacting with Google Cloud Storage zonal buckets. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- A Google Cloud Platform project with the Cloud Storage API enabled. |
| 8 | +- A zonal Google Cloud Storage bucket. |
| 9 | + |
| 10 | +## Running the snippets |
| 11 | + |
| 12 | +### Create and write to an appendable object |
| 13 | + |
| 14 | +This snippet uploads an appendable object to a zonal bucket. |
| 15 | + |
| 16 | +```bash |
| 17 | +python samples/snippets/zonal_buckets/storage_create_and_write_appendable_object.py --bucket_name <bucket_name> --object_name <object_name> |
| 18 | +``` |
| 19 | + |
| 20 | +### Finalize an appendable object upload |
| 21 | + |
| 22 | +This snippet creates, writes to, and finalizes an appendable object. |
| 23 | + |
| 24 | +```bash |
| 25 | +python samples/snippets/zonal_buckets/storage_finalize_appendable_object_upload.py --bucket_name <bucket_name> --object_name <object_name> |
| 26 | +``` |
| 27 | + |
| 28 | +### Pause and resume an appendable object upload |
| 29 | + |
| 30 | +This snippet demonstrates pausing and resuming an appendable object upload. |
| 31 | + |
| 32 | +```bash |
| 33 | +python samples/snippets/zonal_buckets/storage_pause_and_resume_appendable_upload.py --bucket_name <bucket_name> --object_name <object_name> |
| 34 | +``` |
| 35 | + |
| 36 | +### Tail an appendable object |
| 37 | + |
| 38 | +This snippet demonstrates tailing an appendable GCS object, similar to `tail -f`. |
| 39 | + |
| 40 | +```bash |
| 41 | +python samples/snippets/zonal_buckets/storage_read_appendable_object_tail.py --bucket_name <bucket_name> --object_name <object_name> --duration <duration_in_seconds> |
| 42 | +``` |
| 43 | + |
| 44 | + |
| 45 | +### Download a range of bytes from an object |
| 46 | + |
| 47 | +This snippet downloads a range of bytes from an object. |
| 48 | + |
| 49 | +```bash |
| 50 | +python samples/snippets/zonal_buckets/storage_open_object_single_ranged_read.py --bucket_name <bucket_name> --object_name <object_name> --start_byte <start_byte> --size <size> |
| 51 | +``` |
| 52 | + |
| 53 | + |
| 54 | +### Download multiple ranges of bytes from a single object |
| 55 | + |
| 56 | +This snippet downloads multiple ranges of bytes from a single object into different buffers. |
| 57 | + |
| 58 | +```bash |
| 59 | +python samples/snippets/zonal_buckets/storage_open_object_multiple_ranged_read.py --bucket_name <bucket_name> --object_name <object_name> |
| 60 | +``` |
| 61 | + |
| 62 | +### Download the entire content of an object |
| 63 | + |
| 64 | +This snippet downloads the entire content of an object using a multi-range downloader. |
| 65 | + |
| 66 | +```bash |
| 67 | +python samples/snippets/zonal_buckets/storage_open_object_read_full_object.py --bucket_name <bucket_name> --object_name <object_name> |
| 68 | +``` |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +### Download a range of bytes from multiple objects concurrently |
| 73 | + |
| 74 | +This snippet downloads a range of bytes from multiple objects concurrently. |
| 75 | + |
| 76 | +```bash |
| 77 | +python samples/snippets/zonal_buckets/storage_open_multiple_objects_ranged_read.py --bucket_name <bucket_name> --object_names <object_name_1> <object_name_2> |
| 78 | +``` |
0 commit comments