@@ -384,29 +384,31 @@ def create_blob_from_path(
384384 The timeout parameter is expressed in seconds. This method may make
385385 multiple calls to the Azure service and the timeout will apply to
386386 each call individually.
387+ :return: ETag and last modified properties for the Block Blob
388+ :rtype: :class:`~azure.storage.blob.models.ResourceProperties`
387389 '''
388390 _validate_not_none ('container_name' , container_name )
389391 _validate_not_none ('blob_name' , blob_name )
390392 _validate_not_none ('file_path' , file_path )
391393
392394 count = path .getsize (file_path )
393395 with open (file_path , 'rb' ) as stream :
394- self .create_blob_from_stream (
395- container_name = container_name ,
396- blob_name = blob_name ,
397- stream = stream ,
398- count = count ,
399- content_settings = content_settings ,
400- metadata = metadata ,
401- validate_content = validate_content ,
402- lease_id = lease_id ,
403- progress_callback = progress_callback ,
404- max_connections = max_connections ,
405- if_modified_since = if_modified_since ,
406- if_unmodified_since = if_unmodified_since ,
407- if_match = if_match ,
408- if_none_match = if_none_match ,
409- timeout = timeout )
396+ return self .create_blob_from_stream (
397+ container_name = container_name ,
398+ blob_name = blob_name ,
399+ stream = stream ,
400+ count = count ,
401+ content_settings = content_settings ,
402+ metadata = metadata ,
403+ validate_content = validate_content ,
404+ lease_id = lease_id ,
405+ progress_callback = progress_callback ,
406+ max_connections = max_connections ,
407+ if_modified_since = if_modified_since ,
408+ if_unmodified_since = if_unmodified_since ,
409+ if_match = if_match ,
410+ if_none_match = if_none_match ,
411+ timeout = timeout )
410412
411413 def create_blob_from_stream (
412414 self , container_name , blob_name , stream , count = None ,
@@ -492,6 +494,8 @@ def create_blob_from_stream(
492494 with your input stream.
493495 The SubStream class will attempt to buffer up to 4 MB internally to reduce the amount of
494496 seek and read calls to the underlying stream. This is particularly beneficial when uploading larger blocks.
497+ :return: ETag and last modified properties for the Block Blob
498+ :rtype: :class:`~azure.storage.blob.models.ResourceProperties`
495499 '''
496500 _validate_not_none ('container_name' , container_name )
497501 _validate_not_none ('blob_name' , blob_name )
@@ -508,7 +512,7 @@ def create_blob_from_stream(
508512 progress_callback (0 , count )
509513
510514 data = stream .read (count )
511- self ._put_blob (
515+ resp = self ._put_blob (
512516 container_name = container_name ,
513517 blob_name = blob_name ,
514518 blob = data ,
@@ -524,6 +528,8 @@ def create_blob_from_stream(
524528
525529 if progress_callback :
526530 progress_callback (count , count )
531+
532+ return resp
527533 else :
528534 cek , iv , encryption_data = None , None , None
529535
@@ -568,7 +574,7 @@ def create_blob_from_stream(
568574 timeout = timeout ,
569575 )
570576
571- self ._put_block_list (
577+ return self ._put_block_list (
572578 container_name = container_name ,
573579 blob_name = blob_name ,
574580 block_list = block_ids ,
@@ -653,6 +659,8 @@ def create_blob_from_bytes(
653659 The timeout parameter is expressed in seconds. This method may make
654660 multiple calls to the Azure service and the timeout will apply to
655661 each call individually.
662+ :return: ETag and last modified properties for the Block Blob
663+ :rtype: :class:`~azure.storage.blob.models.ResourceProperties`
656664 '''
657665 _validate_not_none ('container_name' , container_name )
658666 _validate_not_none ('blob_name' , blob_name )
@@ -669,7 +677,7 @@ def create_blob_from_bytes(
669677 stream = BytesIO (blob )
670678 stream .seek (index )
671679
672- self .create_blob_from_stream (
680+ return self .create_blob_from_stream (
673681 container_name = container_name ,
674682 blob_name = blob_name ,
675683 stream = stream ,
@@ -753,6 +761,8 @@ def create_blob_from_text(
753761 The timeout parameter is expressed in seconds. This method may make
754762 multiple calls to the Azure service and the timeout will apply to
755763 each call individually.
764+ :return: ETag and last modified properties for the Block Blob
765+ :rtype: :class:`~azure.storage.blob.models.ResourceProperties`
756766 '''
757767 _validate_not_none ('container_name' , container_name )
758768 _validate_not_none ('blob_name' , blob_name )
@@ -762,23 +772,23 @@ def create_blob_from_text(
762772 _validate_not_none ('encoding' , encoding )
763773 text = text .encode (encoding )
764774
765- self .create_blob_from_bytes (
766- container_name = container_name ,
767- blob_name = blob_name ,
768- blob = text ,
769- index = 0 ,
770- count = len (text ),
771- content_settings = content_settings ,
772- metadata = metadata ,
773- validate_content = validate_content ,
774- lease_id = lease_id ,
775- progress_callback = progress_callback ,
776- max_connections = max_connections ,
777- if_modified_since = if_modified_since ,
778- if_unmodified_since = if_unmodified_since ,
779- if_match = if_match ,
780- if_none_match = if_none_match ,
781- timeout = timeout )
775+ return self .create_blob_from_bytes (
776+ container_name = container_name ,
777+ blob_name = blob_name ,
778+ blob = text ,
779+ index = 0 ,
780+ count = len (text ),
781+ content_settings = content_settings ,
782+ metadata = metadata ,
783+ validate_content = validate_content ,
784+ lease_id = lease_id ,
785+ progress_callback = progress_callback ,
786+ max_connections = max_connections ,
787+ if_modified_since = if_modified_since ,
788+ if_unmodified_since = if_unmodified_since ,
789+ if_match = if_match ,
790+ if_none_match = if_none_match ,
791+ timeout = timeout )
782792
783793 #-----Helper methods------------------------------------
784794 def _put_blob (self , container_name , blob_name , blob , content_settings = None ,
0 commit comments