Skip to content

Commit 26ce641

Browse files
authored
Add region tag to upload_blob snippet (GoogleCloudPlatform#1671)
1 parent 81f7f17 commit 26ce641

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

storage/cloud-client/snippets.py

+5
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525
import datetime
2626
import pprint
2727

28+
# [START storage_upload_file]
2829
from google.cloud import storage
2930

31+
# [END storage_upload_file]
32+
3033

3134
def create_bucket(bucket_name):
3235
"""Creates a new bucket."""
@@ -144,6 +147,7 @@ def list_blobs_with_prefix(bucket_name, prefix, delimiter=None):
144147
print(prefix)
145148

146149

150+
# [START storage_upload_file]
147151
def upload_blob(bucket_name, source_file_name, destination_blob_name):
148152
"""Uploads a file to the bucket."""
149153
storage_client = storage.Client()
@@ -155,6 +159,7 @@ def upload_blob(bucket_name, source_file_name, destination_blob_name):
155159
print('File {} uploaded to {}.'.format(
156160
source_file_name,
157161
destination_blob_name))
162+
# [END storage_upload_file]
158163

159164

160165
def upload_blob_with_kms(bucket_name, source_file_name, destination_blob_name,

0 commit comments

Comments
 (0)