@@ -2367,6 +2367,7 @@ def upload_from_filename(
23672367 self ,
23682368 filename ,
23692369 content_type = None ,
2370+ num_retries = None ,
23702371 client = None ,
23712372 predefined_acl = None ,
23722373 if_generation_match = None ,
@@ -2411,6 +2412,15 @@ def upload_from_filename(
24112412 (Optional) The client to use. If not passed, falls back to the
24122413 ``client`` stored on the blob's bucket.
24132414
2415+ :type num_retries: int
2416+ :param num_retries:
2417+ Number of upload retries. By default, only uploads with
2418+ if_metageneration_match set will be retried, as uploads without the
2419+ argument are not guaranteed to be idempotent. Setting num_retries
2420+ will override this default behavior and guarantee retries even when
2421+ if_metageneration_match is not set. (Deprecated: This argument
2422+ will be removed in a future release.)
2423+
24142424 :type predefined_acl: str
24152425 :param predefined_acl: (Optional) Predefined access control list
24162426
@@ -2465,6 +2475,7 @@ def upload_from_filename(
24652475 self .upload_from_file (
24662476 file_obj ,
24672477 content_type = content_type ,
2478+ num_retries = num_retries ,
24682479 client = client ,
24692480 size = total_bytes ,
24702481 predefined_acl = predefined_acl ,
@@ -2480,6 +2491,7 @@ def upload_from_string(
24802491 self ,
24812492 data ,
24822493 content_type = "text/plain" ,
2494+ num_retries = None ,
24832495 client = None ,
24842496 predefined_acl = None ,
24852497 if_generation_match = None ,
@@ -2515,6 +2527,15 @@ def upload_from_string(
25152527 (Optional) Type of content being uploaded. Defaults to
25162528 ``'text/plain'``.
25172529
2530+ :type num_retries: int
2531+ :param num_retries:
2532+ Number of upload retries. By default, only uploads with
2533+ if_metageneration_match set will be retried, as uploads without the
2534+ argument are not guaranteed to be idempotent. Setting num_retries
2535+ will override this default behavior and guarantee retries even when
2536+ if_metageneration_match is not set. (Deprecated: This argument
2537+ will be removed in a future release.)
2538+
25182539 :type client: :class:`~google.cloud.storage.client.Client`
25192540 :param client:
25202541 (Optional) The client to use. If not passed, falls back to the
@@ -2573,6 +2594,7 @@ def upload_from_string(
25732594 file_obj = string_buffer ,
25742595 size = len (data ),
25752596 content_type = content_type ,
2597+ num_retries = num_retries ,
25762598 client = client ,
25772599 predefined_acl = predefined_acl ,
25782600 if_generation_match = if_generation_match ,
0 commit comments