Skip to content

Commit

Permalink
chore: Add region tags for Transfer Manager samples (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsg authored Aug 23, 2023
1 parent 6febcb1 commit 9a189da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# [START storage_transfer_manager_download_all_blobs]
def download_all_blobs_with_transfer_manager(
bucket_name, destination_directory="", processes=8
):
Expand Down Expand Up @@ -62,3 +62,4 @@ def download_all_blobs_with_transfer_manager(
print("Failed to download {} due to exception: {}".format(name, result))
else:
print("Downloaded {} to {}.".format(name, destination_directory + name))
# [END storage_transfer_manager_download_all_blobs]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# [START storage_transfer_manager_download_chunks_concurrently]
def download_chunks_concurrently(bucket_name, blob_name, filename, processes=8):
"""Download a single file in chunks, concurrently."""

Expand Down Expand Up @@ -40,3 +40,4 @@ def download_chunks_concurrently(bucket_name, blob_name, filename, processes=8):
transfer_manager.download_chunks_concurrently(blob, filename, max_workers=processes)

print("Downloaded {} to {}.".format(blob_name, filename))
# [END storage_transfer_manager_download_chunks_concurrently]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# [START storage_transfer_manager_upload_directory]
def upload_directory_with_transfer_manager(bucket_name, source_directory, processes=8):
"""Upload every file in a directory, including all files in subdirectories.
Expand Down Expand Up @@ -76,3 +76,4 @@ def upload_directory_with_transfer_manager(bucket_name, source_directory, proces
print("Failed to upload {} due to exception: {}".format(name, result))
else:
print("Uploaded {} to {}.".format(name, bucket.name))
# [END storage_transfer_manager_upload_directory]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# [START storage_transfer_manager_upload_many_blobs]
def upload_many_blobs_with_transfer_manager(
bucket_name, filenames, source_directory="", processes=8
):
Expand Down Expand Up @@ -63,3 +63,4 @@ def upload_many_blobs_with_transfer_manager(
print("Failed to upload {} due to exception: {}".format(name, result))
else:
print("Uploaded {} to {}.".format(name, bucket.name))
# [END storage_transfer_manager_upload_many_blobs]

0 comments on commit 9a189da

Please sign in to comment.