From a2d47dc6adea83ba3f4aedd67e05e804b518da11 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Sat, 12 Oct 2019 16:43:36 -0700 Subject: [PATCH 1/2] Change the directive to keyword in docstrings --- .../storage/blob/aio/blob_client_async.py | 420 ++++++++--------- .../blob/aio/blob_service_client_async.py | 22 +- .../blob/aio/container_client_async.py | 126 +++-- .../azure/storage/blob/aio/download_async.py | 4 +- .../azure/storage/blob/aio/lease_async.py | 46 +- .../azure/storage/blob/blob_client.py | 434 +++++++++--------- .../azure/storage/blob/blob_service_client.py | 26 +- .../azure/storage/blob/container_client.py | 158 +++---- .../azure/storage/blob/download.py | 4 +- .../azure/storage/blob/lease.py | 46 +- 10 files changed, 641 insertions(+), 645 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_client_async.py index 29278a4bf59f..19b21ca7b85c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_client_async.py @@ -155,9 +155,9 @@ async def upload_blob( :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param ~azure.storage.blob.ContentSettings content_settings: + :keyword ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -166,55 +166,55 @@ async def upload_blob( blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param ~azure.storage.blob.aio.lease_async.LeaseClient lease: + :keyword ~azure.storage.blob.aio.lease_async.LeaseClient lease: If specified, upload_blob only succeeds if the blob's lease is active and matches this ID. Required if the blob has an active lease. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int max_concurrency: + :keyword int max_concurrency: Maximum number of parallel connections to use when the blob size exceeds 64MB. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. @@ -253,7 +253,7 @@ async def download_blob(self, offset=None, length=None, **kwargs): :param int length: Number of bytes to read from the stream. This is optional, but should be supplied for optimal performance. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -262,37 +262,37 @@ async def download_blob(self, offset=None, length=None, **kwargs): blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param lease: + :keyword lease: If specified, download_blob only succeeds if the blob's lease is active and matches this ID. Required if the blob has an active lease. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. @@ -340,32 +340,32 @@ async def delete_blob(self, delete_snapshots=False, **kwargs): Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -392,7 +392,7 @@ async def undelete_blob(self, **kwargs): Operation will only be successful if used within the specified number of days set in the delete retention policy. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -416,37 +416,37 @@ async def get_blob_properties(self, **kwargs): """Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: BlobProperties :rtype: ~azure.storage.blob.BlobProperties @@ -497,32 +497,32 @@ async def set_http_headers(self, content_settings=None, **kwargs): :param ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified) :rtype: Dict[str, Any] @@ -543,37 +543,37 @@ async def set_blob_metadata(self, metadata=None, **kwargs): replaces all existing metadata attached to the blob. To remove all metadata from the blob, call this operation with no metadata headers. :type metadata: dict(str, str) - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified) """ @@ -606,43 +606,43 @@ async def create_page_blob( # type: ignore and 2^63 - 1.The default value is 0. :param metadata: Name-value pairs associated with the blob as metadata. + :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + A page blob tier value to set the blob to. The tier correlates to the size of the + blob and number of allowed IOPS. This is only applicable to page blobs on + premium storage accounts. :type metadata: dict(str, str) - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: - A page blob tier value to set the blob to. The tier correlates to the size of the - blob and number of allowed IOPS. This is only applicable to page blobs on - premium storage accounts. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict[str, Any] """ @@ -667,37 +667,37 @@ async def create_append_blob(self, content_settings=None, metadata=None, **kwarg :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict[str, Any] @@ -727,37 +727,37 @@ async def create_snapshot(self, metadata=None, **kwargs): :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Snapshot ID, Etag, and last modified). :rtype: dict[str, Any] @@ -830,31 +830,37 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. :type metadata: dict(str, str) - :param ~datetime.datetime source_if_modified_since: + :param bool incremental_copy: + Copies the snapshot of the source page blob to a destination page blob. + The snapshot is copied such that only the differential changes between + the previously copied snapshot are transferred to the destination. + The copied snapshots are complete copies of the original snapshot and + can be read or copied from as usual. Defaults to False. + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this conditional header to copy the blob only if the source blob has been modified since the specified date/time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this conditional header to copy the blob only if the source blob has not been modified since the specified date/time. - :param str source_if_match: + :keyword str source_if_match: An ETag value, or the wildcard character (*). Specify this conditional header to copy the source blob only if its ETag matches the value specified. If the ETag values do not match, the Blob service returns status code 412 (Precondition Failed). This header cannot be specified if the source is an Azure File. - :param str source_if_none_match: + :keyword str source_if_none_match: An ETag value, or the wildcard character (*). Specify this conditional header to copy the blob only if its ETag does not match the value specified. If the values are identical, the Blob service returns status code 412 (Precondition Failed). This header cannot be specified if the source is an Azure File. - :param ~datetime.datetime destination_if_modified_since: + :keyword ~datetime.datetime destination_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -862,7 +868,7 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= if the destination blob has been modified since the specified date/time. If the destination blob has not been modified, the Blob service returns status code 412 (Precondition Failed). - :param ~datetime.datetime destination_if_unmodified_since: + :keyword ~datetime.datetime destination_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -870,46 +876,40 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= if the destination blob has not been modified since the specified date/time. If the destination blob has been modified, the Blob service returns status code 412 (Precondition Failed). - :param str destination_if_match: + :keyword str destination_if_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to copy the blob only if the specified ETag value matches the ETag value for an existing destination blob. If the ETag for the destination blob does not match the ETag specified for If-Match, the Blob service returns status code 412 (Precondition Failed). - :param str destination_if_none_match: + :keyword str destination_if_none_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to copy the blob only if the specified ETag value does not match the ETag value for the destination blob. Specify the wildcard character (*) to perform the operation only if the destination blob does not exist. If the specified condition isn't met, the Blob service returns status code 412 (Precondition Failed). - :param destination_lease: + :keyword destination_lease: The lease ID specified for this header must match the lease ID of the destination blob. If the request does not include the lease ID or it is not valid, the operation fails with status code 412 (Precondition Failed). :type destination_lease: ~azure.storage.blob.aio.lease_async..LeaseClient or str - :param source_lease: + :keyword source_lease: Specify this to perform the Copy Blob operation only if the lease ID given matches the active lease ID of the source blob. :type source_lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param bool incremental_copy: - Copies the snapshot of the source page blob to a destination page blob. - The snapshot is copied such that only the differential changes between - the previously copied snapshot are transferred to the destination. - The copied snapshots are complete copies of the original snapshot and - can be read or copied from as usual. Defaults to False. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param ~azure.storage.blob.RehydratePriority rehydrate_priority: + :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :param bool requires_sync: + :keyword bool requires_sync: Enforces that the service will not return a response until the copy is complete. :returns: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). :rtype: Dict[str, Union[str, datetime]] @@ -981,28 +981,28 @@ async def acquire_lease(self, lease_duration=-1, lease_id=None, **kwargs): Proposed lease ID, in a GUID string format. The Blob Service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A LeaseClient object. :rtype: ~azure.storage.blob.aio.lease_async.LeaseClient @@ -1036,11 +1036,11 @@ async def set_standard_blob_tier(self, standard_blob_tier, **kwargs): tier is optimized for storing data that is rarely accessed and stored for at least six months with flexible latency requirements. :type standard_blob_tier: str or ~azure.storage.blob.StandardBlobTier - :param ~azure.storage.blob.RehydratePriority rehydrate_priority: + :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str @@ -1074,7 +1074,7 @@ async def stage_block( the block_id parameter must be the same size for each block. :param data: The blob data. :param int length: Size of the block. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -1083,18 +1083,18 @@ async def stage_block( blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -1133,16 +1133,16 @@ async def stage_block_from_url( :param bytearray source_content_md5: Specify the md5 calculated for the range of bytes that must be read from the copy source. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -1168,11 +1168,11 @@ async def get_block_list(self, block_list_type="committed", **kwargs): Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. Possible values include: 'committed', 'uncommitted', 'all' - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A tuple of two lists - committed and uncommitted blocks :rtype: tuple(list(~azure.storage.blob.BlobBlock), list(~azure.storage.blob.BlobBlock)) @@ -1202,52 +1202,52 @@ async def commit_block_list( # type: ignore :param list block_list: List of Blockblobs. - :param lease: - Required if the blob has an active lease. Value can be a LeaseClient object - or the lease ID as a string. - :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str :param ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict[str, str] - :param bool validate_content: + :keyword lease: + Required if the blob has an active lease. Value can be a LeaseClient object + or the lease ID as a string. + :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str + :keyword bool validate_content: If true, calculates an MD5 hash of the page content. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the blob. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -1272,11 +1272,11 @@ async def set_premium_page_blob_tier(self, premium_page_blob_tier, **kwargs): blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str @@ -1317,37 +1317,37 @@ async def get_page_ranges( # type: ignore Pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512 and the length must be a modulus of 512. - :param lease: - Required if the blob has an active lease. Value can be a LeaseClient object - or the lease ID as a string. - :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str :param str previous_snapshot_diff: The snapshot diff parameter that contains an opaque DateTime value that specifies a previous blob snapshot to be compared against a more recent snapshot or the current blob. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. + :keyword lease: + Required if the blob has an active lease. Value can be a LeaseClient object + or the lease ID as a string. + :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str :returns: A tuple of two lists of page ranges as dictionaries with 'start' and 'end' keys. The first element are filled page ranges, the 2nd element is cleared page ranges. @@ -1383,32 +1383,32 @@ async def set_sequence_number( # type: ignore This property sets the blob's sequence number. The sequence number is a user-controlled property that you can use to track requests and manage concurrency issues. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -1430,36 +1430,36 @@ async def resize_blob(self, size, **kwargs): :param int size: Size to resize blob to. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -1493,55 +1493,55 @@ async def upload_page( # type: ignore Pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512 and the length must be a modulus of 512. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash of the page content. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the blob. - :param int if_sequence_number_lte: + :keyword int if_sequence_number_lte: If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_lt: + :keyword int if_sequence_number_lt: If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_eq: + :keyword int if_sequence_number_eq: If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value matches the value specified. If the values do not match, the Blob service fails. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value does not match the value specified. If the values are identical, the Blob service fails. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -1581,67 +1581,67 @@ async def upload_pages_from_url(self, source_url, # type: str :param int source_offset: This indicates the start of the range of bytes(inclusive) that has to be taken from the copy source. The service will read the same number of bytes as the destination range (length-offset). - :param bytes source_content_md5: + :keyword bytes source_content_md5: If given, the service will calculate the MD5 hash of the block content and compare against this value. - :param ~datetime.datetime source_if_modified_since: + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has been modified since the specified time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has not been modified since the specified date/time. - :param str source_if_match: + :keyword str source_if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag matches the value specified. - :param str source_if_none_match: + :keyword str source_if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the source resource does not exist, and fail the operation if it does exist. - :param str lease: + :keyword str lease: Required if the blob has an active lease. - :param int if_sequence_number_lte: + :keyword int if_sequence_number_lte: If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_lt: + :keyword int if_sequence_number_lt: If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_eq: + :keyword int if_sequence_number_eq: If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. """ @@ -1672,45 +1672,45 @@ async def clear_page(self, offset, length, **kwargs): Pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512 and the length must be a modulus of 512. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param int if_sequence_number_lte: + :keyword int if_sequence_number_lte: If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_lt: + :keyword int if_sequence_number_lt: If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_eq: + :keyword int if_sequence_number_eq: If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value matches the value specified. If the values do not match, the Blob service fails. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value does not match the value specified. If the values are identical, the Blob service fails. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -1734,58 +1734,58 @@ async def append_block( # type: ignore Content of the block. :param int length: Size of the block in bytes. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash of the block content. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the blob. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int appendpos_condition: + :keyword int appendpos_condition: Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.lease_async.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag, last modified, append offset, committed block count). :rtype: dict(str, Any) @@ -1818,71 +1818,71 @@ async def append_block_from_url(self, copy_source_url, # type: str This indicates the end of the range of bytes that has to be taken from the copy source. :param bytearray source_content_md5: If given, the service will calculate the MD5 hash of the block content and compare against this value. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int appendpos_condition: + :keyword int appendpos_condition: Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param ~azure.storage.blob.lease.LeaseClient or str lease: + :keyword ~azure.storage.blob.lease.LeaseClient or str lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~datetime.datetime source_if_modified_since: + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has been modified since the specified time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has not been modified since the specified date/time. - :param str source_if_match: + :keyword str source_if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag matches the value specified. - :param str source_if_none_match: + :keyword str source_if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the source resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. """ options = self._append_block_from_url_options( diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py index 88dead19921c..53e6488fe371 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py @@ -125,7 +125,7 @@ async def get_user_delegation_key(self, key_start_time, # type: datetime A DateTime value. Indicates when the key becomes valid. :param ~datetime.datetime key_expiry_time: A DateTime value. Indicates when the key stops being valid. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: The user delegation key. :rtype: ~azure.storage.blob.UserDelegationKey @@ -187,7 +187,7 @@ async def get_service_stats(self, **kwargs): # type: ignore access is available from the secondary location, if read-access geo-redundant replication is enabled for your storage account. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: The blob service stats. :rtype: ~azure.storage.blob._generated.models.StorageServiceStats @@ -214,7 +214,7 @@ async def get_service_properties(self, **kwargs): """Gets the properties of a storage account's Blob service, including Azure Storage Analytics. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob._generated.models.StorageServiceProperties @@ -278,7 +278,7 @@ async def set_service_properties( Specifies whether the static website feature is enabled, and if yes, indicates the index document and 404 error document to use. :type static_website: ~azure.storage.blob.StaticWebsite - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -327,7 +327,7 @@ def list_containers( :param int results_per_page: The maximum number of container names to retrieve per API call. If the request does not specify the server will return up to 5,000 items. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) of ContainerProperties. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.storage.blob.ContainerProperties] @@ -379,7 +379,7 @@ async def create_container( :param public_access: Possible values include: container, blob. :type public_access: str or ~azure.storage.blob.PublicAccess - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob.aio.ContainerClient @@ -419,28 +419,28 @@ async def delete_container( If specified, delete_container only succeeds if the container's lease is active and matches this ID. Required if the container has an active lease. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py index 9c8a31e44d19..44da9fc6fa27 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py @@ -130,7 +130,7 @@ async def create_container(self, metadata=None, public_access=None, **kwargs): :type metadata: dict[str, str] :param ~azure.storage.blob.PublicAccess public_access: Possible values include: container, blob. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -164,32 +164,32 @@ async def delete_container( Marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection. - :param ~azure.storage.blob.aio.LeaseClient lease: + :keyword ~azure.storage.blob.aio.LeaseClient lease: If specified, delete_container only succeeds if the container's lease is active and matches this ID. Required if the container has an active lease. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -238,28 +238,28 @@ async def acquire_lease( :param str lease_id: Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A LeaseClient object, that can be run in a context manager. :rtype: ~azure.storage.blob.aio.LeaseClient @@ -301,10 +301,10 @@ async def get_container_properties(self, **kwargs): """Returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs. - :param ~azure.storage.blob.aio.LeaseClient lease: + :keyword ~azure.storage.blob.aio.LeaseClient lease: If specified, get_container_properties only succeeds if the container's lease is active and matches this ID. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: Properties for the specified container within a container object. :rtype: ~azure.storage.blob.ContainerProperties @@ -347,16 +347,16 @@ async def set_container_metadata( # type: ignore A dict containing name-value pairs to associate with the container as metadata. Example: {'category':'test'} :type metadata: dict[str, str] - :param str lease: + :keyword str lease: If specified, set_container_metadata only succeeds if the container's lease is active and matches this ID. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Container-updated property dict (Etag and last modified). @@ -392,10 +392,10 @@ async def get_container_access_policy(self, **kwargs): """Gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly. - :param str lease: + :keyword str lease: If specified, get_container_access_policy only succeeds if the container's lease is active and matches this ID. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Access policy information in a dict. :rtype: dict[str, str] @@ -442,23 +442,23 @@ async def set_container_access_policy( :type signed_identifiers: dict[str, ~azure.storage.blob.AccessPolicy] :param ~azure.storage.blob.PublicAccess public_access: Possible values include: container, blob. - :param lease: + :keyword lease: Required if the container has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A datetime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified date/time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A datetime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Container-updated property dict (Etag and last modified). @@ -515,7 +515,7 @@ def list_blobs(self, name_starts_with=None, include=None, **kwargs): :param list[str] include: Specifies one or more additional datasets to include in the response. Options include: 'snapshots', 'metadata', 'uncommittedblobs', 'copy', 'deleted'. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) response of BlobProperties. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.storage.blob.BlobProperties] @@ -570,7 +570,7 @@ def walk_blobs( element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) response of BlobProperties. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.storage.blob.BlobProperties] @@ -599,7 +599,6 @@ async def upload_blob( blob_type=BlobType.BlockBlob, # type: Union[str, BlobType] length=None, # type: Optional[int] metadata=None, # type: Optional[Dict[str, str]] - encoding='UTF-8', # type: str **kwargs ): # type: (...) -> BlobClient @@ -610,21 +609,21 @@ async def upload_blob( :type name: str or ~azure.storage.blob.BlobProperties :param ~azure.storage.blob.BlobType blob_type: The type of the blob. This can be either BlockBlob, PageBlob or AppendBlob. The default value is BlockBlob. - :param bool overwrite: Whether the blob to be uploaded should overwrite the current data. - If True, upload_blob will silently overwrite the existing data. If set to False, the - operation will fail with ResourceExistsError. The exception to the above is with Append - blob types. In this case, if data already exists, an error will not be raised and - the data will be appended to the existing blob. If you set overwrite=True, then the existing - blob will be deleted, and a new one created. :param int length: Number of bytes to read from the stream. This is optional, but should be supplied for optimal performance. :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param ~azure.storage.blob.ContentSettings content_settings: + :keyword bool overwrite: Whether the blob to be uploaded should overwrite the current data. + If True, upload_blob will silently overwrite the existing data. If set to False, the + operation will fail with ResourceExistsError. The exception to the above is with Append + blob types. In this case, if data already exists, an error will not be raised and + the data will be appended to the existing blob. If you set overwrite=True, then the existing + blob will be deleted, and a new one created. + :keyword ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -633,57 +632,57 @@ async def upload_blob( blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param lease: + :keyword lease: Required if the container has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int max_concurrency: + :keyword int max_concurrency: Maximum number of parallel connections to use when the blob size exceeds 64MB. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param str encoding: + :keyword str encoding: Defaults to UTF-8. :returns: A BlobClient to interact with the newly uploaded blob. :rtype: ~azure.storage.blob.aio.BlobClient @@ -700,6 +699,7 @@ async def upload_blob( blob = self.get_blob_client(name) kwargs.setdefault('merge_span', True) timeout = kwargs.pop('timeout', None) + encoding=kwargs.pop('encoding', 'UTF-8') await blob.upload_blob( data, blob_type=blob_type, @@ -738,36 +738,32 @@ async def delete_blob( Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a Lease object or the lease ID as a string. :type lease: ~azure.storage.blob.aio.LeaseClient or str - :param str delete_snapshots: - Required if the blob has associated snapshots. Values include: - - "only": Deletes only the blobs snapshots. - - "include": Deletes the blob along with all snapshots. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -814,28 +810,28 @@ async def delete_blobs( # pylint: disable=arguments-differ Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: An async iterator of responses, one for each blob in order :rtype: asynciterator[~azure.core.pipeline.transport.AsyncHttpResponse] @@ -887,9 +883,9 @@ async def set_standard_blob_tier_blobs( tier is optimized for storing data that is rarely accessed and stored for at least six months with flexible latency requirements. :type standard_blob_tier: str or ~azure.storage.blob.StandardBlobTier - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.lease.LeaseClient or str @@ -938,11 +934,11 @@ async def set_premium_page_blob_tier_blobs( blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.lease.LeaseClient or str diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/download_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/download_async.py index 6efe419d7893..d9025f59367e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/download_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/download_async.py @@ -365,7 +365,7 @@ async def content_as_bytes(self, max_concurrency=1): This operation is blocking until all data is downloaded. - :param int max_concurrency: + :keyword int max_concurrency: The number of parallel connections with which to download. :rtype: bytes """ @@ -378,7 +378,7 @@ async def content_as_text(self, max_concurrency=1, encoding='UTF-8'): This operation is blocking until all data is downloaded. - :param int max_concurrency: + :keyword int max_concurrency: The number of parallel connections with which to download. :rtype: str """ diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/lease_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/lease_async.py index 48fe300c1ab8..bfca10c9ec33 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/lease_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/lease_async.py @@ -74,28 +74,28 @@ async def acquire(self, lease_duration=-1, **kwargs): (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change. Default is -1 (infinite lease). - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -129,28 +129,28 @@ async def renew(self, **kwargs): or blob has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -181,28 +181,28 @@ async def release(self, **kwargs): that associated with the container or blob. Releasing the lease allows another client to immediately acquire the lease for the container or blob as soon as the release is complete. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -232,28 +232,28 @@ async def change(self, proposed_lease_id, **kwargs): :param str proposed_lease_id: Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -298,19 +298,19 @@ async def break_lease(self, lease_break_period=None, **kwargs): period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: Approximate time remaining in the lease period, in seconds. :rtype: int diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/blob_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/blob_client.py index 76c99cb6c563..d72fc82cd0e9 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/blob_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/blob_client.py @@ -310,30 +310,30 @@ def generate_shared_access_signature( or address range specified on the SAS token, the request is not authenticated. For example, specifying ip=168.1.5.65 or ip=168.1.5.60-168.1.5.70 on the SAS restricts the request to those IP addresses. - :param str protocol: + :param ~azure.storage.blob.UserDelegationKey user_delegation_key: + Instead of an account key, the user could pass in a user delegation key. + A user delegation key can be obtained from the service by authenticating with an AAD identity; + this can be accomplished by calling get_user_delegation_key. + When present, the SAS is signed with the user delegation key instead. + :keyword str protocol: Specifies the protocol permitted for a request made. The default value is https. - :param str account_name: + :keyword str account_name: Specifies the account_name when using oauth token as credential. If you use oauth token as credential. - :param str cache_control: + :keyword str cache_control: Response header value for Cache-Control when resource is accessed using this shared access signature. - :param str content_disposition: + :keyword str content_disposition: Response header value for Content-Disposition when resource is accessed using this shared access signature. - :param str content_encoding: + :keyword str content_encoding: Response header value for Content-Encoding when resource is accessed using this shared access signature. - :param str content_language: + :keyword str content_language: Response header value for Content-Language when resource is accessed using this shared access signature. - :param str content_type: + :keyword str content_type: Response header value for Content-Type when resource is accessed using this shared access signature. - :param ~azure.storage.blob.UserDelegationKey user_delegation_key: - Instead of an account key, the user could pass in a user delegation key. - A user delegation key can be obtained from the service by authenticating with an AAD identity; - this can be accomplished by calling get_user_delegation_key. - When present, the SAS is signed with the user delegation key instead. :return: A Shared Access Signature (sas) token. :rtype: str """ @@ -491,21 +491,21 @@ def upload_blob( # pylint: disable=too-many-locals :param data: The blob data to upload. :param ~azure.storage.blob.BlobType blob_type: The type of the blob. This can be either BlockBlob, PageBlob or AppendBlob. The default value is BlockBlob. - :param bool overwrite: Whether the blob to be uploaded should overwrite the current data. - If True, upload_blob will silently overwrite the existing data. If set to False, the - operation will fail with ResourceExistsError. The exception to the above is with Append - blob types. In this case, if data already exists, an error will not be raised and - the data will be appended to the existing blob. If you set overwrite=True, then the existing - blob will be deleted, and a new one created. :param int length: Number of bytes to read from the stream. This is optional, but should be supplied for optimal performance. :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param ~azure.storage.blob.ContentSettings content_settings: + :keyword bool overwrite: Whether the blob to be uploaded should overwrite the current data. + If True, upload_blob will silently overwrite the existing data. If set to False, the + operation will fail with ResourceExistsError. The exception to the above is with Append + blob types. In this case, if data already exists, an error will not be raised and + the data will be appended to the existing blob. If you set overwrite=True, then the existing + blob will be deleted, and a new one created. + :keyword ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -514,55 +514,55 @@ def upload_blob( # pylint: disable=too-many-locals blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param ~azure.storage.blob.LeaseClient lease: + :keyword ~azure.storage.blob.LeaseClient lease: If specified, upload_blob only succeeds if the blob's lease is active and matches this ID. Required if the blob has an active lease. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int max_concurrency: + :keyword int max_concurrency: Maximum number of parallel connections to use when the blob size exceeds 64MB. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. @@ -644,7 +644,7 @@ def download_blob(self, offset=None, length=None, **kwargs): :param int length: Number of bytes to read from the stream. This is optional, but should be supplied for optimal performance. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -653,37 +653,37 @@ def download_blob(self, offset=None, length=None, **kwargs): blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param lease: + :keyword lease: If specified, download_blob only succeeds if the blob's lease is active and matches this ID. Required if the blob has an active lease. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. @@ -756,32 +756,32 @@ def delete_blob(self, delete_snapshots=False, **kwargs): Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -808,7 +808,7 @@ def undelete_blob(self, **kwargs): Operation will only be successful if used within the specified number of days set in the delete retention policy. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -832,37 +832,37 @@ def get_blob_properties(self, **kwargs): """Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob.BlobProperties @@ -940,32 +940,32 @@ def set_http_headers(self, content_settings=None, **kwargs): :param ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified) :rtype: Dict[str, Any] @@ -1014,37 +1014,37 @@ def set_blob_metadata(self, metadata=None, **kwargs): replaces all existing metadata attached to the blob. To remove all metadata from the blob, call this operation with no metadata headers. :type metadata: dict(str, str) - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified) """ @@ -1128,49 +1128,49 @@ def create_page_blob( # type: ignore to a 512-byte boundary. :param ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set properties on the blob. - :param int sequence_number: - Only for Page blobs. The sequence number is a user-controlled value that you can use to - track requests. The value of the sequence number must be between 0 - and 2^63 - 1.The default value is 0. :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param lease: + :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + A page blob tier value to set the blob to. The tier correlates to the size of the + blob and number of allowed IOPS. This is only applicable to page blobs on + premium storage accounts. + :keyword int sequence_number: + Only for Page blobs. The sequence number is a user-controlled value that you can use to + track requests. The value of the sequence number must be between 0 + and 2^63 - 1.The default value is 0. + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: - A page blob tier value to set the blob to. The tier correlates to the size of the - blob and number of allowed IOPS. This is only applicable to page blobs on - premium storage accounts. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict[str, Any] """ @@ -1238,37 +1238,37 @@ def create_append_blob(self, content_settings=None, metadata=None, **kwargs): :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict[str, Any] @@ -1327,37 +1327,37 @@ def create_snapshot(self, metadata=None, **kwargs): :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Snapshot ID, Etag, and last modified). :rtype: dict[str, Any] @@ -1472,31 +1472,37 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. :type metadata: dict(str, str) - :param ~datetime.datetime source_if_modified_since: + :param bool incremental_copy: + Copies the snapshot of the source page blob to a destination page blob. + The snapshot is copied such that only the differential changes between + the previously copied snapshot are transferred to the destination. + The copied snapshots are complete copies of the original snapshot and + can be read or copied from as usual. Defaults to False. + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this conditional header to copy the blob only if the source blob has been modified since the specified date/time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this conditional header to copy the blob only if the source blob has not been modified since the specified date/time. - :param str source_if_match: + :keyword str source_if_match: An ETag value, or the wildcard character (*). Specify this conditional header to copy the source blob only if its ETag matches the value specified. If the ETag values do not match, the Blob service returns status code 412 (Precondition Failed). This header cannot be specified if the source is an Azure File. - :param str source_if_none_match: + :keyword str source_if_none_match: An ETag value, or the wildcard character (*). Specify this conditional header to copy the blob only if its ETag does not match the value specified. If the values are identical, the Blob service returns status code 412 (Precondition Failed). This header cannot be specified if the source is an Azure File. - :param ~datetime.datetime destination_if_modified_since: + :keyword ~datetime.datetime destination_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -1504,7 +1510,7 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, if the destination blob has been modified since the specified date/time. If the destination blob has not been modified, the Blob service returns status code 412 (Precondition Failed). - :param ~datetime.datetime destination_if_unmodified_since: + :keyword ~datetime.datetime destination_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -1512,46 +1518,40 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, if the destination blob has not been modified since the specified date/time. If the destination blob has been modified, the Blob service returns status code 412 (Precondition Failed). - :param str destination_if_match: + :keyword str destination_if_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to copy the blob only if the specified ETag value matches the ETag value for an existing destination blob. If the ETag for the destination blob does not match the ETag specified for If-Match, the Blob service returns status code 412 (Precondition Failed). - :param str destination_if_none_match: + :keyword str destination_if_none_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to copy the blob only if the specified ETag value does not match the ETag value for the destination blob. Specify the wildcard character (*) to perform the operation only if the destination blob does not exist. If the specified condition isn't met, the Blob service returns status code 412 (Precondition Failed). - :param destination_lease: + :keyword destination_lease: The lease ID specified for this header must match the lease ID of the destination blob. If the request does not include the lease ID or it is not valid, the operation fails with status code 412 (Precondition Failed). :type destination_lease: ~azure.storage.blob.LeaseClient or str - :param source_lease: + :keyword source_lease: Specify this to perform the Copy Blob operation only if the lease ID given matches the active lease ID of the source blob. :type source_lease: ~azure.storage.blob.LeaseClient or str - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param bool incremental_copy: - Copies the snapshot of the source page blob to a destination page blob. - The snapshot is copied such that only the differential changes between - the previously copied snapshot are transferred to the destination. - The copied snapshots are complete copies of the original snapshot and - can be read or copied from as usual. Defaults to False. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param ~azure.storage.blob.RehydratePriority rehydrate_priority: + :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :param bool requires_sync: + :keyword bool requires_sync: Enforces that the service will not return a response until the copy is complete. :returns: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). :rtype: dict[str, str or ~datetime.datetime] @@ -1640,28 +1640,28 @@ def acquire_lease(self, lease_duration=-1, lease_id=None, **kwargs): Proposed lease ID, in a GUID string format. The Blob Service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A LeaseClient object. :rtype: ~azure.storage.blob.LeaseClient @@ -1695,11 +1695,11 @@ def set_standard_blob_tier(self, standard_blob_tier, **kwargs): tier is optimized for storing data that is rarely accessed and stored for at least six months with flexible latency requirements. :type standard_blob_tier: str or ~azure.storage.blob.StandardBlobTier - :param ~azure.storage.blob.RehydratePriority rehydrate_priority: + :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str @@ -1775,7 +1775,7 @@ def stage_block( the block_id parameter must be the same size for each block. :param data: The blob data. :param int length: Size of the block. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -1784,18 +1784,18 @@ def stage_block( blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -1874,16 +1874,16 @@ def stage_block_from_url( :param bytearray source_content_md5: Specify the md5 calculated for the range of bytes that must be read from the copy source. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -1919,11 +1919,11 @@ def get_block_list(self, block_list_type="committed", **kwargs): Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. Possible values include: 'committed', 'uncommitted', 'all' - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A tuple of two lists - committed and uncommitted blocks :rtype: tuple(list(~azure.storage.blob.BlobBlock), list(~azure.storage.blob.BlobBlock)) @@ -2017,7 +2017,7 @@ def commit_block_list( # type: ignore :param list block_list: List of Blockblobs. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str @@ -2026,29 +2026,29 @@ def commit_block_list( # type: ignore :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict[str, str] - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash of the page content. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the blob. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform @@ -2062,7 +2062,7 @@ def commit_block_list( # type: ignore Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -2087,7 +2087,7 @@ def set_premium_page_blob_tier(self, premium_page_blob_tier, **kwargs): blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. @@ -2177,28 +2177,28 @@ def get_page_ranges( # type: ignore The snapshot diff parameter that contains an opaque DateTime value that specifies a previous blob snapshot to be compared against a more recent snapshot or the current blob. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A tuple of two lists of page ranges as dictionaries with 'start' and 'end' keys. @@ -2255,28 +2255,28 @@ def set_sequence_number(self, sequence_number_action, sequence_number=None, **kw Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -2330,32 +2330,32 @@ def resize_blob(self, size, **kwargs): Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -2441,43 +2441,43 @@ def upload_page( # type: ignore Pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512 and the end offset must be a modulus of 512. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash of the page content. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the blob. - :param int if_sequence_number_lte: + :keyword int if_sequence_number_lte: If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_lt: + :keyword int if_sequence_number_lt: If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_eq: + :keyword int if_sequence_number_eq: If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value matches the value specified. If the values do not match, the Blob service fails. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value does not match the value specified. If the values are identical, the Blob @@ -2489,7 +2489,7 @@ def upload_page( # type: ignore a secure connection must be established to transfer the key. :param str encoding: Defaults to UTF-8. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -2599,22 +2599,22 @@ def upload_pages_from_url(self, source_url, # type: str The service will read the same number of bytes as the destination range (length-offset). :param bytes source_content_md5: If given, the service will calculate the MD5 hash of the block content and compare against this value. - :param ~datetime.datetime source_if_modified_since: + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has been modified since the specified time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has not been modified since the specified date/time. - :param str source_if_match: + :keyword str source_if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag matches the value specified. - :param str source_if_none_match: + :keyword str source_if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag does not match the value specified. Specify the wildcard character (*) to perform @@ -2622,42 +2622,42 @@ def upload_pages_from_url(self, source_url, # type: str operation if it does exist. :param str lease: Required if the blob has an active lease. - :param int if_sequence_number_lte: + :keyword int if_sequence_number_lte: If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_lt: + :keyword int if_sequence_number_lt: If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_eq: + :keyword int if_sequence_number_eq: If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. """ @@ -2731,46 +2731,46 @@ def clear_page(self, offset, length, **kwargs): Pages must be aligned with 512-byte boundaries, the start offset must be a modulus of 512 and the end offset must be a modulus of 512. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param int if_sequence_number_lte: + :keyword int if_sequence_number_lte: If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_lt: + :keyword int if_sequence_number_lt: If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails. - :param int if_sequence_number_eq: + :keyword int if_sequence_number_eq: If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value matches the value specified. If the values do not match, the Blob service fails. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify an ETag value for this conditional header to write the page only if the blob's ETag value does not match the value specified. If the values are identical, the Blob service fails. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -2851,58 +2851,58 @@ def append_block( # type: ignore Content of the block. :param int length: Size of the block in bytes. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash of the block content. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the blob. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int appendpos_condition: + :keyword int appendpos_condition: Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param str encoding: + :keyword str encoding: Defaults to UTF-8. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag, last modified, append offset, committed block count). :rtype: dict(str, Any) @@ -2999,72 +2999,72 @@ def append_block_from_url(self, copy_source_url, # type: str This indicates the start of the range of bytes(inclusive) that has to be taken from the copy source. :param int source_length: This indicates the end of the range of bytes that has to be taken from the copy source. - :param bytearray source_content_md5: + :keyword bytearray source_content_md5: If given, the service will calculate the MD5 hash of the block content and compare against this value. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int appendpos_condition: + :keyword int appendpos_condition: Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param ~azure.storage.blob.LeaseClient or str lease: + :keyword ~azure.storage.blob.LeaseClient or str lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param ~datetime.datetime source_if_modified_since: + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has been modified since the specified time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the source resource has not been modified since the specified date/time. - :param str source_if_match: + :keyword str source_if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag matches the value specified. - :param str source_if_none_match: + :keyword str source_if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the source resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the source resource does not exist, and fail the operation if it does exist. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. """ options = self._append_block_from_url_options( diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py index dff7cbf0dfa0..0adf710aafd1 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py @@ -201,7 +201,7 @@ def generate_shared_access_signature( or address range specified on the SAS token, the request is not authenticated. For example, specifying ip=168.1.5.65 or ip=168.1.5.60-168.1.5.70 on the SAS restricts the request to those IP addresses. - :param str protocol: + :keyword str protocol: Specifies the protocol permitted for a request made. The default value is https. :return: A Shared Access Signature (sas) token. :rtype: str @@ -244,7 +244,7 @@ def get_user_delegation_key(self, key_start_time, # type: datetime A DateTime value. Indicates when the key becomes valid. :param ~datetime.datetime key_expiry_time: A DateTime value. Indicates when the key stops being valid. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: The user delegation key. :rtype: ~azure.storage.blob.UserDelegationKey @@ -306,7 +306,7 @@ def get_service_stats(self, **kwargs): # type: ignore access is available from the secondary location, if read-access geo-redundant replication is enabled for your storage account. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: The blob service stats. :rtype: ~azure.storage.blob._generated.models.StorageServiceStats @@ -333,7 +333,7 @@ def get_service_properties(self, **kwargs): """Gets the properties of a storage account's Blob service, including Azure Storage Analytics. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob._generated.models.StorageServiceProperties @@ -397,7 +397,7 @@ def set_service_properties( Specifies whether the static website feature is enabled, and if yes, indicates the index document and 404 error document to use. :type static_website: ~azure.storage.blob.StaticWebsite - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -443,10 +443,10 @@ def list_containers( :param bool include_metadata: Specifies that container metadata be returned in the response. The default value is `False`. - :param int results_per_page: + :keyword int results_per_page: The maximum number of container names to retrieve per API call. If the request does not specify the server will return up to 5,000 items. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) of ContainerProperties. :rtype: ~azure.core.paging.ItemPaged[~azure.storage.blob.ContainerProperties] @@ -498,7 +498,7 @@ def create_container( :param public_access: Possible values include: container, blob. :type public_access: str or ~azure.storage.blob.PublicAccess - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob.ContainerClient @@ -538,28 +538,28 @@ def delete_container( If specified, delete_container only succeeds if the container's lease is active and matches this ID. Required if the container has an active lease. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py index af7df5963630..f0ac9ccdb0f0 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py @@ -257,30 +257,30 @@ def generate_shared_access_signature( or address range specified on the SAS token, the request is not authenticated. For example, specifying ip=168.1.5.65 or ip=168.1.5.60-168.1.5.70 on the SAS restricts the request to those IP addresses. - :param str protocol: + :param ~azure.storage.blob.UserDelegationKey user_delegation_key: + Instead of an account key, the user could pass in a user delegation key. + A user delegation key can be obtained from the service by authenticating with an AAD identity; + this can be accomplished by calling get_user_delegation_key. + When present, the SAS is signed with the user delegation key instead. + :keyword str protocol: Specifies the protocol permitted for a request made. The default value is https. - :param str account_name: + :keyword str account_name: Specifies the account_name when using oauth token as credential. If you use oauth token as credential. - :param str cache_control: + :keyword str cache_control: Response header value for Cache-Control when resource is accessed using this shared access signature. - :param str content_disposition: + :keyword str content_disposition: Response header value for Content-Disposition when resource is accessed using this shared access signature. - :param str content_encoding: + :keyword str content_encoding: Response header value for Content-Encoding when resource is accessed using this shared access signature. - :param str content_language: + :keyword str content_language: Response header value for Content-Language when resource is accessed using this shared access signature. - :param str content_type: + :keyword str content_type: Response header value for Content-Type when resource is accessed using this shared access signature. - :param ~azure.storage.blob.UserDelegationKey user_delegation_key: - Instead of an account key, the user could pass in a user delegation key. - A user delegation key can be obtained from the service by authenticating with an AAD identity; - this can be accomplished by calling get_user_delegation_key. - When present, the SAS is signed with the user delegation key instead. :return: A Shared Access Signature (sas) token. :rtype: str @@ -338,7 +338,7 @@ def create_container(self, metadata=None, public_access=None, **kwargs): :type metadata: dict[str, str] :param ~azure.storage.blob.PublicAccess public_access: Possible values include: container, blob. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -372,32 +372,32 @@ def delete_container( Marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection. - :param ~azure.storage.blob.LeaseClient lease: + :keyword ~azure.storage.blob.LeaseClient lease: If specified, delete_container only succeeds if the container's lease is active and matches this ID. Required if the container has an active lease. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None @@ -446,28 +446,28 @@ def acquire_lease( :param str lease_id: Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: A LeaseClient object, that can be run in a context manager. :rtype: ~azure.storage.blob.LeaseClient @@ -509,10 +509,10 @@ def get_container_properties(self, **kwargs): """Returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs. - :param ~azure.storage.blob.LeaseClient lease: + :keyword ~azure.storage.blob.LeaseClient lease: If specified, get_container_properties only succeeds if the container's lease is active and matches this ID. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: Properties for the specified container within a container object. :rtype: ~azure.storage.blob.ContainerProperties @@ -555,16 +555,16 @@ def set_container_metadata( # type: ignore A dict containing name-value pairs to associate with the container as metadata. Example: {'category':'test'} :type metadata: dict[str, str] - :param str lease: + :keyword str lease: If specified, set_container_metadata only succeeds if the container's lease is active and matches this ID. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Container-updated property dict (Etag and last modified). @@ -600,10 +600,10 @@ def get_container_access_policy(self, **kwargs): """Gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly. - :param str lease: + :keyword str lease: If specified, get_container_access_policy only succeeds if the container's lease is active and matches this ID. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Access policy information in a dict. :rtype: dict[str, str] @@ -650,23 +650,23 @@ def set_container_access_policy( :type signed_identifiers: dict[str, ~azure.storage.blob.AccessPolicy] :param ~azure.storage.blob.PublicAccess public_access: Possible values include: container, blob. - :param lease: + :keyword lease: Required if the container has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A datetime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified date/time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A datetime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Container-updated property dict (Etag and last modified). :rtype: dict[str, str or ~datetime.datetime] @@ -723,7 +723,7 @@ def list_blobs(self, name_starts_with=None, include=None, **kwargs): :param list[str] include: Specifies one or more additional datasets to include in the response. Options include: 'snapshots', 'metadata', 'uncommittedblobs', 'copy', 'deleted'. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) response of BlobProperties. :rtype: ~azure.core.paging.ItemPaged[~azure.storage.blob.BlobProperties] @@ -775,7 +775,7 @@ def walk_blobs( element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) response of BlobProperties. :rtype: ~azure.core.paging.ItemPaged[~azure.storage.blob.BlobProperties] @@ -815,21 +815,23 @@ def upload_blob( :type name: str or ~azure.storage.blob.BlobProperties :param ~azure.storage.blob.BlobType blob_type: The type of the blob. This can be either BlockBlob, PageBlob or AppendBlob. The default value is BlockBlob. - :param bool overwrite: Whether the blob to be uploaded should overwrite the current data. - If True, upload_blob will silently overwrite the existing data. If set to False, the - operation will fail with ResourceExistsError. The exception to the above is with Append - blob types. In this case, if data already exists, an error will not be raised and - the data will be appended to the existing blob. If you set overwrite=True, then the existing - blob will be deleted, and a new one created. :param int length: Number of bytes to read from the stream. This is optional, but should be supplied for optimal performance. :param metadata: Name-value pairs associated with the blob as metadata. :type metadata: dict(str, str) - :param ~azure.storage.blob.ContentSettings content_settings: + :param str encoding: + Defaults to UTF-8. + :keyword bool overwrite: Whether the blob to be uploaded should overwrite the current data. + If True, upload_blob will silently overwrite the existing data. If set to False, the + operation will fail with ResourceExistsError. The exception to the above is with Append + blob types. In this case, if data already exists, an error will not be raised and + the data will be appended to the existing blob. If you set overwrite=True, then the existing + blob will be deleted, and a new one created. + :keyword ~azure.storage.blob.ContentSettings content_settings: ContentSettings object used to set blob properties. - :param bool validate_content: + :keyword bool validate_content: If true, calculates an MD5 hash for each chunk of the blob. The storage service checks the hash of the content that has arrived with the hash that was sent. This is primarily valuable for detecting bitflips on @@ -838,58 +840,56 @@ def upload_blob( blob. Also note that if enabled, the memory-efficient upload algorithm will not be used, because computing the MD5 hash requires buffering entire blocks, and doing so defeats the purpose of the memory-efficient algorithm. - :param lease: + :keyword lease: Required if the container has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. - :param ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: + :keyword ~azure.storage.blob.PremiumPageBlobTier premium_page_blob_tier: A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. - :param ~azure.storage.blob.StandardBlobTier standard_blob_tier: + :keyword ~azure.storage.blob.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. - :param int maxsize_condition: + :keyword int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). - :param int max_concurrency: + :keyword int max_concurrency: Maximum number of parallel connections to use when the blob size exceeds 64MB. - :param ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. As the encryption key itself is provided in the request, a secure connection must be established to transfer the key. - :param str encoding: - Defaults to UTF-8. :returns: A BlobClient to interact with the newly uploaded blob. :rtype: ~azure.storage.blob.BlobClient @@ -943,36 +943,36 @@ def delete_blob( Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param lease: - Required if the blob has an active lease. Value can be a Lease object - or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str :param str delete_snapshots: Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param ~datetime.datetime if_modified_since: + :keyword lease: + Required if the blob has an active lease. Value can be a Lease object + or the lease ID as a string. + :type lease: ~azure.storage.blob.LeaseClient or str + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -1064,40 +1064,40 @@ def delete_blobs(self, *blobs, **kwargs): :param blobs: The blobs with which to interact. :type blobs: str or ~azure.storage.blob.BlobProperties - :param str delete_snapshots: + :keyword str delete_snapshots: Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a Lease object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str - :param str delete_snapshots: + :keyword str delete_snapshots: Required if the blob has associated snapshots. Values include: - "only": Deletes only the blobs snapshots. - "include": Deletes the blob along with all snapshots. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: An iterator of responses, one for each blob in order :rtype: iterator[~azure.core.pipeline.transport.HttpResponse] @@ -1179,9 +1179,9 @@ def set_standard_blob_tier_blobs( tier is optimized for storing data that is rarely accessed and stored for at least six months with flexible latency requirements. :type standard_blob_tier: str or ~azure.storage.blob.StandardBlobTier - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str @@ -1231,11 +1231,11 @@ def set_premium_page_blob_tier_blobs( blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually. - :param lease: + :keyword lease: Required if the blob has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.blob.LeaseClient or str diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/download.py b/sdk/storage/azure-storage-blob/azure/storage/blob/download.py index ea7ef2b010ee..88355481e55c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/download.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/download.py @@ -437,7 +437,7 @@ def content_as_bytes(self, max_concurrency=1): This operation is blocking until all data is downloaded. - :param int max_concurrency: + :keyword int max_concurrency: The number of parallel connections with which to download. :rtype: bytes """ @@ -450,7 +450,7 @@ def content_as_text(self, max_concurrency=1, encoding="UTF-8"): This operation is blocking until all data is downloaded. - :param int max_concurrency: + :keyword int max_concurrency: The number of parallel connections with which to download. :rtype: str """ diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/lease.py b/sdk/storage/azure-storage-blob/azure/storage/blob/lease.py index c50f39f6950c..0ed9d8aa05f0 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/lease.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/lease.py @@ -91,28 +91,28 @@ def acquire(self, lease_duration=-1, **kwargs): (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change. Default is -1 (infinite lease). - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: None """ @@ -146,28 +146,28 @@ def renew(self, **kwargs): or blob has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -198,28 +198,28 @@ def release(self, **kwargs): that associated with the container or blob. Releasing the lease allows another client to immediately acquire the lease for the container or blob as soon as the release is complete. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -249,28 +249,28 @@ def change(self, proposed_lease_id, **kwargs): :param str proposed_lease_id: Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param str if_match: + :keyword str if_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified. - :param str if_none_match: + :keyword str if_none_match: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -315,19 +315,19 @@ def break_lease(self, lease_break_period=None, **kwargs): period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately. - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: Approximate time remaining in the lease period, in seconds. :rtype: int From 299527c423360e912785aab3bb12390af04dd15b Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Sat, 12 Oct 2019 22:43:38 -0700 Subject: [PATCH 2/2] pylint :( --- .../azure/storage/blob/aio/container_client_async.py | 2 +- .../azure-storage-blob/azure/storage/blob/container_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py index 44da9fc6fa27..cd46a5bad6bb 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py @@ -699,7 +699,7 @@ async def upload_blob( blob = self.get_blob_client(name) kwargs.setdefault('merge_span', True) timeout = kwargs.pop('timeout', None) - encoding=kwargs.pop('encoding', 'UTF-8') + encoding = kwargs.pop('encoding', 'UTF-8') await blob.upload_blob( data, blob_type=blob_type, diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py index f0ac9ccdb0f0..f198672a4849 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py @@ -804,7 +804,6 @@ def upload_blob( blob_type=BlobType.BlockBlob, # type: Union[str, BlobType] length=None, # type: Optional[int] metadata=None, # type: Optional[Dict[str, str]] - encoding='UTF-8', # type: str **kwargs ): # type: (...) -> BlobClient @@ -905,6 +904,7 @@ def upload_blob( blob = self.get_blob_client(name) kwargs.setdefault('merge_span', True) timeout = kwargs.pop('timeout', None) + encoding = kwargs.pop('encoding', 'UTF-8') blob.upload_blob( data, blob_type=blob_type,