diff --git a/storage/cloud-client/snippets.py b/storage/cloud-client/snippets.py index 89434bd859a..1b13379ae33 100644 --- a/storage/cloud-client/snippets.py +++ b/storage/cloud-client/snippets.py @@ -25,8 +25,11 @@ import datetime import pprint +# [START storage_upload_file] from google.cloud import storage +# [END storage_upload_file] + def create_bucket(bucket_name): """Creates a new bucket.""" @@ -144,6 +147,7 @@ def list_blobs_with_prefix(bucket_name, prefix, delimiter=None): print(prefix) +# [START storage_upload_file] def upload_blob(bucket_name, source_file_name, destination_blob_name): """Uploads a file to the bucket.""" storage_client = storage.Client() @@ -155,6 +159,7 @@ def upload_blob(bucket_name, source_file_name, destination_blob_name): print('File {} uploaded to {}.'.format( source_file_name, destination_blob_name)) +# [END storage_upload_file] def upload_blob_with_kms(bucket_name, source_file_name, destination_blob_name,