Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Release History

## 12.9.0b1 (Unreleased)
## 12.9.0b1 (2021-7-27)
**New Features**
- Added support for object level immutability policy with versioning (Version Level WORM).
- Added support for listing deleted root blobs that have versions.
- Added OAuth support for sync copy blob source.

**Fixes**
- Fixed a bug for get_block_list (#16314)
- Ensured that download fails if blob modified mid download
- Enabled exists() for CPK encrypted blobs (#18041)

**Notes**
- Deprecated new_name in for undelete container operation

## 12.8.1 (2021-04-20)
**Fixes**
Expand Down
10 changes: 8 additions & 2 deletions sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
UserDelegationKey
)
from ._generated.models import (
RehydratePriority
RehydratePriority,
BlobImmutabilityPolicyMode
)
from ._models import (
BlobType,
Expand Down Expand Up @@ -54,10 +55,12 @@
BlobQueryError,
DelimitedJsonDialect,
DelimitedTextDialect,
QuickQueryDialect,
ArrowDialect,
ArrowType,
ObjectReplicationPolicy,
ObjectReplicationRule
ObjectReplicationRule,
ImmutabilityPolicy
)
from ._list_blobs_helper import BlobPrefix

Expand Down Expand Up @@ -194,6 +197,8 @@ def download_blob_from_url(
'StandardBlobTier',
'PremiumPageBlobTier',
'SequenceNumberAction',
'BlobImmutabilityPolicyMode',
'ImmutabilityPolicy',
'PublicAccess',
'BlobAnalyticsLogging',
'Metrics',
Expand All @@ -210,6 +215,7 @@ def download_blob_from_url(
'BlobBlock',
'PageRange',
'AccessPolicy',
'QuickQueryDialect',
'ContainerSasPermissions',
'BlobSasPermissions',
'ResourceTypes',
Expand Down
220 changes: 205 additions & 15 deletions sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ def list_blobs(self, name_starts_with=None, include=None, **kwargs):
begin with the specified prefix.
:param list[str] or str include:
Specifies one or more additional datasets to include in the response.
Options include: 'snapshots', 'metadata', 'uncommittedblobs', 'copy', 'deleted', 'tags'.
Options include: 'snapshots', 'metadata', 'uncommittedblobs', 'copy', 'deleted', 'deletedwithversions',
'tags', 'versions', 'immutabilitypolicy', 'legalhold'.
:keyword int timeout:
The timeout parameter is expressed in seconds.
:returns: An iterable (auto-paging) response of BlobProperties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
TYPE_CHECKING
)

from ._models import BlobType, CopyProperties, ContentSettings, LeaseProperties, BlobProperties
from ._models import BlobType, CopyProperties, ContentSettings, LeaseProperties, BlobProperties, ImmutabilityPolicy
from ._shared.models import get_enum_value

from ._shared.response_handlers import deserialize_metadata
Expand Down Expand Up @@ -153,6 +153,9 @@ def get_blob_properties_from_generated_code(generated):
blob.tags = parse_tags(generated.blob_tags) # pylint: disable=protected-access
blob.object_replication_source_properties = deserialize_ors_policies(generated.object_replication_metadata)
blob.last_accessed_on = generated.properties.last_accessed_on
blob.immutability_policy = ImmutabilityPolicy._from_generated(generated) # pylint: disable=protected-access
blob.has_legal_hold = generated.properties.legal_hold
blob.has_versions_only = generated.has_versions_only
return blob


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AzureBlobStorage(object):
:vartype append_blob: azure.storage.blob.operations.AppendBlobOperations
:ivar block_blob: BlockBlobOperations operations
:vartype block_blob: azure.storage.blob.operations.BlockBlobOperations
:param url: The URL of the service account, container, or blob that is the targe of the desired operation.
:param url: The URL of the service account, container, or blob that is the target of the desired operation.
:type url: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AzureBlobStorageConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.

:param url: The URL of the service account, container, or blob that is the targe of the desired operation.
:param url: The URL of the service account, container, or blob that is the target of the desired operation.
:type url: str
"""

Expand All @@ -38,7 +38,7 @@ def __init__(
super(AzureBlobStorageConfiguration, self).__init__(**kwargs)

self.url = url
self.version = "2020-08-04"
self.version = "2020-10-02"
kwargs.setdefault('sdk_moniker', 'azureblobstorage/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AzureBlobStorage(object):
:vartype append_blob: azure.storage.blob.aio.operations.AppendBlobOperations
:ivar block_blob: BlockBlobOperations operations
:vartype block_blob: azure.storage.blob.aio.operations.BlockBlobOperations
:param url: The URL of the service account, container, or blob that is the targe of the desired operation.
:param url: The URL of the service account, container, or blob that is the target of the desired operation.
:type url: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AzureBlobStorageConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.

:param url: The URL of the service account, container, or blob that is the targe of the desired operation.
:param url: The URL of the service account, container, or blob that is the target of the desired operation.
:type url: str
"""

Expand All @@ -33,7 +33,7 @@ def __init__(
super(AzureBlobStorageConfiguration, self).__init__(**kwargs)

self.url = url
self.version = "2020-08-04"
self.version = "2020-10-02"
kwargs.setdefault('sdk_moniker', 'azureblobstorage/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ async def create(
cpk_info: Optional["_models.CpkInfo"] = None,
cpk_scope_info: Optional["_models.CpkScopeInfo"] = None,
modified_access_conditions: Optional["_models.ModifiedAccessConditions"] = None,
**kwargs
**kwargs: Any
) -> None:
"""The Create Append Blob operation creates a new append blob.

:param content_length: The length of the request.
:type content_length: long
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-
timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`.
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`.
:type timeout: int
:param metadata: Optional. Specifies a user-defined name-value pair associated with the blob.
If no name-value pairs are specified, the operation will copy the metadata from the source blob
Expand Down Expand Up @@ -249,7 +250,7 @@ async def append_block(
cpk_info: Optional["_models.CpkInfo"] = None,
cpk_scope_info: Optional["_models.CpkScopeInfo"] = None,
modified_access_conditions: Optional["_models.ModifiedAccessConditions"] = None,
**kwargs
**kwargs: Any
) -> None:
"""The Append Block operation commits a new block of data to the end of an existing append blob.
The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to
Expand All @@ -260,8 +261,9 @@ async def append_block(
:param body: Initial data.
:type body: IO
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-
timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`.
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`.
:type timeout: int
:param transactional_content_md5: Specify the transactional md5 for the body, to be validated
by the service.
Expand Down Expand Up @@ -417,13 +419,14 @@ async def append_block_from_url(
timeout: Optional[int] = None,
transactional_content_md5: Optional[bytearray] = None,
request_id_parameter: Optional[str] = None,
copy_source_authorization: Optional[str] = None,
cpk_info: Optional["_models.CpkInfo"] = None,
cpk_scope_info: Optional["_models.CpkScopeInfo"] = None,
lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None,
append_position_access_conditions: Optional["_models.AppendPositionAccessConditions"] = None,
modified_access_conditions: Optional["_models.ModifiedAccessConditions"] = None,
source_modified_access_conditions: Optional["_models.SourceModifiedAccessConditions"] = None,
**kwargs
**kwargs: Any
) -> None:
"""The Append Block operation commits a new block of data to the end of an existing append blob
where the contents are read from a source url. The Append Block operation is permitted only if
Expand All @@ -443,15 +446,19 @@ async def append_block_from_url(
read from the copy source.
:type source_contentcrc64: bytearray
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-
timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`.
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`.
:type timeout: int
:param transactional_content_md5: Specify the transactional md5 for the body, to be validated
by the service.
:type transactional_content_md5: bytearray
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled.
:type request_id_parameter: str
:param copy_source_authorization: Only Bearer type is supported. Credentials should be a valid
OAuth access token to copy source.
:type copy_source_authorization: str
:param cpk_info: Parameter group.
:type cpk_info: ~azure.storage.blob.models.CpkInfo
:param cpk_scope_info: Parameter group.
Expand Down Expand Up @@ -576,6 +583,8 @@ async def append_block_from_url(
header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
if request_id_parameter is not None:
header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
if copy_source_authorization is not None:
header_parameters['x-ms-copy-source-authorization'] = self._serialize.header("copy_source_authorization", copy_source_authorization, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

request = self._client.put(url, query_parameters, header_parameters)
Expand Down Expand Up @@ -613,14 +622,15 @@ async def seal(
lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None,
modified_access_conditions: Optional["_models.ModifiedAccessConditions"] = None,
append_position_access_conditions: Optional["_models.AppendPositionAccessConditions"] = None,
**kwargs
**kwargs: Any
) -> None:
"""The Seal operation seals the Append Blob to make it read-only. Seal is supported only on
version 2019-12-12 version or later.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-
timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`.
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled.
Expand Down
Loading