Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions google/cloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,7 @@ def upload_from_filename(
self,
filename,
content_type=None,
num_retries=None,
client=None,
predefined_acl=None,
if_generation_match=None,
Expand Down Expand Up @@ -2411,6 +2412,15 @@ def upload_from_filename(
(Optional) The client to use. If not passed, falls back to the
``client`` stored on the blob's bucket.

:type num_retries: int
:param num_retries:
Number of upload retries. By default, only uploads with
if_metageneration_match set will be retried, as uploads without the
argument are not guaranteed to be idempotent. Setting num_retries
will override this default behavior and guarantee retries even when
if_metageneration_match is not set. (Deprecated: This argument
will be removed in a future release.)

:type predefined_acl: str
:param predefined_acl: (Optional) Predefined access control list

Expand Down Expand Up @@ -2465,6 +2475,7 @@ def upload_from_filename(
self.upload_from_file(
file_obj,
content_type=content_type,
num_retries=num_retries,
client=client,
size=total_bytes,
predefined_acl=predefined_acl,
Expand All @@ -2480,6 +2491,7 @@ def upload_from_string(
self,
data,
content_type="text/plain",
num_retries=None,
client=None,
predefined_acl=None,
if_generation_match=None,
Expand Down Expand Up @@ -2515,6 +2527,15 @@ def upload_from_string(
(Optional) Type of content being uploaded. Defaults to
``'text/plain'``.

:type num_retries: int
:param num_retries:
Number of upload retries. By default, only uploads with
if_metageneration_match set will be retried, as uploads without the
argument are not guaranteed to be idempotent. Setting num_retries
will override this default behavior and guarantee retries even when
if_metageneration_match is not set. (Deprecated: This argument
will be removed in a future release.)

:type client: :class:`~google.cloud.storage.client.Client`
:param client:
(Optional) The client to use. If not passed, falls back to the
Expand Down Expand Up @@ -2573,6 +2594,7 @@ def upload_from_string(
file_obj=string_buffer,
size=len(data),
content_type=content_type,
num_retries=num_retries,
client=client,
predefined_acl=predefined_acl,
if_generation_match=if_generation_match,
Expand Down