From 3ffabe6ce28483ec0924e05c5392c68d1bc42886 Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 3 Jun 2021 20:44:26 -0700 Subject: [PATCH 01/14] [Blob][STG78]Object Imutability Policy (Version Level Worm) --- .../azure/storage/blob/__init__.py | 4 +- .../azure/storage/blob/_blob_client.py | 161 +++++++ .../azure/storage/blob/_container_client.py | 3 +- .../azure/storage/blob/_deserialize.py | 3 + .../azure/storage/blob/_models.py | 36 +- .../azure/storage/blob/_serialize.py | 3 +- .../azure/storage/blob/_shared/models.py | 10 +- .../azure/storage/blob/_upload_helpers.py | 9 + .../storage/blob/aio/_blob_client_async.py | 155 +++++++ .../azure/storage/blob/aio/_upload_helpers.py | 9 + ..._append_blob_with_immutability_policy.yaml | 319 +++++++++++++ ...ownload_blob_with_immutability_policy.yaml | 130 ++++++ ...d_blob_with_immutability_policy_async.yaml | 224 +++++++++ ...st_put_block_with_immutability_policy.yaml | 371 +++++++++++++++ ...st_put_block_with_immutability_policy.yaml | 266 +++++++++++ ...on_blob.test_blob_immutability_policy.yaml | 378 ++++++++++++++++ ...test_common_blob.test_blob_legal_hold.yaml | 424 ++++++++++++++++++ ...st_copy_blob_with_immutability_policy.yaml | 308 +++++++++++++ ...ownload_blob_with_immutability_policy.yaml | 367 +++++++++++++++ ...t_list_blobs_with_immutability_policy.yaml | 229 ++++++++++ ...lob.test_set_blob_immutability_policy.yaml | 383 ++++++++++++++++ ...mon_blob.test_set_immutability_policy.yaml | 131 ++++++ ...immutability_policy_using_account_sas.yaml | 241 ++++++++++ ...est_set_immutability_policy_using_sas.yaml | 323 +++++++++++++ ...b_async.test_blob_immutability_policy.yaml | 261 +++++++++++ ...ommon_blob_async.test_blob_legal_hold.yaml | 291 ++++++++++++ ...st_copy_blob_with_immutability_policy.yaml | 223 +++++++++ ...ownload_blob_with_immutability_policy.yaml | 267 +++++++++++ ...t_list_blobs_with_immutability_policy.yaml | 164 +++++++ ...ntainer.test_get_container_properties.yaml | 50 ++- .../test_container.test_list_containers.yaml | 170 ++++--- ...r_async.test_get_container_properties.yaml | 82 ++-- ..._container_async.test_list_containers.yaml | 420 ++++++++++++++--- ..._create_blob_with_immutability_policy.yaml | 247 ++++++++++ ..._create_blob_with_immutability_policy.yaml | 170 +++++++ .../tests/test_append_blob.py | 39 +- .../tests/test_append_blob_async.py | 40 +- .../tests/test_block_blob.py | 48 +- .../tests/test_block_blob_async.py | 49 +- .../tests/test_common_blob.py | 264 ++++++++++- .../tests/test_common_blob_async.py | 189 +++++++- .../tests/test_container.py | 2 + .../tests/test_container_async.py | 2 + .../tests/test_page_blob.py | 39 +- .../tests/test_page_blob_async.py | 41 +- 45 files changed, 7335 insertions(+), 210 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_create_append_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_download_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_append_blob_async.test_create_append_blob_with_immutability_policy_async.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_legal_hold.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_download_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_list_blobs_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_blob_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_account_sas.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_sas.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_legal_hold.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_download_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_list_blobs_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_page_blob.test_create_blob_with_immutability_policy.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_page_blob_async.test_create_blob_with_immutability_policy.yaml diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py index 9164961ea10a..5eb568b21fdf 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py @@ -24,7 +24,8 @@ UserDelegationKey ) from ._generated.models import ( - RehydratePriority + RehydratePriority, + BlobImmutabilityPolicyMode ) from ._models import ( BlobType, @@ -194,6 +195,7 @@ def download_blob_from_url( 'StandardBlobTier', 'PremiumPageBlobTier', 'SequenceNumberAction', + 'BlobImmutabilityPolicyMode', 'PublicAccess', 'BlobAnalyticsLogging', 'Metrics', 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 e82c04f7bd8f..4dcab7de7beb 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 @@ -407,6 +407,8 @@ def _upload_blob_options( # pylint:disable=too-many-statements kwargs['blob_settings'] = self._config kwargs['max_concurrency'] = max_concurrency kwargs['encryption_options'] = encryption_options + kwargs['immutability_policy_expiry'] = kwargs.pop('immutability_policy_expiry_time', None) + if blob_type == BlobType.BlockBlob: kwargs['client'] = self._client.block_blob kwargs['data'] = data @@ -643,6 +645,28 @@ def upload_blob( # pylint: disable=too-many-locals :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. + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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 @@ -1367,6 +1391,63 @@ def set_blob_metadata(self, metadata=None, **kwargs): except HttpResponseError as error: process_storage_error(error) + @distributed_trace + def set_immutability_policy(self, **kwargs): + # type: (**Any) -> Dict[str, str] + """The Set Immutability Policy operation sets the immutability policy on the blob. + + .. versionadded:: 12.10.0 + This operation was introduced in API version '2020-10-02'. + + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword int timeout: + The timeout parameter is expressed in seconds. + :returns: Key value pairs of blob tags. + :rtype: Dict[str, str] + """ + + return self._client.blob.set_immutability_policy( + immutability_policy_expiry=kwargs.pop('immutability_policy_expiry_time', None), + cls=return_response_headers, **kwargs) + + @distributed_trace + def delete_immutability_policy(self, **kwargs): + # type: (**Any) -> None + """The Delete Immutability Policy operation deletes the immutability policy on the blob. + + .. versionadded:: 12.10.0 + This operation was introduced in API version '2020-10-02'. + + :keyword int timeout: + The timeout parameter is expressed in seconds. + :returns: Key value pairs of blob tags. + :rtype: Dict[str, str] + """ + + self._client.blob.delete_immutability_policy(**kwargs) + + @distributed_trace + def set_legal_hold(self, legal_hold, **kwargs): + # type: (**Any) -> Dict[str, str] + """The Set Legal Hold operation sets a legal hold on the blob. + + .. versionadded:: 12.10.0 + This operation was introduced in API version '2020-10-02'. + + :param bool legal_hold: + Specified if a legal hold should be set on the blob. + :keyword int timeout: + The timeout parameter is expressed in seconds. + :returns: Key value pairs of blob tags. + :rtype: Dict[str, str] + """ + + return self._client.blob.set_legal_hold(legal_hold, cls=return_response_headers, **kwargs) + def _create_page_blob_options( # type: ignore self, size, # type: int content_settings=None, # type: Optional[ContentSettings] @@ -1415,6 +1496,7 @@ def _create_page_blob_options( # type: ignore 'blob_content_length': size, 'blob_sequence_number': sequence_number, 'blob_http_headers': blob_headers, + 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'timeout': kwargs.pop('timeout', None), 'lease_access_conditions': access_conditions, 'modified_access_conditions': mod_conditions, @@ -1468,6 +1550,25 @@ def create_page_blob( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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. @@ -1546,6 +1647,7 @@ def _create_append_blob_options(self, content_settings=None, metadata=None, **kw options = { 'content_length': 0, 'blob_http_headers': blob_headers, + 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'timeout': kwargs.pop('timeout', None), 'lease_access_conditions': access_conditions, 'modified_access_conditions': mod_conditions, @@ -1582,6 +1684,25 @@ def create_append_blob(self, content_settings=None, metadata=None, **kwargs): Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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. @@ -1750,6 +1871,7 @@ def _start_copy_from_url_options(self, source_url, metadata=None, incremental_co options = { 'copy_source': source_url, 'seal_blob': kwargs.pop('seal_destination_blob', None), + 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'timeout': timeout, 'modified_access_conditions': dest_mod_conditions, 'blob_tags_string': blob_tags_string, @@ -1834,6 +1956,25 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, .. versionadded:: 12.4.0 :paramtype tags: dict(str, str) + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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. @@ -2390,6 +2531,7 @@ def _commit_block_list_options( # type: ignore 'validate_content': validate_content, 'cpk_scope_info': cpk_scope_info, 'cpk_info': cpk_info, + 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'tier': tier.value if tier else None, 'blob_tags_string': blob_tags_string, 'headers': headers @@ -2430,6 +2572,25 @@ def commit_block_list( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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 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 d2caf7a5a8e5..904c335b72c7 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 @@ -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', 'tags', + 'immutabilitypolicy', 'legalhold'. :keyword int timeout: The timeout parameter is expressed in seconds. :returns: An iterable (auto-paging) response of BlobProperties. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py index dff39536572d..3d95244e143d 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py @@ -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_expiry_time = generated.properties.immutability_policy_expires_on + blob.immutability_policy_mode = generated.properties.immutability_policy_mode + blob.legal_hold = generated.properties.legal_hold return blob diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py index 1ddde2e46c5c..31c4d58780ce 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -313,6 +313,12 @@ class ContainerProperties(DictMixin): Represents whether the container has an immutability policy. :ivar bool has_legal_hold: Represents whether the container has a legal hold. + :ivar bool is_immutable_storage_with_versioning_enabled: + Represents whether immutable storage with versioning enabled on the container. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :ivar dict metadata: A dict with name-value pairs to associate with the container as metadata. :ivar ~azure.storage.blob.ContainerEncryptionScope encryption_scope: @@ -335,6 +341,7 @@ def __init__(self, **kwargs): self.has_legal_hold = kwargs.get('x-ms-has-legal-hold') self.metadata = kwargs.get('metadata') self.encryption_scope = None + self.is_immutable_storage_with_versioning_enabled = kwargs.get('x-ms-immutable-storage-with-versioning-enabled') default_encryption_scope = kwargs.get('x-ms-default-encryption-scope') if default_encryption_scope: self.encryption_scope = ContainerEncryptionScope( @@ -351,6 +358,7 @@ def _from_generated(cls, generated): props.lease = LeaseProperties._from_generated(generated) # pylint: disable=protected-access props.public_access = generated.properties.public_access props.has_immutability_policy = generated.properties.has_immutability_policy + props.is_immutable_storage_with_versioning_enabled = generated.properties.is_immutable_storage_with_versioning_enabled props.deleted = generated.deleted props.version = generated.version props.has_legal_hold = generated.properties.has_legal_hold @@ -559,6 +567,9 @@ def __init__(self, **kwargs): self.last_accessed_on = kwargs.get('x-ms-last-access-time') self.tag_count = kwargs.get('x-ms-tag-count') self.tags = None + self.immutability_policy_expiry_time = kwargs.get('x-ms-immutability-policy-until-date') + self.immutability_policy_mode = kwargs.get('x-ms-immutability-policy-mode') + self.legal_hold = kwargs.get('x-ms-legal-hold') class FilteredBlob(DictMixin): @@ -832,20 +843,25 @@ class ContainerSasPermissions(object): List blobs in the container. :param bool tag: Set or get tags on the blobs in the container. + :keyword bool immutability_policy: + To enable operations related to immutability policy. """ - def __init__(self, read=False, write=False, delete=False, list=False, delete_previous_version=False, tag=False): # pylint: disable=redefined-builtin + def __init__(self, read=False, write=False, delete=False, + list=False, delete_previous_version=False, tag=False, **kwargs): # pylint: disable=redefined-builtin self.read = read self.write = write self.delete = delete self.list = list self.delete_previous_version = delete_previous_version self.tag = tag + self.immutability_policy = kwargs.pop('immutability_policy', False) self._str = (('r' if self.read else '') + ('w' if self.write else '') + ('d' if self.delete else '') + ('x' if self.delete_previous_version else '') + ('l' if self.list else '') + - ('t' if self.tag else '')) + ('t' if self.tag else '') + + ('i' if self.immutability_policy else '')) def __str__(self): return self._str @@ -869,8 +885,10 @@ def from_string(cls, permission): p_list = 'l' in permission p_delete_previous_version = 'x' in permission p_tag = 't' in permission + p_immutability_policy = 'i' in permission parsed = cls(read=p_read, write=p_write, delete=p_delete, list=p_list, - delete_previous_version=p_delete_previous_version, tag=p_tag) + delete_previous_version=p_delete_previous_version, tag=p_tag, + immutability_policy=p_immutability_policy) return parsed @@ -896,9 +914,11 @@ class BlobSasPermissions(object): Delete the previous blob version for the versioning enabled storage account. :param bool tag: Set or get tags on the blob. + :keyword bool immutability_policy: + To enable operations related to immutability policy. """ def __init__(self, read=False, add=False, create=False, write=False, - delete=False, delete_previous_version=False, tag=True): + delete=False, delete_previous_version=False, tag=True, **kwargs): self.read = read self.add = add self.create = create @@ -906,13 +926,15 @@ def __init__(self, read=False, add=False, create=False, write=False, self.delete = delete self.delete_previous_version = delete_previous_version self.tag = tag + self.immutability_policy = kwargs.pop('immutability_policy', False) self._str = (('r' if self.read else '') + ('a' if self.add else '') + ('c' if self.create else '') + ('w' if self.write else '') + ('d' if self.delete else '') + ('x' if self.delete_previous_version else '') + - ('t' if self.tag else '')) + ('t' if self.tag else '') + + ('i' if self.immutability_policy else '')) def __str__(self): return self._str @@ -937,9 +959,11 @@ def from_string(cls, permission): p_delete = 'd' in permission p_delete_previous_version = 'x' in permission p_tag = 't' in permission + p_immutability_policy = 'i' in permission parsed = cls(read=p_read, add=p_add, create=p_create, write=p_write, delete=p_delete, - delete_previous_version=p_delete_previous_version, tag=p_tag) + delete_previous_version=p_delete_previous_version, tag=p_tag, + immutability_policy=p_immutability_policy) return parsed diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py index 8f6f265dce52..4eb3fb4ecfa0 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py @@ -38,7 +38,8 @@ '2020-02-10', '2020-04-08', '2020-06-12', - '2020-08-04' + '2020-08-04', + '2020-10-02' ] diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py index c51356bd885f..58b4cb238428 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py @@ -328,6 +328,8 @@ class AccountSasPermissions(object): To enable set or get tags on the blobs in the container. :keyword bool filter_by_tags: To enable get blobs by tags, this should be used together with list permission. + :keyword bool immutability_policy: + To enable operations related to immutability policy. """ def __init__(self, read=False, write=False, delete=False, list=False, # pylint: disable=redefined-builtin @@ -343,6 +345,7 @@ def __init__(self, read=False, write=False, delete=False, self.process = process self.tag = kwargs.pop('tag', False) self.filter_by_tags = kwargs.pop('filter_by_tags', False) + self.immutability_policy = kwargs.pop('immutability_policy', False) self._str = (('r' if self.read else '') + ('w' if self.write else '') + ('d' if self.delete else '') + @@ -353,7 +356,8 @@ def __init__(self, read=False, write=False, delete=False, ('u' if self.update else '') + ('p' if self.process else '') + ('f' if self.filter_by_tags else '') + - ('t' if self.tag else '') + ('t' if self.tag else '') + + ('i' if self.immutability_policy else '') ) def __str__(self): @@ -383,12 +387,14 @@ def from_string(cls, permission): p_process = 'p' in permission p_tag = 't' in permission p_filter_by_tags = 'f' in permission + p_immutability_policy = 'i' in permission parsed = cls(read=p_read, write=p_write, delete=p_delete, delete_previous_version=p_delete_previous_version, list=p_list, add=p_add, create=p_create, update=p_update, process=p_process, tag=p_tag, - filter_by_tags=p_filter_by_tags) + filter_by_tags=p_filter_by_tags, immutability_policy=p_immutability_policy) return parsed + class Services(object): """Specifies the services accessible with the account SAS. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py index 94313f635e43..d62ffddeca08 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py @@ -79,6 +79,9 @@ def upload_block_blob( # pylint: disable=too-many-locals blob_headers = kwargs.pop('blob_headers', None) tier = kwargs.pop('standard_blob_tier', None) blob_tags_string = kwargs.pop('blob_tags_string', None) + immutability_policy_expiry = kwargs.pop('immutability_policy_expiry', None) + immutability_policy_mode = kwargs.pop('immutability_policy_mode', None) + legal_hold = kwargs.pop('legal_hold', None) # Do single put if the size is smaller than or equal config.max_single_put_size if adjusted_count is not None and (adjusted_count <= blob_settings.max_single_put_size): @@ -102,6 +105,9 @@ def upload_block_blob( # pylint: disable=too-many-locals upload_stream_current=0, tier=tier.value if tier else None, blob_tags_string=blob_tags_string, + immutability_policy_expiry=immutability_policy_expiry, + immutability_policy_mode=immutability_policy_mode, + legal_hold=legal_hold, **kwargs) use_original_upload_path = blob_settings.use_byte_buffer or \ @@ -151,6 +157,9 @@ def upload_block_blob( # pylint: disable=too-many-locals headers=headers, tier=tier.value if tier else None, blob_tags_string=blob_tags_string, + immutability_policy_expiry=immutability_policy_expiry, + immutability_policy_mode=immutability_policy_mode, + legal_hold=legal_hold, **kwargs) except HttpResponseError as error: try: 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 a87a409796e1..9b79575ef93b 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 @@ -319,6 +319,28 @@ async def upload_blob( 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 ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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. @@ -789,6 +811,63 @@ async def set_blob_metadata(self, metadata=None, **kwargs): except HttpResponseError as error: process_storage_error(error) + @distributed_trace_async + async def set_immutability_policy(self, **kwargs): + # type: (**Any) -> Dict[str, str] + """The Set Immutability Policy operation sets the immutability policy on the blob. + + .. versionadded:: 12.10.0 + This operation was introduced in API version '2020-10-02'. + + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword int timeout: + The timeout parameter is expressed in seconds. + :returns: Key value pairs of blob tags. + :rtype: Dict[str, str] + """ + + return await self._client.blob.set_immutability_policy( + immutability_policy_expiry=kwargs.pop('immutability_policy_expiry_time', None), + cls=return_response_headers, **kwargs) + + @distributed_trace_async() + async def delete_immutability_policy(self, **kwargs): + # type: (**Any) -> None + """The Delete Immutability Policy operation deletes the immutability policy on the blob. + + .. versionadded:: 12.10.0 + This operation was introduced in API version '2020-10-02'. + + :keyword int timeout: + The timeout parameter is expressed in seconds. + :returns: Key value pairs of blob tags. + :rtype: Dict[str, str] + """ + + await self._client.blob.delete_immutability_policy(**kwargs) + + @distributed_trace_async + async def set_legal_hold(self, legal_hold, **kwargs): + # type: (**Any) -> Dict[str, str] + """The Set Legal Hold operation sets a legal hold on the blob. + + .. versionadded:: 12.10.0 + This operation was introduced in API version '2020-10-02'. + + :param bool legal_hold: + Specified if a legal hold should be set on the blob. + :keyword int timeout: + The timeout parameter is expressed in seconds. + :returns: Key value pairs of blob tags. + :rtype: Dict[str, str] + """ + + return await self._client.blob.set_legal_hold(legal_hold, cls=return_response_headers, **kwargs) + @distributed_trace_async async def create_page_blob( # type: ignore self, size, # type: int @@ -831,6 +910,25 @@ async def create_page_blob( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.aio.BlobLeaseClient or str + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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. @@ -898,6 +996,25 @@ async def create_append_blob(self, content_settings=None, metadata=None, **kwarg .. versionadded:: 12.4.0 :paramtype tags: dict(str, str) + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :keyword lease: Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. @@ -1091,6 +1208,25 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= .. versionadded:: 12.4.0 :paramtype tags: dict(str, str) + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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. @@ -1505,6 +1641,25 @@ async def commit_block_list( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.aio.BlobLeaseClient or str + :keyword ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :keyword immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :keyword bool legal_hold: + Specified if a legal hold should be set on the blob. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :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 diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py index 36d1e4498e5e..f26340c4fec1 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py @@ -54,6 +54,9 @@ async def upload_block_blob( # pylint: disable=too-many-locals blob_headers = kwargs.pop('blob_headers', None) tier = kwargs.pop('standard_blob_tier', None) blob_tags_string = kwargs.pop('blob_tags_string', None) + immutability_policy_expiry = kwargs.pop('immutability_policy_expiry', None) + immutability_policy_mode = kwargs.pop('immutability_policy_mode', None) + legal_hold = kwargs.pop('legal_hold', None) # Do single put if the size is smaller than config.max_single_put_size if adjusted_count is not None and (adjusted_count <= blob_settings.max_single_put_size): @@ -77,6 +80,9 @@ async def upload_block_blob( # pylint: disable=too-many-locals upload_stream_current=0, tier=tier.value if tier else None, blob_tags_string=blob_tags_string, + immutability_policy_expiry=immutability_policy_expiry, + immutability_policy_mode=immutability_policy_mode, + legal_hold=legal_hold, **kwargs) use_original_upload_path = blob_settings.use_byte_buffer or \ @@ -126,6 +132,9 @@ async def upload_block_blob( # pylint: disable=too-many-locals headers=headers, tier=tier.value if tier else None, blob_tags_string=blob_tags_string, + immutability_policy_expiry=immutability_policy_expiry, + immutability_policy_mode=immutability_policy_mode, + legal_hold=legal_hold, **kwargs) except HttpResponseError as error: try: diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_create_append_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_create_append_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..2f6fb9925274 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_create_append_blob_with_immutability_policy.yaml @@ -0,0 +1,319 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:20 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer698c1aaf?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 00:24:20 GMT + etag: + - '"0x8D926EF19218D5F"' + last-modified: + - Fri, 04 Jun 2021 00:24:21 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:21 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainersource698c1aaf?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 00:24:20 GMT + etag: + - '"0x8D926EF1932594F"' + last-modified: + - Fri, 04 Jun 2021 00:24:21 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer698c1aaf?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer698c1aaf","name":"vlwcontainer698c1aaf","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Fri, 04 Jun 2021 00:24:22 GMT + etag: + - '"0x8D926EF1A89B505"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - AppendBlob + x-ms-date: + - Fri, 04 Jun 2021 00:24:23 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 00:24:28 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer698c1aaf/vlwblob698c1aaf + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 00:24:23 GMT + etag: + - '"0x8D926EF1AAFAEDA"' + last-modified: + - Fri, 04 Jun 2021 00:24:23 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T00:24:23.6396250Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:23 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer698c1aaf/vlwblob698c1aaf + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '0' + content-type: + - application/octet-stream + date: + - Fri, 04 Jun 2021 00:24:23 GMT + etag: + - '"0x8D926EF1AAFAEDA"' + last-modified: + - Fri, 04 Jun 2021 00:24:23 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-committed-block-count: + - '0' + x-ms-blob-type: + - AppendBlob + x-ms-creation-time: + - Fri, 04 Jun 2021 00:24:23 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 00:24:28 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'true' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T00:24:23.6396250Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:23 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainer698c1aaf/vlwblob698c1aaf + response: + body: + string: "\uFEFFBlobImmutableDueToLegalHoldThis + operation is not permitted as the blob is immutable due to one or more legal + holds.\nRequestId:cd95533e-901e-008f-19d7-5853a8000000\nTime:2021-06-04T00:24:23.9094959Z" + headers: + content-length: + - '284' + content-type: + - application/xml + date: + - Fri, 04 Jun 2021 00:24:23 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - BlobImmutableDueToLegalHold + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: This operation is not permitted as the blob is immutable due to one + or more legal holds. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer698c1aaf?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Fri, 04 Jun 2021 00:24:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_download_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_download_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..5d1b4d273fdf --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob.test_download_blob_with_immutability_policy.yaml @@ -0,0 +1,130 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 00:28:11 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerecd618bc?restype=container + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:9e04072a-101e-0004-590f-5805ac000000\nTime:2021-06-03T00:28:12.0315118Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Thu, 03 Jun 2021 00:28:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 00:28:12 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainersourceecd618bc?restype=container + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:9e04072f-101e-0004-5c0f-5805ac000000\nTime:2021-06-03T00:28:12.2204032Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Thu, 03 Jun 2021 00:28:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerecd618bc?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerecd618bc","name":"vlwcontainerecd618bc","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Thu, 03 Jun 2021 00:28:14 GMT + etag: + - '"0x8D9262679DD5898"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob_async.test_create_append_blob_with_immutability_policy_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob_async.test_create_append_blob_with_immutability_policy_async.yaml new file mode 100644 index 000000000000..69fcb43a4f5e --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_append_blob_async.test_create_append_blob_with_immutability_policy_async.yaml @@ -0,0 +1,224 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:41 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainercb3e1fa9?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:24:41 GMT + etag: '"0x8D926EF2598A00C"' + last-modified: Fri, 04 Jun 2021 00:24:41 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainercb3e1fa9?restype=container +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:42 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainersourcecb3e1fa9?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:24:41 GMT + etag: '"0x8D926EF25A23EC1"' + last-modified: Fri, 04 Jun 2021 00:24:42 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainersourcecb3e1fa9?restype=container +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerasynccb3e1fa9?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerasynccb3e1fa9","name":"vlwcontainerasynccb3e1fa9","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: no-cache + content-length: '461' + content-type: application/json + date: Fri, 04 Jun 2021 00:24:42 GMT + etag: '"0x8D926EF266A0B9B"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 201 + message: Created + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanmcccanary3/blobServices/default/containers/vlwcontainerasynccb3e1fa9?api-version=2021-04-01 +- request: + body: null + headers: + Accept: + - application/xml + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - AppendBlob + x-ms-date: + - Fri, 04 Jun 2021 00:24:43 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 00:24:48 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerasynccb3e1fa9/vlwblobcb3e1fa9 + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:24:42 GMT + etag: '"0x8D926EF2688D849"' + last-modified: Fri, 04 Jun 2021 00:24:43 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T00:24:43.5177545Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainerasynccb3e1fa9/vlwblobcb3e1fa9 +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:43 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainerasynccb3e1fa9/vlwblobcb3e1fa9 + response: + body: + string: '' + headers: + accept-ranges: bytes + content-length: '0' + content-type: application/octet-stream + date: Fri, 04 Jun 2021 00:24:42 GMT + etag: '"0x8D926EF2688D849"' + last-modified: Fri, 04 Jun 2021 00:24:43 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-committed-block-count: '0' + x-ms-blob-type: AppendBlob + x-ms-creation-time: Fri, 04 Jun 2021 00:24:43 GMT + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 00:24:48 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'true' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T00:24:43.5177545Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainerasynccb3e1fa9/vlwblobcb3e1fa9 +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:24:43 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainerasynccb3e1fa9/vlwblobcb3e1fa9 + response: + body: + string: "\uFEFFBlobImmutableDueToLegalHoldThis + operation is not permitted as the blob is immutable due to one or more legal + holds.\nRequestId:3b95fb65-701e-0001-77d8-58851e000000\nTime:2021-06-04T00:24:43.6817010Z" + headers: + content-length: '284' + content-type: application/xml + date: Fri, 04 Jun 2021 00:24:43 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: BlobImmutableDueToLegalHold + x-ms-version: '2020-10-02' + status: + code: 409 + message: This operation is not permitted as the blob is immutable due to one + or more legal holds. + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainerasynccb3e1fa9/vlwblobcb3e1fa9 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainercb3e1fa9?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 00:24:43 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanmcccanary3/blobServices/default/containers/utcontainercb3e1fa9?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_with_immutability_policy.yaml new file mode 100644 index 000000000000..236744bbce42 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_with_immutability_policy.yaml @@ -0,0 +1,371 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:22:06 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer775416bc?restype=container + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:b239bfe9-601e-0013-0716-584833000000\nTime:2021-06-03T01:22:06.7223418Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Thu, 03 Jun 2021 01:22:05 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer775416bc?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer775416bc","name":"vlwcontainer775416bc","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Thu, 03 Jun 2021 01:22:09 GMT + etag: + - '"0x8D9262E020D3535"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: AAA + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:22:09 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer775416bc/blob775416bc?comp=block&blockid=MQ%3D%3D + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 01:22:09 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - Cc/2Kr4DuKg= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: BBB + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:22:09 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer775416bc/blob775416bc?comp=block&blockid=Mg%3D%3D + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 01:22:09 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - +3yuPEA7IqE= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: CCC + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:22:10 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer775416bc/blob775416bc?comp=block&blockid=Mw%3D%3D + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 01:22:09 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - VRJmMeosVKY= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: ' + + MQ==Mg==Mw==' + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '125' + Content-Type: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:22:10 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 01:22:15 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer775416bc/blob775416bc?comp=blocklist + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 01:22:10 GMT + etag: + - '"0x8D9262E029B0D55"' + last-modified: + - Thu, 03 Jun 2021 01:22:10 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - dAoQ5rLgKr0= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T01:22:10.3702869Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:22:13 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer775416bc/blob775416bc + response: + body: + string: AAABBBCCC + headers: + accept-ranges: + - bytes + content-length: + - '9' + content-range: + - bytes 0-8/9 + content-type: + - application/octet-stream + date: + - Thu, 03 Jun 2021 01:22:13 GMT + etag: + - '"0x8D9262E029B0D55"' + last-modified: + - Thu, 03 Jun 2021 01:22:10 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Thu, 03 Jun 2021 01:22:10 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 01:22:15 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'true' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T01:22:10.3702869Z' + status: + code: 206 + message: Partial Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer775416bc?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 03 Jun 2021 01:22:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_with_immutability_policy.yaml new file mode 100644 index 000000000000..86bc6af1d412 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_with_immutability_policy.yaml @@ -0,0 +1,266 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:49:25 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8761939?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:49:26 GMT + etag: '"0x8D926F29A3CB6D9"' + last-modified: Fri, 04 Jun 2021 00:49:26 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer8761939?restype=container +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer8761939?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer8761939","name":"vlwcontainer8761939","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: no-cache + content-length: '449' + content-type: application/json + date: Fri, 04 Jun 2021 00:49:27 GMT + etag: '"0x8D926F29B3623A4"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 201 + message: Created + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanmcccanary3/blobServices/default/containers/vlwcontainer8761939?api-version=2021-04-01 +- request: + body: AAA + headers: + Accept: + - application/xml + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:49:27 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=block&blockid=MQ%3D%3D + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:49:27 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: Cc/2Kr4DuKg= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=block&blockid=MQ%3D%3D +- request: + body: BBB + headers: + Accept: + - application/xml + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:49:28 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=block&blockid=Mg%3D%3D + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:49:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: +3yuPEA7IqE= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=block&blockid=Mg%3D%3D +- request: + body: CCC + headers: + Accept: + - application/xml + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:49:28 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=block&blockid=Mw%3D%3D + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:49:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: VRJmMeosVKY= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=block&blockid=Mw%3D%3D +- request: + body: ' + + MQ==Mg==Mw==' + headers: + Accept: + - application/xml + Content-Length: + - '125' + Content-Type: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:49:28 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 00:49:33 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=blocklist + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:49:28 GMT + etag: '"0x8D926F29B74DA2C"' + last-modified: Fri, 04 Jun 2021 00:49:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: dAoQ5rLgKr0= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T00:49:28.1703468Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer8761939/blob8761939?comp=blocklist +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:49:28 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer8761939/blob8761939 + response: + body: + string: AAABBBCCC + headers: + accept-ranges: bytes + content-length: '9' + content-range: bytes 0-8/9 + content-type: application/octet-stream + date: Fri, 04 Jun 2021 00:49:28 GMT + etag: '"0x8D926F29B74DA2C"' + last-modified: Fri, 04 Jun 2021 00:49:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-type: BlockBlob + x-ms-creation-time: Fri, 04 Jun 2021 00:49:28 GMT + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 00:49:33 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Fri, 04 Jun 2021 00:49:28 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'true' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T00:49:28.1703468Z' + status: + code: 206 + message: Partial Content + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer8761939/blob8761939 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer8761939?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 00:49:28 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanmcccanary3/blobServices/default/containers/utcontainer8761939?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_immutability_policy.yaml new file mode 100644 index 000000000000..02bdbbc0f62c --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_immutability_policy.yaml @@ -0,0 +1,378 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:22:16 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerbba812fb?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: + - Wed, 02 Jun 2021 21:22:16 GMT + etag: + - '"0x8D9260C7FC8A085"' + last-modified: + - Wed, 02 Jun 2021 21:22:17 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerbba812fb?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerbba812fb","name":"vlwcontainerbba812fb","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Wed, 02 Jun 2021 21:22:19 GMT + etag: + - '"0x8D9260C81015A75"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: abc + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Wed, 02 Jun 2021 21:22:19 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerbba812fb/vlwblobbba812fb + response: + body: + string: '' + headers: + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + date: + - Wed, 02 Jun 2021 21:22:19 GMT + etag: + - '"0x8D9260C812FF2CD"' + last-modified: + - Wed, 02 Jun 2021 21:22:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - 6/rBP7vK5QU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T21:22:19.8502093Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:22:19 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Wed, 02 Jun 2021 21:22:24 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerbba812fb/vlwblobbba812fb?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 02 Jun 2021 21:22:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Wed, 02 Jun 2021 21:22:24 GMT + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:22:20 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainerbba812fb/vlwblobbba812fb + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Wed, 02 Jun 2021 21:22:19 GMT + etag: + - '"0x8D9260C812FF2CD"' + last-modified: + - Wed, 02 Jun 2021 21:22:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-inferred: + - 'true' + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Wed, 02 Jun 2021 21:22:19 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Wed, 02 Jun 2021 21:22:24 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T21:22:19.8502093Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:22:20 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainerbba812fb/vlwblobbba812fb?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 02 Jun 2021 21:22:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:22:20 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainerbba812fb/vlwblobbba812fb + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Wed, 02 Jun 2021 21:22:19 GMT + etag: + - '"0x8D9260C812FF2CD"' + last-modified: + - Wed, 02 Jun 2021 21:22:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-inferred: + - 'true' + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Wed, 02 Jun 2021 21:22:19 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T21:22:19.8502093Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainerbba812fb?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 02 Jun 2021 21:22:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_legal_hold.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_legal_hold.yaml new file mode 100644 index 000000000000..8b5297f97629 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_blob_legal_hold.yaml @@ -0,0 +1,424 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 22:00:23 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer1f2c0efd?restype=container&timeout=5 + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:e40f48f6-f01e-001e-3dfa-57dc6b000000\nTime:2021-06-02T22:00:24.3863053Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Wed, 02 Jun 2021 22:00:24 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer1f2c0efd?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer1f2c0efd","name":"vlwcontainer1f2c0efd","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Wed, 02 Jun 2021 22:00:26 GMT + etag: + - '"0x8D92611D4514FB0"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: abc + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer1f2c0efd/vlwblob1f2c0efd + response: + body: + string: '' + headers: + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + date: + - Wed, 02 Jun 2021 22:00:26 GMT + etag: + - '"0x8D92611D487F0F7"' + last-modified: + - Wed, 02 Jun 2021 22:00:27 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - 6/rBP7vK5QU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T22:00:27.1624199Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer1f2c0efd/vlwblob1f2c0efd?comp=legalhold + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 02 Jun 2021 22:00:27 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer1f2c0efd/vlwblob1f2c0efd + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Wed, 02 Jun 2021 22:00:27 GMT + etag: + - '"0x8D92611D487F0F7"' + last-modified: + - Wed, 02 Jun 2021 22:00:27 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-inferred: + - 'true' + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'true' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T22:00:27.1624199Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainer1f2c0efd/vlwblob1f2c0efd + response: + body: + string: "\uFEFFBlobImmutableDueToLegalHoldThis + operation is not permitted as the blob is immutable due to one or more legal + holds.\nRequestId:e40f4907-f01e-001e-48fa-57dc6b000000\nTime:2021-06-02T22:00:27.6464434Z" + headers: + content-length: + - '284' + content-type: + - application/xml + date: + - Wed, 02 Jun 2021 22:00:27 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - BlobImmutableDueToLegalHold + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: This operation is not permitted as the blob is immutable due to one + or more legal holds. +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-legal-hold: + - 'false' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer1f2c0efd/vlwblob1f2c0efd?comp=legalhold + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 02 Jun 2021 22:00:27 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-legal-hold: + - 'false' + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer1f2c0efd/vlwblob1f2c0efd + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Wed, 02 Jun 2021 22:00:27 GMT + etag: + - '"0x8D92611D487F0F7"' + last-modified: + - Wed, 02 Jun 2021 22:00:27 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-inferred: + - 'true' + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Wed, 02 Jun 2021 22:00:27 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'false' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T22:00:27.1624199Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer1f2c0efd?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 02 Jun 2021 22:00:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..ba53372488b2 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_immutability_policy.yaml @@ -0,0 +1,308 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 02:46:49 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer90f61730?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 02:46:50 GMT + etag: + - '"0x8D92639D6B7BB88"' + last-modified: + - Thu, 03 Jun 2021 02:46:50 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer90f61730?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer90f61730","name":"vlwcontainer90f61730","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Thu, 03 Jun 2021 02:46:53 GMT + etag: + - '"0x8D92639D846A8CD"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Thu, 03 Jun 2021 02:46:53 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer90f61730/blob90f61730 + response: + body: + string: '' + headers: + content-md5: + - yaNM/IXZgmmMasifdgcavQ== + date: + - Thu, 03 Jun 2021 02:46:53 GMT + etag: + - '"0x8D92639D87DDB86"' + last-modified: + - Thu, 03 Jun 2021 02:46:53 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - ov8U1LLnyKc= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T02:46:53.6754054Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-copy-source: + - https://seanoauthstage.blob.core.windows.net/utcontainer90f61730/blob90f61730 + x-ms-date: + - Thu, 03 Jun 2021 02:46:53 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 02:46:58 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer90f61730/blob1copy + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 02:46:53 GMT + etag: + - '"0x8D92639D89B9836"' + last-modified: + - Thu, 03 Jun 2021 02:46:53 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-copy-id: + - 2baeb5bc-5faf-42b2-b182-1b96459c0530 + x-ms-copy-status: + - success + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T02:46:53.8702902Z' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 02:46:53 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer90f61730/blob1copy + response: + body: + string: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + headers: + accept-ranges: + - bytes + content-length: + - '1024' + content-range: + - bytes 0-1023/1024 + content-type: + - application/octet-stream + date: + - Thu, 03 Jun 2021 02:46:53 GMT + etag: + - '"0x8D92639D89B9836"' + last-modified: + - Thu, 03 Jun 2021 02:46:53 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: + - yaNM/IXZgmmMasifdgcavQ== + x-ms-blob-type: + - BlockBlob + x-ms-copy-completion-time: + - Thu, 03 Jun 2021 02:46:53 GMT + x-ms-copy-id: + - 2baeb5bc-5faf-42b2-b182-1b96459c0530 + x-ms-copy-progress: + - 1024/1024 + x-ms-copy-source: + - https://seanoauthstage.blob.core.windows.net/utcontainer90f61730/blob90f61730 + x-ms-copy-status: + - success + x-ms-creation-time: + - Thu, 03 Jun 2021 02:46:53 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 02:46:58 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'true' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T02:46:53.8702902Z' + status: + code: 206 + message: Partial Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer90f61730?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 03 Jun 2021 02:46:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_download_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_download_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..7c24061d0486 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_download_blob_with_immutability_policy.yaml @@ -0,0 +1,367 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:21:30 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerf03618cd?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 01:21:30 GMT + etag: + - '"0x8D9262DEAF03895"' + last-modified: + - Thu, 03 Jun 2021 01:21:30 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerf03618cd?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerf03618cd","name":"vlwcontainerf03618cd","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Thu, 03 Jun 2021 01:21:32 GMT + etag: + - '"0x8D9262DEC0FF64B"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: abcedfg + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '7' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Thu, 03 Jun 2021 01:21:32 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 01:21:37 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerf03618cd/vlwblobf03618cd + response: + body: + string: '' + headers: + content-md5: + - 3eUGUzgtctuRaJEq8fjAHg== + date: + - Thu, 03 Jun 2021 01:21:32 GMT + etag: + - '"0x8D9262DEC430203"' + last-modified: + - Thu, 03 Jun 2021 01:21:32 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - mI9QQJ+DEzc= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T01:21:32.8844051Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:21:35 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainerf03618cd/vlwblobf03618cd + response: + body: + string: abcedfg + headers: + accept-ranges: + - bytes + content-length: + - '7' + content-range: + - bytes 0-6/7 + content-type: + - application/octet-stream + date: + - Thu, 03 Jun 2021 01:21:35 GMT + etag: + - '"0x8D9262DEC430203"' + last-modified: + - Thu, 03 Jun 2021 01:21:32 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: + - 3eUGUzgtctuRaJEq8fjAHg== + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Thu, 03 Jun 2021 01:21:32 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 01:21:37 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'true' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T01:21:32.8844051Z' + status: + code: 206 + message: Partial Content +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:21:35 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainerf03618cd/vlwblobf03618cd + response: + body: + string: "\uFEFFBlobImmutableDueToLegalHoldThis + operation is not permitted as the blob is immutable due to one or more legal + holds.\nRequestId:1702de51-201e-002a-1716-586ee4000000\nTime:2021-06-03T01:21:35.8691730Z" + headers: + content-length: + - '284' + content-type: + - application/xml + date: + - Thu, 03 Jun 2021 01:21:35 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - BlobImmutableDueToLegalHold + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: This operation is not permitted as the blob is immutable due to one + or more legal holds. +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:21:35 GMT + x-ms-legal-hold: + - 'false' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerf03618cd/vlwblobf03618cd?comp=legalhold + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 03 Jun 2021 01:21:35 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-legal-hold: + - 'false' + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 01:21:36 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainerf03618cd/vlwblobf03618cd?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 03 Jun 2021 01:21:35 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainerf03618cd?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 03 Jun 2021 01:21:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_list_blobs_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_list_blobs_with_immutability_policy.yaml new file mode 100644 index 000000000000..261c2b499944 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_list_blobs_with_immutability_policy.yaml @@ -0,0 +1,229 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:15:04 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainera98317a4?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: + - Fri, 04 Jun 2021 03:15:04 GMT + etag: + - '"0x8D92706F34CF886"' + last-modified: + - Fri, 04 Jun 2021 03:15:05 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-10-02' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainera98317a4?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainera98317a4","name":"vlwcontainera98317a4","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Fri, 04 Jun 2021 03:15:07 GMT + etag: + - '"0x8D92706F456B189"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: abcedfg + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '7' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:15:07 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:15:12 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainera98317a4/vlwbloba98317a4 + response: + body: + string: '' + headers: + content-md5: + - 3eUGUzgtctuRaJEq8fjAHg== + date: + - Fri, 04 Jun 2021 03:15:07 GMT + etag: + - '"0x8D92706F4861F39"' + last-modified: + - Fri, 04 Jun 2021 03:15:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - mI9QQJ+DEzc= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T03:15:07.5363401Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:15:07 GMT + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainera98317a4?restype=container&comp=list&include=immutabilitypolicy,legalhold + response: + body: + string: "\uFEFFvlwbloba98317a42021-06-04T03:15:07.5363401ZtrueFri, + 04 Jun 2021 03:15:07 GMTFri, 04 Jun 2021 03:15:07 + GMT0x8D92706F4861F397application/octet-stream3eUGUzgtctuRaJEq8fjAHg==BlockBlobHottrueunlockedavailabletrueFri, + 04 Jun 2021 03:15:12 GMTunlockedtrue" + headers: + content-type: + - application/xml + date: + - Fri, 04 Jun 2021 03:15:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainera98317a4?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Fri, 04 Jun 2021 03:15:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_blob_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_blob_immutability_policy.yaml new file mode 100644 index 000000000000..7d111fbe68bd --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_blob_immutability_policy.yaml @@ -0,0 +1,383 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:20:54 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerbd114a6?restype=container&timeout=5 + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:2b69983b-701e-000f-20f5-57d0c5000000\nTime:2021-06-02T21:20:54.9331260Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Wed, 02 Jun 2021 21:20:54 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerbd114a6?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainerbd114a6","name":"vlwcontainerbd114a6","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '449' + content-type: + - application/json + date: + - Wed, 02 Jun 2021 21:20:57 GMT + etag: + - '"0x8D9260C5034AD4B"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: abc + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Wed, 02 Jun 2021 21:20:57 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerbd114a6/vlwblobbd114a6 + response: + body: + string: '' + headers: + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + date: + - Wed, 02 Jun 2021 21:20:58 GMT + etag: + - '"0x8D9260C50723E08"' + last-modified: + - Wed, 02 Jun 2021 21:20:58 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - 6/rBP7vK5QU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T21:20:58.0773144Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:21:00 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Wed, 02 Jun 2021 21:21:05 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainerbd114a6/vlwblobbd114a6?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 02 Jun 2021 21:21:00 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Wed, 02 Jun 2021 21:21:05 GMT + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:21:01 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainerbd114a6/vlwblobbd114a6 + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Wed, 02 Jun 2021 21:21:01 GMT + etag: + - '"0x8D9260C50723E08"' + last-modified: + - Wed, 02 Jun 2021 21:20:58 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-inferred: + - 'true' + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Wed, 02 Jun 2021 21:20:58 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Wed, 02 Jun 2021 21:21:05 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T21:20:58.0773144Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:21:02 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainerbd114a6/vlwblobbd114a6?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 02 Jun 2021 21:21:02 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 02 Jun 2021 21:21:02 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainerbd114a6/vlwblobbd114a6 + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Wed, 02 Jun 2021 21:21:02 GMT + etag: + - '"0x8D9260C50723E08"' + last-modified: + - Wed, 02 Jun 2021 21:20:58 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-inferred: + - 'true' + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Wed, 02 Jun 2021 21:20:58 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-02T21:20:58.0773144Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainerbd114a6?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 02 Jun 2021 21:21:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy.yaml new file mode 100644 index 000000000000..997b81712bdf --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy.yaml @@ -0,0 +1,131 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Jun 2021 23:07:38 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraac312a8?restype=container&timeout=5 + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:1e10f50d-001e-0018-1b3a-579d5a000000\nTime:2021-06-01T23:07:38.8357199Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Tue, 01 Jun 2021 23:07:38 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + If-Match: + - '*' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontaineraac312a8/immutabilityPolicies/default?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontaineraac312a8/immutabilityPolicies/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies","etag":"\"8d9254ab66c2c6c\"","properties":{"immutabilityPeriodSinceCreationInDays":1,"state":"Unlocked"}}' + headers: + cache-control: + - no-cache + content-length: + - '433' + content-type: + - application/json + date: + - Tue, 01 Jun 2021 23:07:42 GMT + etag: + - '"8d9254ab66c2c6c"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontaineraac312a8?api-version=2021-04-01 + response: + body: + string: '{"error":{"code":"ContainerProtectedFromDeletion","message":"The storage + account storagename container utcontaineraac312a8 is protected from deletion + due to ImmutabilityPolicy."}}' + headers: + cache-control: + - no-cache + content-length: + - '182' + content-type: + - application/json + date: + - Tue, 01 Jun 2021 23:07:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 409 + message: Conflict +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_account_sas.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_account_sas.yaml new file mode 100644 index 000000000000..c6705e348800 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_account_sas.yaml @@ -0,0 +1,241 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:07:08 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer413f1a1f?restype=container&timeout=5 + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:a0de277d-f01e-0052-30ee-58a62a000000\nTime:2021-06-04T03:07:09.0965940Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Fri, 04 Jun 2021 03:07:08 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer413f1a1f?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer413f1a1f","name":"vlwcontainer413f1a1f","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Fri, 04 Jun 2021 03:07:10 GMT + etag: + - '"0x8D92705D8591BDD"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: abc + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:07:10 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer413f1a1f/vlwblob413f1a1f + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + date: + - Fri, 04 Jun 2021 03:07:10 GMT + etag: + - '"0x8D92705D88C091C"' + last-modified: + - Fri, 04 Jun 2021 03:07:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - 6/rBP7vK5QU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T03:07:11.1021612Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:07:11 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:07:16 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer413f1a1f/vlwblob413f1a1f?comp=immutabilityPolicies&se=2021-06-04T04%3A07%3A11Z&sp=ri&sv=2020-10-02&ss=b&srt=co&sig=LiGLEW4kb4GX/bBmM4RHYbLxEhYnIUYvqjc8me3G0lc%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 03:07:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:07:16 GMT + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.24.0 + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer413f1a1f/vlwblob413f1a1f?se=2021-06-04T04%3A07%3A11Z&sp=ri&sv=2020-10-02&ss=b&srt=co&sig=LiGLEW4kb4GX/bBmM4RHYbLxEhYnIUYvqjc8me3G0lc%3D + response: + body: + string: abc + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Fri, 04 Jun 2021 03:07:11 GMT + etag: + - '"0x8D92705D88C091C"' + last-modified: + - Fri, 04 Jun 2021 03:07:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Fri, 04 Jun 2021 03:07:11 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:07:16 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Fri, 04 Jun 2021 03:07:11 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T03:07:11.1021612Z' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_sas.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_sas.yaml new file mode 100644 index 000000000000..a87452caae22 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_set_immutability_policy_using_sas.yaml @@ -0,0 +1,323 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:30:07 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7c4d16d3?restype=container&timeout=5 + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:64db2846-301e-0029-6df1-58b647000000\nTime:2021-06-04T03:30:08.0362489Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Fri, 04 Jun 2021 03:30:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer7c4d16d3?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer7c4d16d3","name":"vlwcontainer7c4d16d3","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Fri, 04 Jun 2021 03:30:09 GMT + etag: + - '"0x8D927090ECED923"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: abc + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:30:10 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer7c4d16d3/vlwblob7c4d16d3 + response: + body: + string: '' + headers: + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + date: + - Fri, 04 Jun 2021 03:30:10 GMT + etag: + - '"0x8D927090EF9125A"' + last-modified: + - Fri, 04 Jun 2021 03:30:10 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-content-crc64: + - 6/rBP7vK5QU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T03:30:10.9038954Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:30:10 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:15 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer7c4d16d3/vlwblob7c4d16d3?comp=immutabilityPolicies&se=2021-06-04T04%3A30%3A10Z&sp=ri&sv=2020-10-02&ss=b&srt=co&sig=JeSZVEcG0xoikV14a2xJobNVgs8UCKM/sM/2GWKxfjM%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 03:30:10 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:15 GMT + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.24.0 + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer7c4d16d3/vlwblob7c4d16d3?se=2021-06-04T04%3A30%3A10Z&sp=ri&sv=2020-10-02&ss=b&srt=co&sig=JeSZVEcG0xoikV14a2xJobNVgs8UCKM/sM/2GWKxfjM%3D + response: + body: + string: abc + headers: + accept-ranges: + - bytes + content-length: + - '3' + content-md5: + - kAFQmDzST7DWlj99KOF/cg== + content-type: + - application/octet-stream + date: + - Fri, 04 Jun 2021 03:30:11 GMT + etag: + - '"0x8D927090EF9125A"' + last-modified: + - Fri, 04 Jun 2021 03:30:10 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Fri, 04 Jun 2021 03:30:10 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:15 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-04T03:30:10.9038954Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:30:11 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:16 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer7c4d16d3/vlwblob7c4d16d3?comp=immutabilityPolicies&se=2021-06-04T04%3A30%3A11Z&sp=ri&sv=2020-10-02&sr=c&sig=Yx49o9nuCzbv6BlcDlvnEL8oMjvHDqLKFWJYIM%2BU0c0%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 03:30:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:16 GMT + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:30:12 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:17 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer7c4d16d3/vlwblob7c4d16d3?comp=immutabilityPolicies&se=2021-06-04T04%3A30%3A12Z&sp=rti&sv=2020-10-02&sr=b&sig=QDN1tgMDgi3XwgdgSyI4RLFZr%2BRMdh95W8gThmLkmnk%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Jun 2021 03:30:12 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:30:17 GMT + x-ms-version: + - '2020-10-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_immutability_policy.yaml new file mode 100644 index 000000000000..dd8195b77b5d --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_immutability_policy.yaml @@ -0,0 +1,261 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:34:53 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer36dc1578?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: Fri, 04 Jun 2021 03:34:52 GMT + etag: '"0x8D92709B7A33966"' + last-modified: Fri, 04 Jun 2021 03:34:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/utcontainer36dc1578?restype=container&timeout=5 +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer36dc1578?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer36dc1578","name":"vlwcontainer36dc1578","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: no-cache + content-length: '451' + content-type: application/json + date: Fri, 04 Jun 2021 03:34:55 GMT + etag: '"0x8D92709B8C66F66"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 201 + message: Created + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/vlwcontainer36dc1578?api-version=2021-04-01 +- request: + body: abc + headers: + Accept: + - application/xml + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:34:55 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578 + response: + body: + string: '' + headers: + content-md5: kAFQmDzST7DWlj99KOF/cg== + date: Fri, 04 Jun 2021 03:34:55 GMT + etag: '"0x8D92709B8E5204A"' + last-modified: Fri, 04 Jun 2021 03:34:55 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-content-crc64: 6/rBP7vK5QU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:34:55.9848522Z' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578 +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:34:56 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:35:01 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 03:34:55 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 03:35:01 GMT + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578?comp=immutabilityPolicies +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:34:56 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578 + response: + body: + string: '' + headers: + accept-ranges: bytes + content-length: '3' + content-md5: kAFQmDzST7DWlj99KOF/cg== + content-type: application/octet-stream + date: Fri, 04 Jun 2021 03:34:55 GMT + etag: '"0x8D92709B8E5204A"' + last-modified: Fri, 04 Jun 2021 03:34:55 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: Hot + x-ms-access-tier-inferred: 'true' + x-ms-blob-type: BlockBlob + x-ms-creation-time: Fri, 04 Jun 2021 03:34:55 GMT + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 03:35:01 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:34:55.9848522Z' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578 +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:34:56 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 03:34:56 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578?comp=immutabilityPolicies +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:34:56 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578 + response: + body: + string: '' + headers: + accept-ranges: bytes + content-length: '3' + content-md5: kAFQmDzST7DWlj99KOF/cg== + content-type: application/octet-stream + date: Fri, 04 Jun 2021 03:34:56 GMT + etag: '"0x8D92709B8E5204A"' + last-modified: Fri, 04 Jun 2021 03:34:55 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: Hot + x-ms-access-tier-inferred: 'true' + x-ms-blob-type: BlockBlob + x-ms-creation-time: Fri, 04 Jun 2021 03:34:55 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:34:55.9848522Z' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer36dc1578/vlwblob36dc1578 +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer36dc1578?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 03:34:56 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/utcontainer36dc1578?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_legal_hold.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_legal_hold.yaml new file mode 100644 index 000000000000..325e03555fda --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_blob_legal_hold.yaml @@ -0,0 +1,291 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:35:28 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer83ec117a?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: Fri, 04 Jun 2021 03:35:27 GMT + etag: '"0x8D92709CC56B5FD"' + last-modified: Fri, 04 Jun 2021 03:35:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/utcontainer83ec117a?restype=container&timeout=5 +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer83ec117a?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer83ec117a","name":"vlwcontainer83ec117a","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: no-cache + content-length: '451' + content-type: application/json + date: Fri, 04 Jun 2021 03:35:30 GMT + etag: '"0x8D92709CD398120"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 201 + message: Created + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/vlwcontainer83ec117a?api-version=2021-04-01 +- request: + body: abc + headers: + Accept: + - application/xml + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:35:30 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a + response: + body: + string: '' + headers: + content-md5: kAFQmDzST7DWlj99KOF/cg== + date: Fri, 04 Jun 2021 03:35:29 GMT + etag: '"0x8D92709CD57F867"' + last-modified: Fri, 04 Jun 2021 03:35:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-content-crc64: 6/rBP7vK5QU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:35:30.2919271Z' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:35:30 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a?comp=legalhold + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 03:35:29 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-legal-hold: 'true' + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a?comp=legalhold +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:35:30 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a + response: + body: + string: '' + headers: + accept-ranges: bytes + content-length: '3' + content-md5: kAFQmDzST7DWlj99KOF/cg== + content-type: application/octet-stream + date: Fri, 04 Jun 2021 03:35:29 GMT + etag: '"0x8D92709CD57F867"' + last-modified: Fri, 04 Jun 2021 03:35:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: Hot + x-ms-access-tier-inferred: 'true' + x-ms-blob-type: BlockBlob + x-ms-creation-time: Fri, 04 Jun 2021 03:35:30 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'true' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:35:30.2919271Z' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:35:30 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a + response: + body: + string: "\uFEFFBlobImmutableDueToLegalHoldThis + operation is not permitted as the blob is immutable due to one or more legal + holds.\nRequestId:42521f4c-d01e-002c-36f2-582fd5000000\nTime:2021-06-04T03:35:30.7571698Z" + headers: + content-length: '284' + content-type: application/xml + date: Fri, 04 Jun 2021 03:35:29 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: BlobImmutableDueToLegalHold + x-ms-version: '2020-10-02' + status: + code: 409 + message: This operation is not permitted as the blob is immutable due to one + or more legal holds. + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:35:30 GMT + x-ms-legal-hold: + - 'false' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a?comp=legalhold + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 03:35:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-legal-hold: 'false' + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a?comp=legalhold +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:35:30 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a + response: + body: + string: '' + headers: + accept-ranges: bytes + content-length: '3' + content-md5: kAFQmDzST7DWlj99KOF/cg== + content-type: application/octet-stream + date: Fri, 04 Jun 2021 03:35:30 GMT + etag: '"0x8D92709CD57F867"' + last-modified: Fri, 04 Jun 2021 03:35:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: Hot + x-ms-access-tier-inferred: 'true' + x-ms-blob-type: BlockBlob + x-ms-creation-time: Fri, 04 Jun 2021 03:35:30 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'false' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:35:30.2919271Z' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer83ec117a/vlwblob83ec117a +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer83ec117a?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 03:35:31 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/utcontainer83ec117a?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..0ca586139375 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_immutability_policy.yaml @@ -0,0 +1,223 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:33:27 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer250c19ad?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: Fri, 04 Jun 2021 03:33:27 GMT + etag: '"0x8D92709843D15EB"' + last-modified: Fri, 04 Jun 2021 03:33:27 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/utcontainer250c19ad?restype=container&timeout=5 +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer250c19ad?api-version=2021-04-01 + response: + body: + string: !!binary | + H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl + VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8Xs + o0cf3W3Wk2ZaF6u2qJbN3Um2f3+yd+/edr6Xn2/v7376cPvgYOdge/9hPtmZHeSTbGd2t86bal1P + 88/rar1q7v7eJ2WRL9u7q7q6LGZ53dz9opjWVVOdt+PXbVVnF/ndRn4eT6fVetk2d5s8W1bZup03 + LX18d1JWk9d5fVlM8+buLD/P1mV7d1ot26xYAuBleWX/2ru/M919mM0+Gn20zBY5jWHg2/Z6hW9v + Ribo3UJqCAQNaZXXbZE3Hz0igi0W6zablLkC+m7Rzn+SGhLliuUFWuRLfE10bet1/ktGH83yMm/x + 93lWNvnoozpfEGxq/Io+XoLkT7Nrgr0z+mieNWcCvyiL9vplVRbTa/siffs8v8jKb1elgfZLfsn/ + A9wkcTbDAQAA + headers: + cache-control: no-cache + content-encoding: gzip + content-type: application/json + date: Fri, 04 Jun 2021 03:33:28 GMT + etag: '"0x8D9270984D5D50B"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + vary: Accept-Encoding + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/vlwcontainer250c19ad?api-version=2021-04-01 +- request: + body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + headers: + Accept: + - application/xml + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:33:28 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer250c19ad/blob250c19ad + response: + body: + string: '' + headers: + content-md5: yaNM/IXZgmmMasifdgcavQ== + date: Fri, 04 Jun 2021 03:33:28 GMT + etag: '"0x8D9270984F1F987"' + last-modified: Fri, 04 Jun 2021 03:33:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-content-crc64: ov8U1LLnyKc= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:33:28.8275335Z' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/utcontainer250c19ad/blob250c19ad +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-copy-source: + - https://seanoauthstage.blob.core.windows.net/utcontainer250c19ad/blob250c19ad + x-ms-date: + - Fri, 04 Jun 2021 03:33:28 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:33:33 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer250c19ad/blob1copy + response: + body: + string: '' + headers: + date: Fri, 04 Jun 2021 03:33:28 GMT + etag: '"0x8D9270985009D5C"' + last-modified: Fri, 04 Jun 2021 03:33:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-copy-id: 87477c2c-1b83-445c-810c-05c5ea58f10e + x-ms-copy-status: success + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:33:28.9234780Z' + status: + code: 202 + message: Accepted + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer250c19ad/blob1copy +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:33:28 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer250c19ad/blob1copy + response: + body: + string: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + headers: + accept-ranges: bytes + content-length: '1024' + content-range: bytes 0-1023/1024 + content-type: application/octet-stream + date: Fri, 04 Jun 2021 03:33:28 GMT + etag: '"0x8D9270985009D5C"' + last-modified: Fri, 04 Jun 2021 03:33:28 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: yaNM/IXZgmmMasifdgcavQ== + x-ms-blob-type: BlockBlob + x-ms-copy-completion-time: Fri, 04 Jun 2021 03:33:28 GMT + x-ms-copy-id: 87477c2c-1b83-445c-810c-05c5ea58f10e + x-ms-copy-progress: 1024/1024 + x-ms-copy-source: https://seanoauthstage.blob.core.windows.net/utcontainer250c19ad/blob250c19ad + x-ms-copy-status: success + x-ms-creation-time: Fri, 04 Jun 2021 03:33:28 GMT + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 03:33:33 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'true' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:33:28.9234780Z' + status: + code: 206 + message: Partial Content + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer250c19ad/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer250c19ad?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 03:33:28 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/utcontainer250c19ad?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_download_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_download_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..9045f957222f --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_download_blob_with_immutability_policy.yaml @@ -0,0 +1,267 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:42:50 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8e401b4a?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: Fri, 04 Jun 2021 03:42:50 GMT + etag: '"0x8D9270AD3F556EC"' + last-modified: Fri, 04 Jun 2021 03:42:50 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/utcontainer8e401b4a?restype=container&timeout=5 +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer8e401b4a?api-version=2021-04-01 + response: + body: + string: !!binary | + H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl + VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8Xs + o0cf3W3Wk2ZaF6u2qJbN3Um2f3+yd+/edr6Xn2/v7376cPvgYOdge/9hPtmZHeSTbGd2t86bal1P + 88/rar1q7v7eJ2WRL9u7q7q6LGZ53dz9opjWVVOdt+PXbVVnF/ndRn4eT6fVetk2d5s8W1bZup03 + LX18d1JWk9d5fVlM8+buLD/P1mV7d1ot26xYAuBleWX/Osj3d3Yn+9lHo4+W2SKnMQx8216v8O3N + yAS9W0gNgaAhrfK6LfLmo0dEsMVi3WaTMldA3y3a+U9SQ6JcsbxAi3yJr4mubb3Of8noo1le5i3+ + Ps/KJh99VOcLgk2NX9HHS5D8aXZNsHdGH82z5kzgF2XRXr+symJ6bV+kb5/nF1n57ao00H7JL/l/ + ADS4My/DAQAA + headers: + cache-control: no-cache + content-encoding: gzip + content-type: application/json + date: Fri, 04 Jun 2021 03:42:53 GMT + etag: '"0x8D9270AD5685B50"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + vary: Accept-Encoding + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/vlwcontainer8e401b4a?api-version=2021-04-01 +- request: + body: abcedfg + headers: + Accept: + - application/xml + Content-Length: + - '7' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:42:53 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:42:58 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a + response: + body: + string: '' + headers: + content-md5: 3eUGUzgtctuRaJEq8fjAHg== + date: Fri, 04 Jun 2021 03:42:53 GMT + etag: '"0x8D9270AD59C9502"' + last-modified: Fri, 04 Jun 2021 03:42:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-content-crc64: mI9QQJ+DEzc= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:42:53.6610834Z' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:42:53 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a + response: + body: + string: abcedfg + headers: + accept-ranges: bytes + content-length: '7' + content-range: bytes 0-6/7 + content-type: application/octet-stream + date: Fri, 04 Jun 2021 03:42:53 GMT + etag: '"0x8D9270AD59C9502"' + last-modified: Fri, 04 Jun 2021 03:42:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: 3eUGUzgtctuRaJEq8fjAHg== + x-ms-blob-type: BlockBlob + x-ms-creation-time: Fri, 04 Jun 2021 03:42:53 GMT + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 03:42:58 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'true' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:42:53.6610834Z' + status: + code: 206 + message: Partial Content + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:42:53 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a + response: + body: + string: "\uFEFFBlobImmutableDueToLegalHoldThis + operation is not permitted as the blob is immutable due to one or more legal + holds.\nRequestId:beffd37e-401e-0021-09f3-58bb8d000000\nTime:2021-06-04T03:42:53.8625983Z" + headers: + content-length: '284' + content-type: application/xml + date: Fri, 04 Jun 2021 03:42:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: BlobImmutableDueToLegalHold + x-ms-version: '2020-10-02' + status: + code: 409 + message: This operation is not permitted as the blob is immutable due to one + or more legal holds. + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:42:53 GMT + x-ms-legal-hold: + - 'false' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a?comp=legalhold + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 03:42:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-legal-hold: 'false' + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a?comp=legalhold +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:42:53 GMT + x-ms-version: + - '2020-10-02' + method: DELETE + uri: https://storagename.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a?comp=immutabilityPolicies + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 03:42:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer8e401b4a/vlwblob8e401b4a?comp=immutabilityPolicies +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer8e401b4a?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 03:42:54 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/utcontainer8e401b4a?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_list_blobs_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_list_blobs_with_immutability_policy.yaml new file mode 100644 index 000000000000..f8737b445f88 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_list_blobs_with_immutability_policy.yaml @@ -0,0 +1,164 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:37:15 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer40161a21?restype=container&timeout=5 + response: + body: + string: '' + headers: + date: Fri, 04 Jun 2021 03:37:15 GMT + etag: '"0x8D9270A0C4E9EFE"' + last-modified: Fri, 04 Jun 2021 03:37:15 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-10-02' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/utcontainer40161a21?restype=container&timeout=5 +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer40161a21?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer40161a21","name":"vlwcontainer40161a21","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: no-cache + content-length: '451' + content-type: application/json + date: Fri, 04 Jun 2021 03:37:16 GMT + etag: '"0x8D9270A0CED3E22"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1198' + status: + code: 201 + message: Created + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/vlwcontainer40161a21?api-version=2021-04-01 +- request: + body: abcedfg + headers: + Accept: + - application/xml + Content-Length: + - '7' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 04 Jun 2021 03:37:17 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 03:37:22 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer40161a21/vlwblob40161a21 + response: + body: + string: '' + headers: + content-md5: 3eUGUzgtctuRaJEq8fjAHg== + date: Fri, 04 Jun 2021 03:37:16 GMT + etag: '"0x8D9270A0D10AE40"' + last-modified: Fri, 04 Jun 2021 03:37:17 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-content-crc64: mI9QQJ+DEzc= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T03:37:17.1999052Z' + status: + code: 201 + message: Created + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer40161a21/vlwblob40161a21 +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 03:37:17 GMT + x-ms-version: + - '2020-10-02' + method: GET + uri: https://storagename.blob.core.windows.net/vlwcontainer40161a21?restype=container&comp=list&include=immutabilitypolicy,legalhold + response: + body: + string: "\uFEFFvlwblob40161a212021-06-04T03:37:17.1999052ZtrueFri, + 04 Jun 2021 03:37:17 GMTFri, 04 Jun 2021 03:37:17 + GMT0x8D9270A0D10AE407application/octet-stream3eUGUzgtctuRaJEq8fjAHg==BlockBlobHottrueunlockedavailabletrueFri, + 04 Jun 2021 03:37:22 GMTunlockedtrue" + headers: + content-type: application/xml + date: Fri, 04 Jun 2021 03:37:16 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-10-02' + status: + code: 200 + message: OK + url: https://seanoauthstage.blob.core.windows.net/vlwcontainer40161a21?restype=container&comp=list&include=immutabilitypolicy,legalhold +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer40161a21?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 03:37:17 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14998' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanoauthstage/blobServices/default/containers/utcontainer40161a21?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_get_container_properties.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_get_container_properties.yaml index 82c54f21d97e..d0940b45bc99 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_get_container_properties.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_get_container_properties.yaml @@ -3,7 +3,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/xml Accept-Encoding: - gzip, deflate Connection: @@ -11,11 +11,11 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: PUT uri: https://storagename.blob.core.windows.net/container9840123e?restype=container response: @@ -25,15 +25,15 @@ interactions: content-length: - '0' date: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT etag: - - '"0x8D75974FAB94E4D"' + - '"0x8D926F235BE42FB"' last-modified: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2019-02-02' + - '2020-10-02' status: code: 201 message: Created @@ -41,7 +41,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/xml Accept-Encoding: - gzip, deflate Connection: @@ -49,15 +49,15 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT x-ms-meta-hello: - world x-ms-meta-number: - '42' x-ms-version: - - '2019-02-02' + - '2020-10-02' method: PUT uri: https://storagename.blob.core.windows.net/container9840123e?restype=container&comp=metadata response: @@ -67,15 +67,15 @@ interactions: content-length: - '0' date: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT etag: - - '"0x8D75974FAC24A4E"' + - '"0x8D926F235CCC105"' last-modified: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2019-02-02' + - '2020-10-02' status: code: 200 message: OK @@ -83,17 +83,17 @@ interactions: body: null headers: Accept: - - '*/*' + - application/xml Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: GET uri: https://storagename.blob.core.windows.net/container9840123e?restype=container response: @@ -103,11 +103,11 @@ interactions: content-length: - '0' date: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT etag: - - '"0x8D75974FAC24A4E"' + - '"0x8D926F235CCC105"' last-modified: - - Fri, 25 Oct 2019 17:58:45 GMT + - Fri, 04 Jun 2021 00:46:37 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-default-encryption-scope: @@ -118,6 +118,8 @@ interactions: - 'false' x-ms-has-legal-hold: - 'false' + x-ms-immutable-storage-with-versioning-enabled: + - 'false' x-ms-lease-state: - available x-ms-lease-status: @@ -127,7 +129,7 @@ interactions: x-ms-meta-number: - '42' x-ms-version: - - '2019-02-02' + - '2020-10-02' status: code: 200 message: OK diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_list_containers.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_list_containers.yaml index 5ab72efe679e..3da4498ca96d 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_list_containers.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_list_containers.yaml @@ -3,7 +3,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/xml Accept-Encoding: - gzip, deflate Connection: @@ -11,32 +11,33 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:59:39 GMT + - Thu, 03 Jun 2021 03:18:16 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: PUT uri: https://storagename.blob.core.windows.net/container4760e81?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:e54c3998-801e-0009-1527-5891f4000000\nTime:2021-06-03T03:18:16.7641480Z" headers: content-length: - - '0' + - '230' + content-type: + - application/xml date: - - Fri, 25 Oct 2019 17:59:38 GMT - etag: - - '"0x8D759751AF08601"' - last-modified: - - Fri, 25 Oct 2019 17:59:39 GMT + - Thu, 03 Jun 2021 03:18:16 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists x-ms-version: - - '2019-02-02' + - '2020-10-02' status: - code: 201 - message: Created + code: 409 + message: The specified container already exists. - request: body: null headers: @@ -47,60 +48,125 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:59:39 GMT + - Thu, 03 Jun 2021 03:18:18 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: GET - uri: https://storagename.blob.core.windows.net/?comp=list + uri: https://storagename.blob.core.windows.net/?comp=list&include= response: body: string: "\uFEFFcontainer11d00ec6Fri, - 25 Oct 2019 17:58:37 GMT\"0x8D75974F64FBE9F\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer1e4e193bFri, - 25 Oct 2019 17:58:53 GMT\"0x8D75974FF5A1986\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer1ea014b6Fri, - 25 Oct 2019 17:58:53 GMT\"0x8D75974FF965A89\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainer202c14d1Fri, - 25 Oct 2019 17:58:44 GMT\"0x8D75974FA1D3109\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainer21340f21Fri, - 25 Oct 2019 17:58:44 GMT\"0x8D75974F9F6D2D3\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer40320ffdFri, - 25 Oct 2019 17:58:39 GMT\"0x8D75974F735127E\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer4760e81Fri, - 25 Oct 2019 17:59:39 GMT\"0x8D759751AF08601\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer4ef015fdFri, - 25 Oct 2019 17:59:37 GMT\"0x8D7597519C8AAB2\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer617e10e3Fri, - 25 Oct 2019 17:58:42 GMT\"0x8D75974F8E69A1C\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer61f210d7Fri, - 25 Oct 2019 17:59:19 GMT\"0x8D759750F1EFF99\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainer70e51ab2Fri, - 25 Oct 2019 17:58:39 GMT\"0x8D75974F7129DD8\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsecontainer73581132Fri, - 25 Oct 2019 17:58:44 GMT\"0x8D75974FA567586\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer73941128Fri, - 25 Oct 2019 17:59:36 GMT\"0x8D7597518ECA775\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer75091165Fri, - 25 Oct 2019 17:59:38 GMT\"0x8D759751AA86553\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer77341677Fri, - 25 Oct 2019 17:58:46 GMT\"0x8D75974FB38420F\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer781721d1Fri, - 25 Oct 2019 17:58:38 GMT\"0x8D75974F6703E3A\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer8f3e16e2Fri, - 25 Oct 2019 17:58:45 GMT\"0x8D75974FA8D2376\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainer9840123eFri, - 25 Oct 2019 17:58:45 GMT\"0x8D75974FAC24A4E\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainerab171296Fri, - 25 Oct 2019 17:59:36 GMT\"0x8D75975192888AC\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainerc01c0c5dFri, - 25 Oct 2019 17:59:35 GMT\"0x8D7597518B2735F\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainerc031481Fri, - 25 Oct 2019 17:58:38 GMT\"0x8D75974F69CF8F1\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainerc09017d7Fri, - 25 Oct 2019 17:59:35 GMT\"0x8D75975187E5ED8\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainerc2ce17eeFri, - 25 Oct 2019 17:58:45 GMT\"0x8D75974FAF378A6\"unlockedbroken$account-encryption-keyfalsefalsefalsecontainerd2991398Fri, - 25 Oct 2019 17:59:38 GMT\"0x8D759751A582601\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainerd2a01376Fri, - 25 Oct 2019 17:58:37 GMT\"0x8D75974F620D13F\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainere23113a2Fri, - 25 Oct 2019 17:58:46 GMT\"0x8D75974FB7688FE\"unlockedbroken$account-encryption-keyfalsefalsefalsecontainere26513acFri, - 25 Oct 2019 17:58:40 GMT\"0x8D75974F78B6C41\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainere54813d5Fri, - 25 Oct 2019 17:59:36 GMT\"0x8D75975197B6CE2\"unlockedavailable$account-encryption-keyfalsefalsefalsecontaineref7b188eFri, - 25 Oct 2019 17:58:38 GMT\"0x8D75974F6CB5203\"unlockedavailableblob$account-encryption-keyfalsefalsefalsecontainerf3fe18d5Fri, - 25 Oct 2019 17:59:37 GMT\"0x8D759751A0FBAD0\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainerf7d9143cFri, - 25 Oct 2019 17:59:19 GMT\"0x8D759750F527BDB\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsecontainer1232Wed, + 26 May 2021 04:57:39 GMT\"0x8D92002C9EF4317\"unlockedavailable$account-encryption-keyfalsefalsefalsetruecontainer4760e81Thu, + 03 Jun 2021 03:05:26 GMT\"0x8D9263C6FC3AD51\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-0018bb70-122d-49e8-87a4-605d96d0b859Thu, + 18 Mar 2021 19:24:24 GMT\"0x8D8EA4370982563\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-04bee97f-b374-4977-8759-17120d920e93Thu, + 18 Mar 2021 16:14:12 GMT\"0x8D8EA28DEAA72E5\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-0c54779f-6523-40f9-84f3-ff87adcb904aThu, + 18 Mar 2021 15:55:24 GMT\"0x8D8EA263E04B4C2\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-0d69218f-f854-4add-8e4e-69e6415e8be4Thu, + 18 Mar 2021 15:53:40 GMT\"0x8D8EA260022684A\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-0e48f1d5-78b4-45e1-9487-9a84c618b6feTue, + 23 Mar 2021 23:00:37 GMT\"0x8D8EE4F790CFB23\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-1072597a-d9d8-4d68-ba4b-4d3d127a617fTue, + 23 Mar 2021 23:27:10 GMT\"0x8D8EE532E8ACF5B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-1772b686-a76e-4b4c-8a2b-68880c20c11dMon, + 29 Mar 2021 22:20:22 GMT\"0x8D8F300D7FB103C\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-17e17044-cc9e-4971-bb4c-6fdf5fae3464Thu, + 18 Mar 2021 19:21:58 GMT\"0x8D8EA431956D827\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-1874d400-6f54-45a8-b1cc-bf9b1d474282Wed, + 24 Mar 2021 17:05:18 GMT\"0x8D8EEE70057A86C\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-1c31ccb2-9938-4616-ad6d-52aa59e078d7Thu, + 18 Mar 2021 15:55:21 GMT\"0x8D8EA263C955567\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-1d7100c4-e51b-4621-a003-9e0d7d11c770Tue, + 23 Mar 2021 23:25:37 GMT\"0x8D8EE52F7534FF3\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-21eb328e-5df9-4e14-9884-26e6661ff71cFri, + 19 Mar 2021 18:15:31 GMT\"0x8D8EB02FB5C746A\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-289f11a9-f1cc-4edf-8ff7-3b141460fe06Thu, + 18 Mar 2021 16:35:03 GMT\"0x8D8EA2BC8303BA0\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-291ba3bc-93e7-4506-bf07-575bbb47c8e7Thu, + 18 Mar 2021 16:15:50 GMT\"0x8D8EA29191E129B\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-2a18f6d1-9fdf-447e-b3aa-24b6f9aef614Tue, + 23 Mar 2021 23:25:35 GMT\"0x8D8EE52F5D17CFC\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-2a6d0743-3868-424c-9c3f-8679977ae6a3Wed, + 17 Mar 2021 21:06:27 GMT\"0x8D8E98887CA6E38\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-2c7b7632-cad8-4e97-925d-6ead27a857ccWed, + 28 Apr 2021 17:36:14 GMT\"0x8D90A6C1F332AF9\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-3015f4ec-ae33-4c36-b75b-cae73a3d0e7bTue, + 23 Mar 2021 23:21:57 GMT\"0x8D8EE527413A9A9\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-30481731-6ce2-470a-a2dc-c44f6b3a5c27Mon, + 22 Mar 2021 22:31:33 GMT\"0x8D8ED823F1C0FCA\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-3309002d-1581-43ba-8b6e-0042cf66e7d7Thu, + 18 Mar 2021 19:23:44 GMT\"0x8D8EA4358A271D6\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-37249450-0970-47f5-b829-ab7a6279b2c4Thu, + 18 Mar 2021 15:53:37 GMT\"0x8D8EA25FEA54F77\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-3abedadd-28af-45a4-8b13-ef9394d5b0feMon, + 22 Mar 2021 22:23:05 GMT\"0x8D8ED81106DA5F1\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-3e949a88-b1c8-44d8-8e34-589c57062c39Mon, + 22 Mar 2021 22:50:30 GMT\"0x8D8ED84E4FA4098\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-410fdb09-7d3c-432e-9702-c4704232a34cThu, + 18 Mar 2021 18:33:25 GMT\"0x8D8EA3C51633001\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-4501f0cb-3ca4-42fe-8c65-ca18ee3d6a9dWed, + 28 Apr 2021 17:37:10 GMT\"0x8D90A6C408FD2E1\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-46a11020-d715-42e5-8f9c-2e260472cc87Tue, + 23 Mar 2021 23:30:12 GMT\"0x8D8EE539B29983C\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-4d99785b-cb69-4204-b910-5371cf830d9cFri, + 19 Mar 2021 18:14:21 GMT\"0x8D8EB02D18FDE7F\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-4e52c1b9-1a2b-4b5c-9d5c-a7ce6a1fa6faTue, + 23 Mar 2021 23:14:35 GMT\"0x8D8EE516C74C516\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-4f6d0e44-b071-4b6b-ad4b-5c3a6ae2048dThu, + 18 Mar 2021 19:26:09 GMT\"0x8D8EA43AF2BE5CB\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-4fa8ce2f-1cd0-4e6f-a0c5-3b9f05bae94aFri, + 19 Mar 2021 19:45:59 GMT\"0x8D8EB0F9EE36CF7\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-55599575-1c32-4540-9f91-199734005c55Mon, + 22 Mar 2021 20:44:51 GMT\"0x8D8ED73579F2B10\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-57cc3783-804c-4af9-a596-3d66fcaf326eThu, + 18 Mar 2021 16:01:21 GMT\"0x8D8EA2712D28B8D\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-58ed191e-fecb-4260-9f85-b5e0640b778cThu, + 18 Mar 2021 19:19:49 GMT\"0x8D8EA42CC8AB16E\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-599a92cf-ed06-4bc8-bb6e-f54c7dcbb000Fri, + 19 Mar 2021 19:54:02 GMT\"0x8D8EB10BE7C3307\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-5ae63cbb-58c0-4458-aa99-5079fc540a19Fri, + 26 Mar 2021 18:03:05 GMT\"0x8D8F08167C7B3BD\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-5c414fab-98b6-40b6-b946-701f3ff1501fMon, + 22 Mar 2021 20:42:04 GMT\"0x8D8ED72F3A32CE6\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-5eec2ff6-fa28-4ab0-9b41-9f8d25599e4fMon, + 22 Mar 2021 22:32:04 GMT\"0x8D8ED82516A862E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-61493a11-794f-4811-adfa-c7b2b6de2156Thu, + 18 Mar 2021 19:26:52 GMT\"0x8D8EA43C9043EF7\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-64fc9af6-19e5-4a3e-828a-5133728761a5Mon, + 22 Mar 2021 20:43:05 GMT\"0x8D8ED731838545D\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-6db310fd-4b30-4c3e-99ad-ece2f7ed26ddTue, + 23 Mar 2021 23:22:01 GMT\"0x8D8EE52765C58B9\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-6ecb4cb7-f8b3-44a3-8bba-b94f6e4a637dThu, + 18 Mar 2021 19:16:19 GMT\"0x8D8EA424F49592D\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-6f8ebe40-bfb2-45c3-966b-3bf447c2d069Thu, + 18 Mar 2021 18:35:57 GMT\"0x8D8EA3CAC1EFEBD\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-716c4756-9241-4a0a-9695-63530053e7ccThu, + 18 Mar 2021 15:57:48 GMT\"0x8D8EA2693CD2D7E\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-727ab853-81d5-44ea-9729-ae78dd668c63Thu, + 18 Mar 2021 18:27:14 GMT\"0x8D8EA3B74561874\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-72f1e956-b332-45cc-9c38-1657b1235445Tue, + 23 Mar 2021 23:08:56 GMT\"0x8D8EE50A269C5D7\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-73592b07-ba45-4683-8db7-29d6fd615f87Thu, + 18 Mar 2021 16:01:35 GMT\"0x8D8EA271B4A7A97\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-75ee72c7-bfc7-406a-af20-26b037eacb02Thu, + 18 Mar 2021 16:08:40 GMT\"0x8D8EA28188975EC\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-76365c04-21f6-43e5-9f24-2b0fa37e4512Fri, + 19 Mar 2021 20:16:23 GMT\"0x8D8EB13DE1DA50B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-7a32d8ab-7d6e-49c8-a1f7-acb6f5f07a7fTue, + 23 Mar 2021 23:02:57 GMT\"0x8D8EE4FCC7A19BB\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-7e759919-663b-45e4-8cc2-04152283b77fThu, + 18 Mar 2021 19:34:39 GMT\"0x8D8EA44DF391B10\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-8afb4a83-c592-4240-8425-5235ffab304cThu, + 18 Mar 2021 18:26:09 GMT\"0x8D8EA3B4D2D6049\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-8e1afbb0-e654-42c0-9f20-2be3e758d2aaThu, + 18 Mar 2021 18:33:39 GMT\"0x8D8EA3C599BD44F\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-90ac2512-a27b-4f16-af23-dd26a41a1903Wed, + 24 Mar 2021 17:38:34 GMT\"0x8D8EEEBA5E43E6D\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-90cb2b46-dee2-4487-9121-6f9df8af0440Thu, + 18 Mar 2021 15:55:07 GMT\"0x8D8EA2633E4D101\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-95445de7-cc2e-41b2-9f09-fd6fd0826cd8Thu, + 18 Mar 2021 15:54:13 GMT\"0x8D8EA2613AF4C7A\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-9f11db45-f9e9-42d4-9a39-a042756d2659Thu, + 18 Mar 2021 20:58:16 GMT\"0x8D8EA508DA38AC2\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-9f190e1e-204c-4aa9-b3e1-4f1f9dda7359Thu, + 18 Mar 2021 15:55:28 GMT\"0x8D8EA264092A046\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-a003c5fc-f1ae-4481-9574-f2fee041499fTue, + 23 Mar 2021 23:16:46 GMT\"0x8D8EE51BAAE1B5A\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-a2d1aa0e-ee8d-47fb-b03e-4ac24cad57d0Mon, + 22 Mar 2021 20:44:13 GMT\"0x8D8ED7340F10D8F\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-a3e93887-3ee6-4a8c-a9a3-0509e3fe1761Wed, + 28 Apr 2021 17:36:11 GMT\"0x8D90A6C1DA2DA6B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-a7383557-0604-42d4-a58f-e1d2044a98dfThu, + 18 Mar 2021 16:08:20 GMT\"0x8D8EA280CCE71A3\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-a9f08824-4e7b-4ea1-85f7-b96f68a19387Fri, + 19 Mar 2021 19:57:10 GMT\"0x8D8EB112EEFFB3A\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-ace7efc3-bf86-45cd-9e83-1d850a8f534aThu, + 18 Mar 2021 15:55:26 GMT\"0x8D8EA263F3232D4\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-ae5841c6-1fbe-4b09-869c-61411bd74780Thu, + 18 Mar 2021 17:59:42 GMT\"0x8D8EA379B9AA940\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-b42053be-68c8-4d37-a734-9c9002999628Fri, + 19 Mar 2021 20:04:37 GMT\"0x8D8EB123974C425\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-bf55c4d1-fc50-47e8-abfd-d81726920257Fri, + 19 Mar 2021 19:52:26 GMT\"0x8D8EB10858A76C1\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-ca63513e-e2cd-42aa-a4c2-fb0e69e48875Thu, + 18 Mar 2021 19:37:54 GMT\"0x8D8EA45531A716C\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-cafcfd85-8874-4f81-b89e-761da72fc7b2Thu, + 18 Mar 2021 18:34:29 GMT\"0x8D8EA3C774561EF\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-cba5912b-f411-44c9-beeb-1c96091545b4Thu, + 18 Mar 2021 19:20:32 GMT\"0x8D8EA42E642BA07\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-cc0736ed-f582-424c-b09e-ce3fb853ad1eThu, + 18 Mar 2021 15:53:42 GMT\"0x8D8EA2601522FDD\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-cc5a6466-584e-4a95-9f92-63ef3c71d9c6Fri, + 30 Apr 2021 18:06:46 GMT\"0x8D90C02B7D0938F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-d29bc6a7-5d67-453a-93cc-e78be0dc66bbThu, + 18 Mar 2021 17:57:48 GMT\"0x8D8EA3757C1631F\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-d46ee5e1-ca72-4de2-bb15-718815562061Fri, + 19 Mar 2021 19:47:18 GMT\"0x8D8EB0FCDF3ABE3\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-d52a7ce3-2545-4c05-a98e-b7aa47adb6e5Thu, + 18 Mar 2021 20:32:29 GMT\"0x8D8EA4CF3AED3B9\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-dd88b31d-348d-47ad-8776-035925900d79Mon, + 22 Mar 2021 20:46:44 GMT\"0x8D8ED739A621A24\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-de17f349-ede7-43fc-bc42-09d0146d377dFri, + 19 Mar 2021 19:51:10 GMT\"0x8D8EB10581CAD63\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-dec428c1-36ce-44bb-8b58-0c414ec05e5dThu, + 18 Mar 2021 19:18:21 GMT\"0x8D8EA42983E1F39\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-ef2e9492-d67e-4fe1-9238-6226544b5765Thu, + 18 Mar 2021 19:19:18 GMT\"0x8D8EA42B9E0B7FC\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-ef3cb093-97fc-4354-a7d8-ade90d4c9dc5Thu, + 18 Mar 2021 15:53:44 GMT\"0x8D8EA260281A955\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-ef6b1ca6-e256-46f9-987b-fb15bf2783deFri, + 19 Mar 2021 20:12:55 GMT\"0x8D8EB1361DF44F3\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-f00d3d5d-7dae-4bfa-85fb-79d26d9b664fThu, + 18 Mar 2021 16:04:26 GMT\"0x8D8EA27817C577C\"unlockedavailable$account-encryption-keyfalsefalsefalsetruetest-container-f1c6cd1c-5ca0-4f5a-8aca-95900e41b6cfTue, + 23 Mar 2021 23:27:07 GMT\"0x8D8EE532D17A034\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetruetest-container-f25bb0be-2eb4-4985-b6b0-d800581295ddMon, + 22 Mar 2021 22:31:07 GMT\"0x8D8ED822F9EC528\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsetrueutcontaineraac312a8Tue, + 01 Jun 2021 22:15:06 GMT\"0x8D9254AB6750C45\"unlockedavailable$account-encryption-keyfalsetruefalsefalseutcontainerecd618bcWed, + 02 Jun 2021 23:59:26 GMT\"0x8D9262273F8D67C\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersourceecd618bcWed, + 02 Jun 2021 23:59:26 GMT\"0x8D9262274166C4D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsevlwcontainer1f2c0efdWed, + 02 Jun 2021 22:00:26 GMT\"0x8D92611D45B3949\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainer775416bcThu, + 03 Jun 2021 01:22:09 GMT\"0x8D9262E021745D9\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainer90f61730Thu, + 03 Jun 2021 02:46:53 GMT\"0x8D92639D850B979\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainera98317a4Thu, + 03 Jun 2021 03:03:22 GMT\"0x8D9263C25A1EC69\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainerbba812fbWed, + 02 Jun 2021 21:22:19 GMT\"0x8D9260C810B9223\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainerbd114a6Wed, + 02 Jun 2021 21:20:57 GMT\"0x8D9260C503EBDEF\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainerecd618bcThu, + 03 Jun 2021 00:28:14 GMT\"0x8D9262679E79044\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainerf03618cdThu, + 03 Jun 2021 01:21:32 GMT\"0x8D9262DEC19DFE6\"unlockedavailable$account-encryption-keyfalsefalsefalsetrue" headers: content-type: - application/xml date: - - Fri, 25 Oct 2019 17:59:38 GMT + - Thu, 03 Jun 2021 03:18:17 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked x-ms-version: - - '2019-02-02' + - '2020-10-02' status: code: 200 message: OK diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_get_container_properties.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_get_container_properties.yaml index 77a525adcf55..592443daa0fb 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_get_container_properties.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_get_container_properties.yaml @@ -2,109 +2,95 @@ interactions: - request: body: null headers: + Accept: + - application/xml User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:59:54 GMT + - Fri, 04 Jun 2021 03:39:25 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: PUT uri: https://storagename.blob.core.windows.net/acontaineredc14bb?restype=container response: body: string: '' headers: - content-length: '0' - date: Fri, 25 Oct 2019 17:59:54 GMT - etag: '"0x8D7597523E92018"' - last-modified: Fri, 25 Oct 2019 17:59:54 GMT + date: Fri, 04 Jun 2021 03:39:26 GMT + etag: '"0x8D9270A5A0A2776"' + last-modified: Fri, 04 Jun 2021 03:39:26 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-02-02' + transfer-encoding: chunked + x-ms-version: '2020-10-02' status: code: 201 message: Created - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pyacrstoragekzoj3d7n4a5m.blob.core.windows.net - - /acontaineredc14bb - - restype=container - - '' + url: https://seanoauthstage.blob.core.windows.net/acontaineredc14bb?restype=container - request: body: null headers: + Accept: + - application/xml User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:59:54 GMT + - Fri, 04 Jun 2021 03:39:26 GMT x-ms-meta-hello: - world x-ms-meta-number: - '42' x-ms-version: - - '2019-02-02' + - '2020-10-02' method: PUT uri: https://storagename.blob.core.windows.net/acontaineredc14bb?restype=container&comp=metadata response: body: string: '' headers: - content-length: '0' - date: Fri, 25 Oct 2019 17:59:54 GMT - etag: '"0x8D7597523EEFF82"' - last-modified: Fri, 25 Oct 2019 17:59:54 GMT + date: Fri, 04 Jun 2021 03:39:26 GMT + etag: '"0x8D9270A5A178240"' + last-modified: Fri, 04 Jun 2021 03:39:26 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-02-02' + transfer-encoding: chunked + x-ms-version: '2020-10-02' status: code: 200 message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pyacrstoragekzoj3d7n4a5m.blob.core.windows.net - - /acontaineredc14bb - - restype=container&comp=metadata - - '' + url: https://seanoauthstage.blob.core.windows.net/acontaineredc14bb?restype=container&comp=metadata - request: body: null headers: + Accept: + - application/xml User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 17:59:54 GMT + - Fri, 04 Jun 2021 03:39:26 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: GET uri: https://storagename.blob.core.windows.net/acontaineredc14bb?restype=container response: body: string: '' headers: - content-length: '0' - date: Fri, 25 Oct 2019 17:59:54 GMT - etag: '"0x8D7597523EEFF82"' - last-modified: Fri, 25 Oct 2019 17:59:54 GMT + date: Fri, 04 Jun 2021 03:39:26 GMT + etag: '"0x8D9270A5A178240"' + last-modified: Fri, 04 Jun 2021 03:39:26 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked x-ms-default-encryption-scope: $account-encryption-key x-ms-deny-encryption-scope-override: 'false' x-ms-has-immutability-policy: 'false' x-ms-has-legal-hold: 'false' + x-ms-immutable-storage-with-versioning-enabled: 'false' x-ms-lease-state: available x-ms-lease-status: unlocked x-ms-meta-hello: world x-ms-meta-number: '42' - x-ms-version: '2019-02-02' + x-ms-version: '2020-10-02' status: code: 200 message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pyacrstoragekzoj3d7n4a5m.blob.core.windows.net - - /acontaineredc14bb - - restype=container - - '' + url: https://seanoauthstage.blob.core.windows.net/acontaineredc14bb?restype=container version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_list_containers.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_list_containers.yaml index b5bfd6860bcc..e813807498ee 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_list_containers.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_list_containers.yaml @@ -2,12 +2,14 @@ interactions: - request: body: null headers: + Accept: + - application/xml User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 18:00:48 GMT + - Fri, 04 Jun 2021 00:46:12 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: PUT uri: https://storagename.blob.core.windows.net/acontainer649e10fe?restype=container response: @@ -15,88 +17,380 @@ interactions: string: '' headers: content-length: '0' - date: Fri, 25 Oct 2019 18:00:47 GMT - etag: '"0x8D7597543F7A379"' - last-modified: Fri, 25 Oct 2019 18:00:48 GMT + date: Fri, 04 Jun 2021 00:46:12 GMT + etag: '"0x8D926F226C4021A"' + last-modified: Fri, 04 Jun 2021 00:46:12 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-02-02' + x-ms-version: '2020-10-02' status: code: 201 message: Created - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pyacrstoragekzoj3d7n4a5m.blob.core.windows.net - - /acontainer649e10fe - - restype=container - - '' + url: https://seanmcccanary3.blob.core.windows.net/acontainer649e10fe?restype=container - request: body: null headers: Accept: - application/xml User-Agent: - - azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 25 Oct 2019 18:00:48 GMT + - Fri, 04 Jun 2021 00:46:12 GMT x-ms-version: - - '2019-02-02' + - '2020-10-02' method: GET - uri: https://storagename.blob.core.windows.net/?comp=list + uri: https://storagename.blob.core.windows.net/?comp=list&include= response: body: string: "\uFEFFacontainer13e20edaFri, - 25 Oct 2019 18:00:43 GMT\"0x8D759754159B43D\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer1bc21d2fFri, - 25 Oct 2019 17:59:48 GMT\"0x8D759752090967E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalseacontainer23b6195fFri, - 25 Oct 2019 17:59:53 GMT\"0x8D75975238F6951\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontainer24301513Fri, - 25 Oct 2019 18:00:44 GMT\"0x8D7597541C32B2F\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer50ac1615Fri, - 25 Oct 2019 18:00:47 GMT\"0x8D7597543593522\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer50b315f3Fri, - 25 Oct 2019 17:59:47 GMT\"0x8D759751FA0B50A\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontainer5a021a54Fri, - 25 Oct 2019 18:00:43 GMT\"0x8D75975412EDF55\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontainer5c401a6bFri, - 25 Oct 2019 17:59:54 GMT\"0x8D7597524172822\"unlockedbroken$account-encryption-keyfalsefalsefalseacontainer62c1161fFri, - 25 Oct 2019 17:59:55 GMT\"0x8D7597524763E06\"unlockedbroken$account-encryption-keyfalsefalsefalseacontainer62f51629Fri, - 25 Oct 2019 17:59:50 GMT\"0x8D7597521CC0DB7\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer649e10feFri, - 25 Oct 2019 18:00:48 GMT\"0x8D7597543F7A379\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer65d81652Fri, - 25 Oct 2019 18:00:45 GMT\"0x8D75975420F9B08\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer74751143Fri, - 25 Oct 2019 17:59:47 GMT\"0x8D759751FFB8B2A\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer7ae616b9Fri, - 25 Oct 2019 18:00:28 GMT\"0x8D7597537F83C20\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontainer8656119eFri, - 25 Oct 2019 17:59:52 GMT\"0x8D7597522F53DB7\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer8de71b0bFri, - 25 Oct 2019 17:59:48 GMT\"0x8D75975203E041D\"unlockedavailableblob$account-encryption-keyfalsefalsefalseacontainer917e16feFri, - 25 Oct 2019 17:59:48 GMT\"0x8D75975201A2AB1\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer926a1b52Fri, - 25 Oct 2019 18:00:46 GMT\"0x8D75975430C5A03\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainer92f18f4Fri, - 25 Oct 2019 17:59:55 GMT\"0x8D7597524499868\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainera6981733Fri, - 25 Oct 2019 18:00:02 GMT\"0x8D75975287392F3\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontainera824174eFri, - 25 Oct 2019 17:59:53 GMT\"0x8D7597523204AAD\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontaineraa4e127aFri, - 25 Oct 2019 17:59:49 GMT\"0x8D7597520AD2688\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainerc1a51bb8Fri, - 25 Oct 2019 18:00:01 GMT\"0x8D75975283DBE2F\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainerc2c617d8Fri, - 25 Oct 2019 18:00:45 GMT\"0x8D759754249AD33\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainerc39a1803Fri, - 25 Oct 2019 18:00:45 GMT\"0x8D7597542829EC8\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainerd0941360Fri, - 25 Oct 2019 17:59:51 GMT\"0x8D75975220EC28E\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainerd1081354Fri, - 25 Oct 2019 18:00:27 GMT\"0x8D7597537CE108E\"lockedleasedinfinite$account-encryption-keyfalsefalsefalseacontainerdbe2187aFri, - 25 Oct 2019 18:00:46 GMT\"0x8D7597542CB1456\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainere4eb13afFri, - 25 Oct 2019 17:59:53 GMT\"0x8D759752365B9EC\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainere50b1c8cFri, - 25 Oct 2019 17:59:47 GMT\"0x8D759751FD95E8A\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainere52713a5Fri, - 25 Oct 2019 18:00:44 GMT\"0x8D75975418CB9B9\"unlockedavailable$account-encryption-keyfalsefalsefalseacontainere69c13e2Fri, - 25 Oct 2019 18:00:47 GMT\"0x8D7597543A086D9\"unlockedavailable$account-encryption-keyfalsefalsefalseacontaineredc14bbFri, - 25 Oct 2019 17:59:54 GMT\"0x8D7597523EEFF82\"unlockedavailable$account-encryption-keyfalsefalsefalse$webThu, + 05 Nov 2020 01:02:27 GMT\"0x8D88126770E6074\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse000Wed, + 16 Dec 2020 21:43:19 GMT\"0x8D8A20B9A659CE4\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse026505a70026505a7e5e3395237f733ef9cb44667977Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEE68FA4\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse06021594006021594bc390078182c95e659b8475cbceTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEB0D84F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse09578df3009578df35ca80527813a7cbf7454411dba4Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465A9316\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse0adb43840adb43844fe229566e97219e3f0c4d0d87Tue, + 01 Jun 2021 18:57:08 GMT\"0x8D9252F0EB27A44\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse0adb43840adb4384cb84529420abe8b28c9e40b285Tue, + 01 Jun 2021 18:30:49 GMT\"0x8D9252B60FD8977\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse0adb43840adb4384cfe1922295bffdbf06044f48a1Tue, + 01 Jun 2021 19:09:47 GMT\"0x8D92530D2DC99CE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse0ca24d1e00ca24d1ec5f88195d747792dfa284370aacTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FED085FE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse104cbcb20104cbcb24da8593791f7ec3b9aaf4b5f8efFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B3708\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse19e94ac4019e94ac47a73487613f7b130b02d4e48927Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B1841\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse209f0ce6-78d8-4aae-8047-c60ad1ddb6f4Thu, + 13 May 2021 23:15:33 GMT\"0x8D9166502826175\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse23d18a5b-4f37-4283-9f8c-f7defc5d6e13Fri, + 14 May 2021 21:32:24 GMT\"0x8D9171FC3DD8A44\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse268f66910268f66913b643368ab2bb8ed98c9429d810Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE83CCCF\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse284c031a0284c031af3150319558ddf1017e148d0b15Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FF0D1291\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse2ce09900-a697-4a99-8336-f325bfb6c74fWed, + 03 Mar 2021 00:47:48 GMT\"0x8D8DDDDF7CAD013\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse2da8c0cb02da8c0cbeac478815ee922b675004302ae4Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE85F447\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse2f86371502f863715c2406397a0e3f794301a4e4db03Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE29491C\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse30b294ff-22cb-4b48-a4f7-2faf3c3557a3Thu, + 13 May 2021 22:04:23 GMT\"0x8D9165B116872B9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse30b6ab46030b6ab467698474588aac7edb76c4d87a1aTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEE2477E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse37972bb0037972bb063b88263fc202648f1a54462908Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEB3447E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse3d84d72f-772a-4bcc-85b2-4f47f2341132Fri, + 14 May 2021 21:44:06 GMT\"0x8D917216645B085\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse3f39a55e03f39a55e340140621579ff172a6b4127806Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE6983E9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse3f67697b03f67697b37b04720c5109e5ab45b43e19b4Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B6C02\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse42109d3e042109d3e3336425123533de7f9b342c392fFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465C0204\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse46161b34046161b3405d3063157dfea1ef2c3430b849Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AA8F5\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse49438353049438353136724825328b557026941bd826Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE4379D3\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse4a00f595-2b1f-4b5e-8f24-891d3addde3dFri, + 19 Mar 2021 17:47:26 GMT\"0x8D8EAFF0F5D282D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse4bcebfde-274a-4a69-b5bf-8c1c928b56bcThu, + 13 May 2021 21:57:48 GMT\"0x8D9165A259482D6\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse4fac601e04fac601ed9541886251154df4a724f4e92dTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEF37DAC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse4fe5dc1a-8f61-48f1-8b31-33a72315ad61Fri, + 19 Mar 2021 18:50:45 GMT\"0x8D8EB07E78DF5E5\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse51c8f405051c8f4057193578046ebc4b67639495fa10Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465ADE0F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse530bf44e0530bf44e03b171476fd2ac5c10774430a41Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE4AB3FF\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse5b0bac7f05b0bac7f40a24031fb147c2a103b46b4952Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B7A34\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse5dc0c70405dc0c704fa711955339b1390e76149afbfdTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEB712B6\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse5f0d2a7505f0d2a75e7722575cf0ac310b3224960bbeFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BA2BD\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse630db3cc-c104-4e25-8c1a-f222f9dda9e6Thu, + 13 May 2021 21:54:35 GMT\"0x8D91659B2B25489\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse63f2e025-c91a-4095-a967-3c538ac6c568Fri, + 14 May 2021 17:58:52 GMT\"0x8D91701EF3000CD\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse651bcb150651bcb157268509654e285a520fd439e815Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A4658680A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse693dcefd0693dcefd76d202294c6da63040d8417baa0Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B1312\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse69526a37069526a37755641533341806ab6904d4983eTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE86F4F8\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse6d3b48f706d3b48f71838353365949254ea884431a5eFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AF08A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse6e08620f06e08620ff5c2897533d4f28ea8c54a09babFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A4657D031\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse7026ffbc07026ffbc2ab6084244a58bc1ca1e4d53aa9Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465ABAA7\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse70495b76070495b76b1f2215099af8e91b38b49c2a1fTue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE641BD9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse71d9a559071d9a559b7398450dfb7e21cebeb4ee7800Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BC802\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse742079b60742079b6e7b72459fd766ba9be8046e4bf1Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B1338\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse7c00fa5407c00fa5438166949f14ddec10f1046d6a54Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BA7E9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse7f8d84b107f8d84b1ed924070da2ebbdb3899432c958Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A4659D5FB\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse7fa197f607fa197f666a09634ddb36b5cd3b2417c97eFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A4657C218\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse86ef12de086ef12dea5b52203f36f26764eec44b1862Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B4EF4\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse878ec03c0878ec03cde1337322fa9580591bd4675bf8Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEC835B4\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse8bc77c5b-c718-4afc-8246-0f037e07422cFri, + 14 May 2021 21:47:16 GMT\"0x8D91721D7373367\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse8cd35bf308cd35bf3207184131a19adeee0fb4cdab75Tue, + 11 May 2021 23:39:16 GMT\"0x8D914D5FD5DD483\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse8d2761ae08d2761ae6c635106dd2216cf79d240e8997Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE284B4D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse8fa3ef09-53b9-41f2-8670-e65f5cb02521Thu, + 13 May 2021 22:00:47 GMT\"0x8D9165A90729B68\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse96ba0f79-ce34-4537-9814-c24d354ae063Wed, + 03 Mar 2021 01:05:35 GMT\"0x8D8DDE073A3B003\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse9ff4239f09ff4239f29d3253397d77ad5588c46e4bbdFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AA163\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsea10702d80a10702d821176858df5746c5c8f042e096dTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEDF9AA0\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsea51b6700-cb26-4dfd-8300-a6a1f0c930e0Fri, + 14 May 2021 20:13:34 GMT\"0x8D91714C0AE3161\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseab46431a0ab46431a727605689132e71015054913b55Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B8404\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseacontainer649e10feFri, + 04 Jun 2021 00:46:12 GMT\"0x8D926F226C4021A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseacontainere4ee1c92Fri, + 04 Jun 2021 00:21:16 GMT\"0x8D926EEAB700A03\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsead761e9d0ad761e9de19058157c1e2b0fc124489691dFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BA1C6\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseadc2411d0adc2411d51c08533fe35ff9431604888839Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BAD8F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseaea265910aea26591eea67853657e470e3c6140a0b0dFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BF390\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseaf45f32e0af45f32eb4022918300f1f8f5cc6498cbadTue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE79FA45\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseb10c82a2-4f79-4aa4-84f2-e635836ad391Fri, + 14 May 2021 21:26:33 GMT\"0x8D9171EF2B0545A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseb4ca457e0b4ca457ed08754412ab1f920fcf64e16bd5Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AE385\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseb4d9705c0b4d9705ca88472602bb2892f858c4b7d958Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B9CEB\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseb73687f50b73687f518f715985a303790a98a4ee8863Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE4EC67D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseb7f8be8c0b7f8be8cbcc848927f466b49be1847c3be4Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE67E6D9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseb8dda32b0b8dda32b2ad88496ee7ef3ea8ee64e3d813Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465BA86B\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseba3500ee0ba3500eeba4874654e98e7cdff15415dae0Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE65BF41\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsebf47d00e0bf47d00e549947142efd47b03efa4b079cfTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEE8E2FC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsec7d5143c0c7d5143c09680433e62247c22b0048f4bbbTue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE6C8A50\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsec8cf56fb0c8cf56fbca7360424454ff5532e64182881Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEA8C94F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsec9ae84190c9ae841925180898b4c123440333463a96dFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B25FE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecb2c5f71-077e-4ec4-a081-fba68a061edbWed, + 03 Mar 2021 00:21:52 GMT\"0x8D8DDDA5833000D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecbe66a19-af44-47d2-8d45-4f6d3b5b2517Wed, + 03 Mar 2021 01:04:28 GMT\"0x8D8DDE04B9BBAD0\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecf31c28f-005d-43a8-8361-716253f96506Tue, + 25 May 2021 19:24:00 GMT\"0x8D91FB2A69A3FFF\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer1160577159301009756Thu, + 19 Nov 2020 07:39:54 GMT\"0x8D88C5E4E474297\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer1160587546491801745Fri, + 20 Nov 2020 12:31:06 GMT\"0x8D88D5026C9C26F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160577016253900031Thu, + 19 Nov 2020 07:16:03 GMT\"0x8D88C5AF997BCE2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160577149683805678Thu, + 19 Nov 2020 07:38:18 GMT\"0x8D88C5E1507535A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160579733155102089Thu, + 19 Nov 2020 14:48:52 GMT\"0x8D88C9A3BB42C2B\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587656253507595Fri, + 20 Nov 2020 12:49:23 GMT\"0x8D88D52B5250BB2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587656407807880Fri, + 20 Nov 2020 12:49:24 GMT\"0x8D88D52B5811684\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659351509595Fri, + 20 Nov 2020 12:49:53 GMT\"0x8D88D52C70C0ADF\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659411404376Fri, + 20 Nov 2020 12:49:54 GMT\"0x8D88D52C767F717\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659468104824Fri, + 20 Nov 2020 12:49:55 GMT\"0x8D88D52C7BE63EC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659524304238Fri, + 20 Nov 2020 12:49:55 GMT\"0x8D88D52C8148298\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659581201429Fri, + 20 Nov 2020 12:49:56 GMT\"0x8D88D52C86AEF96\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659637205982Fri, + 20 Nov 2020 12:49:56 GMT\"0x8D88D52C8C10E62\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659693801788Fri, + 20 Nov 2020 12:49:57 GMT\"0x8D88D52C9170612\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659750106840Fri, + 20 Nov 2020 12:49:57 GMT\"0x8D88D52C96C8886\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659806001209Fri, + 20 Nov 2020 12:49:58 GMT\"0x8D88D52C9C1E3DE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587659861605875Fri, + 20 Nov 2020 12:49:59 GMT\"0x8D88D52CA16A2B7\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587660278607655Fri, + 20 Nov 2020 12:50:03 GMT\"0x8D88D52CC9311D2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587662946904548Fri, + 20 Nov 2020 12:50:29 GMT\"0x8D88D52DC7BC224\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainer160587663278307340Fri, + 20 Nov 2020 12:50:33 GMT\"0x8D88D52DE75552D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainera8e61798Mon, + 24 May 2021 17:50:42 GMT\"0x8D91EDC7332E94C\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsecontainfwfddsnameFri, + 18 Dec 2020 05:42:38 GMT\"0x8D8A317BAEBD404\"unlockedavailableblob$account-encryption-keyfalsefalsefalsefalsecontainfwfdnameFri, + 18 Dec 2020 05:01:50 GMT\"0x8D8A31207D14D8E\"unlockedavailableblob$account-encryption-keyfalsefalsefalsefalsecontainfwnameFri, + 18 Dec 2020 05:00:12 GMT\"0x8D8A311CD54CFCB\"unlockedavailableblob$account-encryption-keyfalsefalsefalsefalsecontainnameFri, + 18 Dec 2020 04:59:25 GMT\"0x8D8A311B16A1819\"unlockedavailableblob$account-encryption-keyfalsefalsefalsefalsed0b5b5580d0b5b558a89813116237696cb52a4d0ea01Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AE580\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsed3b43433-f618-4390-bc8e-7c8ffa23a213Fri, + 14 May 2021 21:52:32 GMT\"0x8D9172293CB3D20\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsed427b9070d427b907909370243f0ac1cf8aac4e24b63Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AFF3B\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedc6261260dc626126f359088526cb374db1864ac49a3Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE88C18D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedc9eb9580dc9eb958e36379183d24d3c0e9224ff483bFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AAC71\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedd686d9f-2ca3-4903-8616-c23fa720b6e2Fri, + 14 May 2021 18:41:35 GMT\"0x8D91707E6C25116\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsede5f996f0de5f996f23784536eff221142b544bee935Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465B5019\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedece257d0dece257da8e749297e4ed60c4a234499b55Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE5C449D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedsdcfhbfws6d931a88Wed, + 02 Dec 2020 00:53:21 GMT\"0x8D8965CAABCDF0E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedsdfws6d931a88Wed, + 02 Dec 2020 00:43:30 GMT\"0x8D8965B4A05ED2B\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedsdfws8dea1eedWed, + 02 Dec 2020 00:43:07 GMT\"0x8D8965B3C9C3B73\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedsdfwsd34b185fWed, + 02 Dec 2020 00:43:57 GMT\"0x8D8965B5A93FA88\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsedsdfwse8d9187eWed, + 02 Dec 2020 00:43:41 GMT\"0x8D8965B5092E498\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsee0e3e6ff1e0e3e6ff1855296630eabfb93b9742b1963Wed, + 26 May 2021 20:55:05 GMT\"0x8D920888A171A70\"unlockedavailable$account-encryption-keyfalsefalsefalsetruee0e3e6ff1e0e3e6ff1b7634346642f1e255c2443ead3Wed, + 26 May 2021 20:57:41 GMT\"0x8D92088E72FA083\"unlockedavailable$account-encryption-keyfalsefalsefalsetruee0e3e6ff1e0e3e6ff84479556ac43531636a044e6a3cWed, + 26 May 2021 20:46:55 GMT\"0x8D92087664532B1\"unlockedavailable$account-encryption-keyfalsefalsefalsetruee0e3e6ff1e0e3e6ff92c035635c8f4f44fd374d789d2Wed, + 26 May 2021 20:53:44 GMT\"0x8D920885A2A4F71\"unlockedavailable$account-encryption-keyfalsefalsefalsetruee0e3e6ff1e0e3e6ff9c88825780d59b20b4ef452b8f9Wed, + 26 May 2021 20:50:34 GMT\"0x8D92087E88581F4\"unlockedavailable$account-encryption-keyfalsefalsefalsetruee0e3e6ff1e0e3e6ffa2f1108001fcbdcc706242b785dWed, + 26 May 2021 20:45:33 GMT\"0x8D920873541470F\"unlockedavailable$account-encryption-keyfalsefalsefalsetruee14f20a70e14f20a790a89512d5d826197a7644aca0bFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465C7B1D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsee283d7da0e283d7dab5443282e5c58eff60d8498db4dFri, + 14 May 2021 20:53:06 GMT\"0x8D9171A4657C811\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsee4978ce50e4978ce57ba19396d5aebc2c6f6f457bbd7Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A4657EB5E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsee704e23f0e704e23fce781941b40574d0a6a44076ac7Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEB103B8\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsee9c52be7-66cf-4fc7-ab21-aa66ecb4a2fdThu, + 13 May 2021 22:05:21 GMT\"0x8D9165B33EBA530\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseeacac392-454f-4f51-b158-6ae871300b84Fri, + 14 May 2021 20:15:45 GMT\"0x8D917150E81A2A6\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseeb2e24170eb2e24174c828482dc653025eac2467ba80Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465AD0B5\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseecf847ff0ecf847ffadf74503367608243cab4f5db65Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE918073\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsef1240fcb0f1240fcb52b99042ea1e52ecf695417bad7Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE918AE5\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsef2f10f6f0f2f10f6fb69098385f9245a4435141bbbf9Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FE9AC631\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsef57496290f5749629f4784466b86bef201f7c43caaebTue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE3EC2A6\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsef5e36ba80f5e36ba808c99383de1ba7f7be314673aaeTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FF0AFB4E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsef8ad3da50f8ad3da531b78044389bb2fe0ea94e6b8f5Tue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEBC8DC7\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsefb7dda960fb7dda9676b5009580cb98a1cd314f6c85dTue, + 11 May 2021 23:39:18 GMT\"0x8D914D5FEA9D2B9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsefb98e69b0fb98e69baa330549bbcc8dc53c044a2a972Fri, + 14 May 2021 20:53:06 GMT\"0x8D9171A465A8066\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsefbed87120fbed871289d01665efd73ae664894859a75Tue, + 11 May 2021 23:39:17 GMT\"0x8D914D5FE7F2FCE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsefdbe3964-c35c-42e6-817a-f4ac211e5294Fri, + 14 May 2021 22:10:10 GMT\"0x8D917250A660B57\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsejavablobsettierarchivestatus2086272bc1452ff2004cMon, + 05 Apr 2021 19:44:10 GMT\"0x8D8F86B2EFB2C28\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsejavablobsettierarchivestatus287692a5755500812945Mon, + 05 Apr 2021 19:44:11 GMT\"0x8D8F86B2FB85CFC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsejavablobsettierarchivestatus29295602e9c92d59df4aMon, + 05 Apr 2021 19:44:11 GMT\"0x8D8F86B2F5A747A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsejavablobsettierinferred2blobapitestsettierinferred3ac5912539Mon, + 05 Apr 2021 19:44:09 GMT\"0x8D8F86B2E946862\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsejtcchangebloblease0leaseapitestchangebloblease023326975acfMon, + 19 Apr 2021 22:20:33 GMT\"0x8D90381596FE644\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseoldnameTue, + 12 Jan 2021 00:42:07 GMT\"0x8D8B692E3AE3722\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-004a7075-6925-41eb-9354-0e7289626152Tue, + 23 Feb 2021 19:13:00 GMT\"0x8D8D82F099AF5CF\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-0063c83f-32b8-435d-9c8e-99369cc136c3Tue, + 23 Feb 2021 18:08:11 GMT\"0x8D8D825FB9E41AE\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-00a86452-0eb3-435b-823a-5ac9b627eeb0Tue, + 04 May 2021 15:29:02 GMT\"0x8D90F1158AD7864\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-00c690df-40a4-4793-9b23-be92ff6ab249Thu, + 03 Dec 2020 00:04:12 GMT\"0x8D8971EF774F01B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-02375164-3b78-4cad-8c01-660e658a17baThu, + 11 Feb 2021 17:03:24 GMT\"0x8D8CEAEF171D857\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-03da2b14-4a22-4d6e-ba9f-555f84672c98Wed, + 27 Jan 2021 21:36:55 GMT\"0x8D8C30BAB1918AE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-087b6f57-f287-425b-ad53-3c642339549bThu, + 11 Feb 2021 17:54:18 GMT\"0x8D8CEB60E154617\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-0c2a8e52-0bca-445a-8175-6c7306ca852dFri, + 12 Feb 2021 19:52:37 GMT\"0x8D8CF8FBF6D795F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-0cc22dfc-0fac-4be1-9f20-922b157766bbWed, + 10 Feb 2021 21:20:56 GMT\"0x8D8CE09C160FF70\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-0d9c8c05-5c33-4324-aebd-d4c7634ca08aThu, + 11 Feb 2021 01:14:17 GMT\"0x8D8CE2A5AAD79A3\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-0eb2ecfd-ab45-293d-e992-21d5187cee46Wed, + 17 Feb 2021 19:46:20 GMT\"0x8D8D37CB2D88F29\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-0edc6b89-3d49-44a1-b8b4-aad9ebf711dfThu, + 11 Feb 2021 16:51:40 GMT\"0x8D8CEAD4DF25CC6\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-0f4c56cf-9869-edf7-ffbb-a5a56a368e58Thu, + 03 Jun 2021 18:52:55 GMT\"0x8D926C0CC4BF7D3\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-12e532a0-6bbd-4d48-b4d4-6396a1fd973dThu, + 11 Feb 2021 01:14:17 GMT\"0x8D8CE2A5A4C8A0B\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-152fa03d-1291-4967-b546-d86757571916Tue, + 16 Feb 2021 23:44:26 GMT\"0x8D8D2D4CBE8D9CE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-1743a64c-55fc-42af-9c4a-05441550b002Fri, + 29 Jan 2021 01:52:06 GMT\"0x8D8C3F87B60503E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-18b0fb99-63af-415d-a3bb-a7a58fcf23faFri, + 12 Feb 2021 17:53:55 GMT\"0x8D8CF7F2A80B77B\"unlockedavailableblob$account-encryption-keyfalsefalsefalsefalsetest-container-1ab026c1-ba22-483d-9542-b5743cc26c43Thu, + 11 Feb 2021 01:13:32 GMT\"0x8D8CE2A3FDBEC09\"unlockedbroken$account-encryption-keyfalsefalsefalsefalsetest-container-1ae05462-12d5-477f-960d-0aa85656eea8Thu, + 11 Feb 2021 01:13:36 GMT\"0x8D8CE2A41EE9251\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-1af22971-ff57-4bf8-af10-780563eabc15Thu, + 28 Jan 2021 16:44:37 GMT\"0x8D8C3ABFFF78EEC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-1b63a8a1-d130-47d3-823e-8b9d1bd51a00Fri, + 12 Feb 2021 18:19:51 GMT\"0x8D8CF82CA3D8CDB\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-1ca51f6c-8e37-4052-bacf-0fbc90c60144Thu, + 11 Feb 2021 18:22:52 GMT\"0x8D8CEBA0B3A9DC5\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-1cd01c60-ba45-4741-a53f-8952403bf08fFri, + 12 Feb 2021 17:05:04 GMT\"0x8D8CF7857D8FFA2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-1ee6a516-f0b9-4109-a0e0-a2b8c59b0c1dFri, + 12 Feb 2021 18:28:38 GMT\"0x8D8CF84046BCF15\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-2267e0b3-ffbb-4325-8703-d389291e8065Fri, + 12 Feb 2021 18:44:17 GMT\"0x8D8CF863390202B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-238c22ca-8ac1-4665-b13c-86a28392b589Thu, + 11 Feb 2021 19:19:16 GMT\"0x8D8CEC1ECAF440C\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-25ee31f2-5582-4d29-8157-ca36b9fbc1b1Wed, + 17 Feb 2021 17:48:33 GMT\"0x8D8D36C3EBA84C6\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-2681738d-e1f3-4097-a5dc-d3c1a29ad53bFri, + 29 Jan 2021 02:11:06 GMT\"0x8D8C3FB22E47EDA\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-2768c3da-948a-4a8d-acbb-4707d5db1f67Tue, + 23 Feb 2021 18:44:21 GMT\"0x8D8D82B0902F5C7\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-29276b6b-414d-4271-a821-5b6bd14ef546Thu, + 11 Feb 2021 22:49:46 GMT\"0x8D8CEDF548AE8D4\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-29c45a50-5a36-4472-ad17-b90ad2ec4a1cWed, + 27 Jan 2021 23:09:31 GMT\"0x8D8C3189AAD7FBE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-2cdc263b-f83e-4e5a-a8ff-afda0043fdeaWed, + 27 Jan 2021 21:39:55 GMT\"0x8D8C30C161B93E0\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-2d3184de-3cde-478f-8e57-36e86f5a3e97Tue, + 23 Feb 2021 18:01:04 GMT\"0x8D8D824FC9085B2\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-30a4db60-2a6a-4c60-b8b8-18d31aab4cfaThu, + 11 Feb 2021 17:53:40 GMT\"0x8D8CEB5F71A3BEA\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-3172ecce-bf36-4cac-b9f8-92d6d79729fdWed, + 17 Mar 2021 02:23:28 GMT\"0x8D8E8EBA698FCC0\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-31853757-28ad-4ee5-871f-db8e6e7900baThu, + 11 Feb 2021 16:55:25 GMT\"0x8D8CEADD4558692\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-320ae665-2e54-4fc3-8f7c-949142ccb3feWed, + 27 Jan 2021 21:36:55 GMT\"0x8D8C30BAB595CB3\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-35084ddb-3d95-4694-bdbe-4e1640f8b143Tue, + 23 Feb 2021 18:50:12 GMT\"0x8D8D82BD9C1B6D8\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-356e61a1-669c-4bcf-9f40-7e8298c36c36Wed, + 17 Feb 2021 00:59:13 GMT\"0x8D8D2DF3E327DA9\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-3671ca8d-4dd0-476e-8c08-dbb566d496b8Fri, + 12 Feb 2021 19:27:50 GMT\"0x8D8CF8C490A3E15\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-377e434d-e565-4881-b4a2-21ed3e9dcb1eTue, + 16 Feb 2021 23:51:43 GMT\"0x8D8D2D5D0412D4B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-3bc58251-2292-4296-9fac-9483e57b7c3dThu, + 28 Jan 2021 21:58:50 GMT\"0x8D8C3D7E57669B5\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-3d1fa27f-80d6-4529-bec9-ab0f254f43a0Tue, + 23 Feb 2021 19:05:48 GMT\"0x8D8D82E07B8E3B8\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-40956323-d30d-42be-9e8f-24f32d8a0f72Thu, + 11 Feb 2021 01:13:50 GMT\"0x8D8CE2A4A986AFD\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsefalsetest-container-423fc05f-e19c-4d9e-9564-2978745af3aaFri, + 14 May 2021 16:34:04 GMT\"0x8D916F6163DC7B9\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-439fb2fd-5c43-47ed-8c41-ab41260d25ccFri, + 29 Jan 2021 01:52:05 GMT\"0x8D8C3F87ACBBD51\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-43aca3b5-4084-4ca5-8461-41dd00d9404fWed, + 27 Jan 2021 21:21:08 GMT\"0x8D8C30976848B4E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-43aed6a3-9683-4920-8fb0-a01400596398Tue, + 23 Feb 2021 18:29:44 GMT\"0x8D8D828FE3B103B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-441d4ff1-fb09-4e8d-9336-36ff48b2d5d2Wed, + 27 Jan 2021 23:09:31 GMT\"0x8D8C3189A6C17E1\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-452d0b34-855e-43ed-b534-7cf23e159293Thu, + 11 Feb 2021 01:13:51 GMT\"0x8D8CE2A4ACC4EFE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-4597d8dd-b3d3-4adb-82df-b2151f2d7d09Thu, + 11 Feb 2021 17:44:21 GMT\"0x8D8CEB4AA1188C6\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-46096f5d-0dbb-4b51-b1fd-84dfd00712d3Tue, + 23 Feb 2021 19:32:39 GMT\"0x8D8D831C8385840\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-49bc813b-bb70-450f-ab1d-5f43667e0900Wed, + 02 Dec 2020 18:33:56 GMT\"0x8D896F0D439EECA\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-4b6aac90-078f-4ecf-8f16-91ae0a809be8Thu, + 28 Jan 2021 02:28:25 GMT\"0x8D8C33463E018F9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-4b8c6b40-87ed-4600-84a3-396d5fe6f7b1Fri, + 26 Mar 2021 18:52:33 GMT\"0x8D8F08851138B1B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-4f027269-0d31-4774-b656-59085caf4453Fri, + 14 May 2021 16:42:14 GMT\"0x8D916F73AC9ED4B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-4f0bc060-7dd2-4612-a094-74d01cd79f98Fri, + 29 Jan 2021 01:49:46 GMT\"0x8D8C3F827DC4458\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-4f109068-2483-4871-aaa8-813b8abe5380Fri, + 12 Feb 2021 17:05:04 GMT\"0x8D8CF7857B4F9BD\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-509e5ebe-6fef-47e8-980f-636b664a1938Wed, + 17 Feb 2021 00:41:51 GMT\"0x8D8D2DCD0CB38D5\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-55af57d6-b81c-4dc5-bd01-9768f694b891Wed, + 17 Feb 2021 00:32:48 GMT\"0x8D8D2DB8D7369D5\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-56bdfc45-d746-46de-8fde-749afaec66b4Thu, + 11 Feb 2021 01:13:35 GMT\"0x8D8CE2A41BC7DBC\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-59c33767-c593-48e2-b00a-94fd55c2a017Tue, + 23 Feb 2021 18:50:35 GMT\"0x8D8D82BE76AFD2E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-5b58ebde-8690-44fc-8141-fd95face0ef8Thu, + 11 Feb 2021 01:15:52 GMT\"0x8D8CE2A933E3264\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-5c3f8695-99d0-485a-817f-1420a9e4aa98Wed, + 27 Jan 2021 21:39:55 GMT\"0x8D8C30C165A17F3\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-5fa2d8b5-c0a9-4951-accd-ea0cae2ab432Fri, + 12 Feb 2021 18:42:49 GMT\"0x8D8CF85FF9AB996\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-6099c5b7-4f7b-4438-8db3-74c35ed6b8dbTue, + 23 Feb 2021 18:31:15 GMT\"0x8D8D82934460C7E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-610bbabc-d750-4daa-a072-1ba60c837d3cTue, + 23 Feb 2021 18:42:43 GMT\"0x8D8D82ACE414485\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-61767317-afc0-4fca-967a-1a04d5767ad6Thu, + 11 Feb 2021 16:56:51 GMT\"0x8D8CEAE073001CF\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-619e89c0-d44e-4406-ac9c-65753183f995Fri, + 12 Feb 2021 21:38:12 GMT\"0x8D8CF9E7FA8F036\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-63bbdb8d-59ea-45a3-9ef8-093ae799defeWed, + 17 Feb 2021 18:01:59 GMT\"0x8D8D36E1F41DA6D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-644b88e6-a0fc-4f74-be05-7082deb53361Wed, + 10 Feb 2021 21:20:23 GMT\"0x8D8CE09AD6961B5\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-6793ce56-b86e-4939-a0cf-6c5759051cf9Fri, + 29 Jan 2021 02:07:19 GMT\"0x8D8C3FA9B7E53C6\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-67b1a89b-d796-49c2-b3f7-3f495a2f501dTue, + 16 Feb 2021 23:44:27 GMT\"0x8D8D2D4CC1629E2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-68421f76-08da-4014-83b8-e7d873b2ab24Tue, + 23 Feb 2021 17:59:24 GMT\"0x8D8D824C14A2617\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-69188b57-4012-d965-4b4c-5e4407c7e3f9Wed, + 17 Feb 2021 02:30:04 GMT\"0x8D8D2EBEF3025BE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-69a21a29-baa7-4b30-a637-f01bd5d65cd3Thu, + 11 Feb 2021 01:13:35 GMT\"0x8D8CE2A41735865\"unlockedexpiredcontainer$account-encryption-keyfalsefalsefalsefalsetest-container-6fd6a3a3-370e-4e81-b995-98a73a3998f5Thu, + 11 Feb 2021 02:52:22 GMT\"0x8D8CE380E441AD6\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-711d4643-ae82-4621-90c8-1de4f3829220Thu, + 11 Feb 2021 01:14:18 GMT\"0x8D8CE2A5AE02712\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-735d9ad8-5ce7-487d-bc05-e6961abe6590Thu, + 28 Jan 2021 21:58:54 GMT\"0x8D8C3D7E7D64AE2\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-77764f80-0069-4d03-9df3-a2d8ef944743Tue, + 23 Feb 2021 17:57:28 GMT\"0x8D8D8247BE0013D\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-78375fe4-3078-4f86-8624-f3a0fe681483Thu, + 11 Feb 2021 17:53:13 GMT\"0x8D8CEB5E715ED2E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-7a224940-36ed-49e4-8a65-e25b756c0bd9Tue, + 23 Feb 2021 19:31:44 GMT\"0x8D8D831A74095A9\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-7c18f354-f4d1-4131-880a-03bfaf8b580fThu, + 11 Feb 2021 01:13:30 GMT\"0x8D8CE2A3E5F2F89\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-7d23633b-981f-4ed3-a2a1-690776968790Fri, + 12 Feb 2021 21:38:12 GMT\"0x8D8CF9E7F7E9C2E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-808c4c61-a10a-4ff8-93e7-d049e76954b3Thu, + 11 Feb 2021 01:13:51 GMT\"0x8D8CE2A4AF4155C\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-81de7b4e-2daf-47a0-a9fe-dd9d9de21b4eThu, + 11 Feb 2021 22:55:14 GMT\"0x8D8CEE0183A2846\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-8268fdfa-18a7-428e-bbcc-d44a273b442dThu, + 11 Feb 2021 01:14:18 GMT\"0x8D8CE2A5B1AD835\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-828b3047-5062-4169-95bc-c9c3857119a2Wed, + 27 Jan 2021 21:21:08 GMT\"0x8D8C30976E59E5F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-830ca1ba-8c20-4ef7-b3ca-cdbf545faea1Tue, + 04 May 2021 15:27:36 GMT\"0x8D90F11258E9D3E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-840ccb70-918a-4df5-9701-ca213875bfb2Wed, + 17 Feb 2021 17:45:25 GMT\"0x8D8D36BCEE163BB\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-85172c7e-c49d-4ecf-81be-43d83447194bThu, + 11 Feb 2021 01:14:25 GMT\"0x8D8CE2A5EF9741F\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsefalsetest-container-88cbf348-3b56-42c3-8429-395492fb1631Tue, + 23 Feb 2021 19:35:51 GMT\"0x8D8D8323AB2574C\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-8afcd31f-263f-4874-a77b-1493dfbdeccfWed, + 27 Jan 2021 19:57:35 GMT\"0x8D8C2FDCABB21BD\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-8c70dfbf-2f3e-48f0-a12e-89de1c847929Thu, + 28 Jan 2021 01:04:08 GMT\"0x8D8C3289DD534EC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-8ee495fc-e088-48aa-bfea-dcc681331426Tue, + 23 Feb 2021 18:30:13 GMT\"0x8D8D8290F6165D2\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-8f1ace28-5ff6-4804-b848-d772b72b98c4Thu, + 11 Feb 2021 17:14:12 GMT\"0x8D8CEB073D17373\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-903ae3e2-c10f-4da0-a2d3-27d07da37d4fFri, + 29 Jan 2021 01:49:47 GMT\"0x8D8C3F828B406B3\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-90f2d9d8-0d14-4bf3-a18f-51342fea6428Fri, + 19 Feb 2021 01:22:48 GMT\"0x8D8D474DE40C30D\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-913d087b-4d17-4a56-97b1-71cc6168457bFri, + 12 Feb 2021 19:26:34 GMT\"0x8D8CF8C1C35CA5F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-934ce2b8-aca4-4263-b40d-c047fc04a7d1Wed, + 27 Jan 2021 21:24:33 GMT\"0x8D8C309F096FA08\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-979ccb7f-112b-4a34-8896-7a46c9568ffcThu, + 11 Feb 2021 01:13:58 GMT\"0x8D8CE2A4EEA65BB\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsefalsetest-container-99aa1a9e-4744-43ed-8a41-33109a353868Thu, + 11 Feb 2021 18:43:13 GMT\"0x8D8CEBCE358E87F\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-9cc9b913-5cc6-41a2-b5fd-e957aae47f04Wed, + 17 Feb 2021 17:44:59 GMT\"0x8D8D36BBF0EF0F5\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-9e6a867d-8802-4ace-84a6-17ec4e0cf262Wed, + 17 Feb 2021 00:34:13 GMT\"0x8D8D2DBC041C77B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-a1a88cbf-370d-4cc4-92af-7978633c5afdFri, + 12 Feb 2021 18:45:03 GMT\"0x8D8CF864F0A1815\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-a58d435e-3325-4016-a390-52eb82c7e16bThu, + 28 Jan 2021 21:54:35 GMT\"0x8D8C3D74D4E5CE4\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-a829c23b-441e-40af-8176-b2ca10ec4e7aThu, + 28 Jan 2021 02:28:25 GMT\"0x8D8C334639F24C9\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-abe99db8-f95d-4fe1-b912-77f6bc2d85eeThu, + 28 Jan 2021 16:44:36 GMT\"0x8D8C3ABFFB56A99\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-ac22f3bd-6ba6-4cca-a4af-5f6ce3cc3b04Thu, + 28 Jan 2021 01:04:08 GMT\"0x8D8C3289D908B4D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-adc4ba57-9457-49a3-abdb-ece2606fa9f4Tue, + 23 Feb 2021 19:33:09 GMT\"0x8D8D831DA369F25\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-b4aaf541-d001-487c-a618-f582fd494e7eFri, + 12 Feb 2021 18:19:51 GMT\"0x8D8CF82CA14854B\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-b4b1511a-5743-4887-99fd-d0d499c21e22Tue, + 23 Feb 2021 19:29:24 GMT\"0x8D8D83153CC51A7\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-b608b0a5-6c39-4ce9-9382-c4eddbfcbbfbTue, + 23 Feb 2021 18:00:24 GMT\"0x8D8D824E545C48C\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-b627740c-e8b1-4e9a-b063-65be0ebfe550Thu, + 11 Feb 2021 17:01:19 GMT\"0x8D8CEAEA6E52E5F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-b839a54b-7118-4401-a100-338e02969750Thu, + 11 Feb 2021 16:57:23 GMT\"0x8D8CEAE1A391766\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-ba681811-aa99-4180-8ed2-83cfe143643aFri, + 12 Feb 2021 18:26:36 GMT\"0x8D8CF83BBB28BEC\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-bb90b9d8-9cca-41cb-a984-9f745aa3ee54Tue, + 23 Feb 2021 19:32:02 GMT\"0x8D8D831B1C2BE18\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-bc6a050b-2368-4628-9a72-b47bd621d94eFri, + 29 Jan 2021 02:11:05 GMT\"0x8D8C3FB22617B70\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-bccab32d-51e6-40e7-b6c4-534c2ee2e9c1Fri, + 12 Feb 2021 19:27:50 GMT\"0x8D8CF8C4930DDF2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-bd715a23-8f19-4b6d-9f92-82c1a01913c5Thu, + 11 Feb 2021 01:13:30 GMT\"0x8D8CE2A3E928504\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-bf9d6770-353f-4c32-94ea-a359b0c3fc54Fri, + 29 Jan 2021 02:07:19 GMT\"0x8D8C3FA9C0093C4\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-c00fd09e-9b95-452d-8c35-53de7e73d986Wed, + 10 Feb 2021 22:28:09 GMT\"0x8D8CE132510326B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-c147cbd2-1406-4152-9440-b1f4747cc650Wed, + 17 Feb 2021 00:54:55 GMT\"0x8D8D2DEA49BE354\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-c494e72f-0126-0411-ac44-57b1edcc288eWed, + 17 Feb 2021 02:31:21 GMT\"0x8D8D2EC1D395D79\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-c55896c2-5854-4e22-9bd9-21a96b07e370Fri, + 12 Feb 2021 19:52:36 GMT\"0x8D8CF8FBF46E847\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-c727f411-1628-49dd-b1a0-2810c6d2603dFri, + 12 Feb 2021 17:49:42 GMT\"0x8D8CF7E93832D26\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-c790f187-1695-4775-820d-4e7600e38d1cThu, + 11 Feb 2021 01:15:09 GMT\"0x8D8CE2A79472217\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-c861ef3c-87ea-4bb1-9939-e89ccbf553bcWed, + 27 Jan 2021 21:28:24 GMT\"0x8D8C30A7A9D592F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-ce038060-4bc1-47a8-807d-e296c31ad98bWed, + 17 Feb 2021 01:12:28 GMT\"0x8D8D2E117C772CD\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-ce2880c8-d9fb-4759-ac52-aabf8f9a8e9eTue, + 23 Feb 2021 18:51:53 GMT\"0x8D8D82C15E8D48E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-ce704fd5-71cd-4a1d-9019-40615dddfaeeThu, + 11 Feb 2021 01:14:20 GMT\"0x8D8CE2A5C78573B\"lockedleasedinfinite$account-encryption-keyfalsefalsefalsefalsetest-container-cec859db-bff7-4ba8-bb50-2526ada01c5cFri, + 29 Jan 2021 01:57:24 GMT\"0x8D8C3F9391F4FDC\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-d0b9db4b-4954-4d42-bdc7-8c60a7db3564Thu, + 11 Feb 2021 01:13:33 GMT\"0x8D8CE2A402435F3\"unlockedexpired$account-encryption-keyfalsefalsefalsefalsetest-container-d3b53c7a-b299-466c-9396-5416a88d3e92Wed, + 27 Jan 2021 21:32:49 GMT\"0x8D8C30B188B60A4\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-d637b42e-31f5-4fc2-80be-4a9e160041bbWed, + 27 Jan 2021 21:24:32 GMT\"0x8D8C309F057C0E3\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-d9a61191-efa5-4bea-bd27-9f47acc0749aWed, + 27 Jan 2021 19:57:35 GMT\"0x8D8C2FDCA7AC162\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-df1a1934-eb8f-4dc1-9e3f-14691fd277bcFri, + 29 Jan 2021 01:57:39 GMT\"0x8D8C3F94238163B\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-e0852ece-545c-47ac-b1df-5bd4652cbc82Thu, + 28 Jan 2021 21:54:34 GMT\"0x8D8C3D74CD98CFD\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-e3264db8-ca6a-4cdc-9cb3-0ef53bf136caWed, + 17 Feb 2021 18:01:59 GMT\"0x8D8D36E1F6A9A04\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-e741b92b-e6b5-4027-849b-a3c1aef163a4Fri, + 12 Feb 2021 21:25:37 GMT\"0x8D8CF9CBD77BF77\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-e75936e3-9265-4237-bef4-56c506213413Thu, + 28 Jan 2021 21:53:05 GMT\"0x8D8C3D717D91AB8\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-e7eef32f-aca7-4351-b351-d0c816e5054aFri, + 29 Jan 2021 02:06:23 GMT\"0x8D8C3FA7A8F7DAD\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-eb8c4b97-41ee-428b-9fc5-abd8a9634702Wed, + 27 Jan 2021 21:28:24 GMT\"0x8D8C30A7A5D6A0D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-ed627ebb-73d1-4dda-9585-7b241a62b6a4Thu, + 11 Feb 2021 01:47:14 GMT\"0x8D8CE2EF50CEA85\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-eeff9dc2-bbae-4542-93de-85f146fa5788Wed, + 17 Feb 2021 00:49:20 GMT\"0x8D8D2DDDCD54827\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-f197d29d-4bb4-40df-87cc-bde2aad76179Thu, + 11 Feb 2021 17:44:26 GMT\"0x8D8CEB4AD24F10E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-f385e036-c465-4a8d-aa86-f6ef15b11b1bThu, + 11 Feb 2021 01:14:14 GMT\"0x8D8CE2A58F55CC5\"unlockedexpiredcontainer$account-encryption-keyfalsefalsefalsefalsetest-container-f396c4de-1fd6-48cd-8c66-64b6b46ae4ffWed, + 27 Jan 2021 21:32:50 GMT\"0x8D8C30B18CA95D2\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-f42c25a8-f24e-4ceb-9309-db40973a0addThu, + 11 Feb 2021 17:01:19 GMT\"0x8D8CEAEA71699D1\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-f4f4dcc4-27f7-4078-8667-5033574b6f47Wed, + 17 Feb 2021 01:11:01 GMT\"0x8D8D2E0E3F760DC\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-f5a24da1-cd2e-40c6-8bb1-733f36658c6fWed, + 17 Feb 2021 01:16:34 GMT\"0x8D8D2E1AAC71E24\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-f638a6cf-be12-45b4-9933-3a25b14ac296Fri, + 12 Feb 2021 19:26:34 GMT\"0x8D8CF8C1C0E80BA\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-f7e5c21c-de1e-4808-a04e-1e7f25b25c9fWed, + 17 Feb 2021 00:29:40 GMT\"0x8D8D2DB1D257B91\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetest-container-fa37b194-7db2-8811-5df6-907f10c7ecccWed, + 17 Feb 2021 02:31:22 GMT\"0x8D8D2EC1D62B5BE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-faa9b90c-56c4-0a69-cb5a-30714ad70c14Wed, + 17 Feb 2021 02:30:04 GMT\"0x8D8D2EBEF0827B0\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetest-container-ff96e927-1c86-4c63-9813-32b8e8e8b91aWed, + 17 Feb 2021 00:13:39 GMT\"0x8D8D2D8E0A1B64E\"unlockedavailablecontainer$account-encryption-keyfalsefalsefalsefalsetestcontainer898e1b1eTue, + 01 Dec 2020 21:49:45 GMT\"0x8D896430452B35D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetestcontainerae6c1f24Tue, + 01 Dec 2020 21:49:54 GMT\"0x8D8964309DBA91D\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsetestcontainerf7f71ca7Tue, + 01 Dec 2020 21:48:19 GMT\"0x8D89642D15CA400\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer17971d05Tue, + 01 Dec 2020 21:50:39 GMT\"0x8D89643246A277F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer206719b0Tue, + 01 Dec 2020 21:48:59 GMT\"0x8D89642E930F974\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer50d0216aTue, + 01 Dec 2020 21:50:47 GMT\"0x8D89643294D6B13\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer54918fbTue, + 01 Dec 2020 21:50:03 GMT\"0x8D896430F0A5CCB\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer6d931a88Tue, + 01 Dec 2020 21:49:08 GMT\"0x8D89642EE39074E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer6e611adcTue, + 01 Dec 2020 21:49:35 GMT\"0x8D89642FEA07746\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer7427167eTue, + 01 Dec 2020 21:48:29 GMT\"0x8D89642D77939BC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer7ce1476Tue, + 01 Dec 2020 21:48:48 GMT\"0x8D89642E2652DEC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer866c1afbTue, + 01 Dec 2020 21:50:12 GMT\"0x8D896431458D3CA\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer879205cWed, + 16 Dec 2020 23:34:59 GMT\"0x8D8A21B340C8378\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer8c7016f3Tue, + 01 Dec 2020 21:50:22 GMT\"0x8D896431A79909E\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer8dea1eedTue, + 01 Dec 2020 21:49:16 GMT\"0x8D89642F33597BA\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainer927f11f2Wed, + 16 Dec 2020 23:35:07 GMT\"0x8D8A21B38AFFB9C\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerb59f1281Wed, + 16 Dec 2020 23:35:06 GMT\"0x8D8A21B37FC7DA0\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerba52179cWed, + 16 Dec 2020 03:02:21 GMT\"0x8D8A16F01E33300\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerc2e51c2dTue, + 01 Dec 2020 21:50:30 GMT\"0x8D896431F67999A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerc8131f7dWed, + 16 Dec 2020 23:35:02 GMT\"0x8D8A21B35F91A6A\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerd0ba1817Wed, + 16 Dec 2020 23:35:08 GMT\"0x8D8A21B396D8F82\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerd34b185fTue, + 01 Dec 2020 21:47:54 GMT\"0x8D89642C29C7D1B\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainere8d9187eTue, + 01 Dec 2020 21:48:39 GMT\"0x8D89642DD41E438\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainerebfb18a1Tue, + 01 Dec 2020 21:48:07 GMT\"0x8D89642CA041AC3\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersource1c30197aFri, + 04 Jun 2021 00:44:21 GMT\"0x8D926F1E4DE86DC\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersource698c1aafFri, + 04 Jun 2021 00:24:21 GMT\"0x8D926EF1932594F\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersource879205cWed, + 16 Dec 2020 23:34:59 GMT\"0x8D8A21B34228072\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersource927f11f2Wed, + 16 Dec 2020 23:35:07 GMT\"0x8D8A21B38C4BFE3\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersourceb59f1281Wed, + 16 Dec 2020 23:35:06 GMT\"0x8D8A21B38103045\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersourcec8131f7dWed, + 16 Dec 2020 23:35:02 GMT\"0x8D8A21B360C30BE\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersourcecb3e1fa9Fri, + 04 Jun 2021 00:24:42 GMT\"0x8D926EF25A23EC1\"unlockedavailable$account-encryption-keyfalsefalsefalsefalseutcontainersourced0ba1817Wed, + 16 Dec 2020 23:35:08 GMT\"0x8D8A21B39831731\"unlockedavailable$account-encryption-keyfalsefalsefalsefalsevlwcontainer1c30197aFri, + 04 Jun 2021 00:45:08 GMT\"0x8D926F200A0D2F4\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainer698c1aafFri, + 04 Jun 2021 00:24:23 GMT\"0x8D926EF1A8DAD5A\"unlockedavailable$account-encryption-keyfalsefalsefalsetruevlwcontainerasynccb3e1fa9Fri, + 04 Jun 2021 00:24:43 GMT\"0x8D926EF266AF622\"unlockedavailable$account-encryption-keyfalsefalsefalsetrue" headers: content-type: application/xml - date: Fri, 25 Oct 2019 18:00:47 GMT + date: Fri, 04 Jun 2021 00:46:12 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked - x-ms-version: '2019-02-02' + x-ms-version: '2020-10-02' status: code: 200 message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pyacrstoragekzoj3d7n4a5m.blob.core.windows.net - - / - - comp=list - - '' + url: https://seanmcccanary3.blob.core.windows.net/?comp=list&include= version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_page_blob.test_create_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_page_blob.test_create_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..ff0b789f6741 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_page_blob.test_create_blob_with_immutability_policy.yaml @@ -0,0 +1,247 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 03:31:02 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer88a816fd?restype=container + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:fe73fc68-401e-0000-3328-587b72000000\nTime:2021-06-03T03:31:02.9194963Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Thu, 03 Jun 2021 03:31:02 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-10-02' + status: + code: 409 + message: The specified container already exists. +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer88a816fd?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer88a816fd","name":"vlwcontainer88a816fd","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: + - no-cache + content-length: + - '451' + content-type: + - application/json + date: + - Thu, 03 Jun 2021 03:31:04 GMT + etag: + - '"0x8D9264004BA1FA8"' + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-content-length: + - '1024' + x-ms-blob-type: + - PageBlob + x-ms-date: + - Thu, 03 Jun 2021 03:31:05 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 03:31:10 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer88a816fd/vlwblob88a816fd + response: + body: + string: '' + headers: + date: + - Thu, 03 Jun 2021 03:31:04 GMT + etag: + - '"0x8D9264004E845D2"' + last-modified: + - Thu, 03 Jun 2021 03:31:05 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T03:31:05.1739362Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 03 Jun 2021 03:31:05 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer88a816fd/vlwblob88a816fd + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '1024' + content-type: + - application/octet-stream + date: + - Thu, 03 Jun 2021 03:31:04 GMT + etag: + - '"0x8D9264004E845D2"' + last-modified: + - Thu, 03 Jun 2021 03:31:05 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-sequence-number: + - '0' + x-ms-blob-type: + - PageBlob + x-ms-creation-time: + - Thu, 03 Jun 2021 03:31:05 GMT + x-ms-immutability-policy-mode: + - unlocked + x-ms-immutability-policy-until-date: + - Thu, 03 Jun 2021 03:31:10 GMT + x-ms-is-current-version: + - 'true' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-legal-hold: + - 'true' + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-10-02' + x-ms-version-id: + - '2021-06-03T03:31:05.1739362Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer88a816fd?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 03 Jun 2021 03:31:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_page_blob_async.test_create_blob_with_immutability_policy.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_page_blob_async.test_create_blob_with_immutability_policy.yaml new file mode 100644 index 000000000000..7352da1c0e6f --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_page_blob_async.test_create_blob_with_immutability_policy.yaml @@ -0,0 +1,170 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:45:06 GMT + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer1c30197a?restype=container + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:a2bc0215-301e-0062-14da-5818e5000000\nTime:2021-06-04T00:45:06.8513175Z" + headers: + content-length: '230' + content-type: application/xml + date: Fri, 04 Jun 2021 00:45:06 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: ContainerAlreadyExists + x-ms-version: '2020-10-02' + status: + code: 409 + message: The specified container already exists. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer1c30197a?restype=container +- request: + body: '{"properties": {"immutableStorageWithVersioning": {"enabled": true}}}' + headers: + Accept: + - application/json + Content-Length: + - '69' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer1c30197a?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/vlwcontainer1c30197a","name":"vlwcontainer1c30197a","type":"Microsoft.Storage/storageAccounts/blobServices/containers","properties":{"immutableStorageWithVersioning":{"enabled":true},"deleted":false,"remainingRetentionDays":0,"hasImmutabilityPolicy":false,"hasLegalHold":false}}' + headers: + cache-control: no-cache + content-length: '451' + content-type: application/json + date: Fri, 04 Jun 2021 00:45:07 GMT + etag: '"0x8D926F2009E8895"' + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-writes: '1199' + status: + code: 201 + message: Created + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanmcccanary3/blobServices/default/containers/vlwcontainer1c30197a?api-version=2021-04-01 +- request: + body: null + headers: + Accept: + - application/xml + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-content-length: + - '1024' + x-ms-blob-type: + - PageBlob + x-ms-date: + - Fri, 04 Jun 2021 00:45:08 GMT + x-ms-immutability-policy-mode: + - Unlocked + x-ms-immutability-policy-until-date: + - Fri, 04 Jun 2021 00:45:13 GMT + x-ms-legal-hold: + - 'true' + x-ms-version: + - '2020-10-02' + method: PUT + uri: https://storagename.blob.core.windows.net/vlwcontainer1c30197a/vlwblob1c30197a + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 04 Jun 2021 00:45:08 GMT + etag: '"0x8D926F200C6E57E"' + last-modified: Fri, 04 Jun 2021 00:45:08 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T00:45:08.6611838Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer1c30197a/vlwblob1c30197a +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.9.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 04 Jun 2021 00:45:08 GMT + x-ms-version: + - '2020-10-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/vlwcontainer1c30197a/vlwblob1c30197a + response: + body: + string: '' + headers: + accept-ranges: bytes + content-length: '1024' + content-type: application/octet-stream + date: Fri, 04 Jun 2021 00:45:08 GMT + etag: '"0x8D926F200C6E57E"' + last-modified: Fri, 04 Jun 2021 00:45:08 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-sequence-number: '0' + x-ms-blob-type: PageBlob + x-ms-creation-time: Fri, 04 Jun 2021 00:45:08 GMT + x-ms-immutability-policy-mode: unlocked + x-ms-immutability-policy-until-date: Fri, 04 Jun 2021 00:45:13 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-legal-hold: 'true' + x-ms-server-encrypted: 'true' + x-ms-version: '2020-10-02' + x-ms-version-id: '2021-06-04T00:45:08.6611838Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/vlwcontainer1c30197a/vlwblob1c30197a +- request: + body: null + headers: + User-Agent: + - azsdk-python-azure-mgmt-storage/18.0.0 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/storagename/blobServices/default/containers/utcontainer1c30197a?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + content-type: text/plain; charset=utf-8 + date: Fri, 04 Jun 2021 00:45:08 GMT + expires: '-1' + pragma: no-cache + server: Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-subscription-deletes: '14999' + status: + code: 200 + message: OK + url: https://management.azure.com/subscriptions/ba45b233-e2ef-4169-8808-49eb0d8eba0d/resourceGroups/XClient/providers/Microsoft.Storage/storageAccounts/seanmcccanary3/blobServices/default/containers/utcontainer1c30197a?api-version=2021-04-01 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index 334498438c44..0c255a4811e2 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -15,6 +15,9 @@ import uuid from datetime import datetime, timedelta +from azure.mgmt.storage import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import ResourceNotFoundError, ResourceModifiedError, HttpResponseError from azure.storage.blob import ( @@ -23,7 +26,7 @@ ContainerClient, BlobClient, BlobType, - BlobSasPermissions) + BlobSasPermissions, BlobImmutabilityPolicyMode) from azure.storage.blob._shared.policies import StorageContentValidation from _shared.testcase import StorageTestCase, GlobalStorageAccountPreparer, StorageAccountPreparer, \ @@ -1321,4 +1324,38 @@ def test_copy_sealed_blob_with_seal_blob_will_get_a_sealed_blob(self, resource_g self.assertIsNone(prop.is_append_blob_sealed) copied_blob3.append_block("abc") + + @GlobalStorageAccountPreparer() + def test_create_append_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + bsc = BlobServiceClient(self.account_url(storage_account, "blob"), storage_account_key, max_block_size=4 * 1024) + self._setup(bsc) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = bsc.get_blob_client(container_name, blob_name) + blob.create_append_blob(immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True) + + props = blob.get_blob_properties() + + with self.assertRaises(HttpResponseError): + blob.delete_blob() + + self.assertTrue(props['legal_hold']) + self.assertIsNotNone(props['immutability_policy_expiry_time']) + self.assertIsNotNone(props['immutability_policy_mode']) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index 72a405bd0a36..684578f8e06f 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -17,12 +17,15 @@ import unittest import uuid +from azure.mgmt.storage.aio import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceNotFoundError, ResourceModifiedError from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy -from azure.storage.blob import BlobSasPermissions, generate_blob_sas +from azure.storage.blob import BlobSasPermissions, generate_blob_sas, BlobImmutabilityPolicyMode from azure.storage.blob._shared.policies import StorageContentValidation from azure.storage.blob import BlobType from azure.storage.blob.aio import ( @@ -1403,4 +1406,39 @@ async def test_copy_sealed_blob_with_seal_blob_will_get_a_sealed_blob(self, reso self.assertIsNone(prop.is_append_blob_sealed) await copied_blob3.append_block("abc") + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_create_append_blob_with_immutability_policy_async(self, resource_group, location, storage_account, storage_account_key): + bsc = BlobServiceClient(self.account_url(storage_account, "blob"), storage_account_key, max_block_size=4 * 1024) + await self._setup(bsc) + + container_name = self.get_resource_name('vlwcontainerasync') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = bsc.get_blob_client(container_name, blob_name) + await blob.create_append_blob(immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True) + + props = await blob.get_blob_properties() + + with self.assertRaises(HttpResponseError): + await blob.delete_blob() + + self.assertTrue(props['legal_hold']) + self.assertIsNotNone(props['immutability_policy_expiry_time']) + self.assertIsNotNone(props['immutability_policy_mode']) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index a916f49076d9..027347a7ee96 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -12,6 +12,9 @@ import pytest import uuid +from azure.mgmt.storage import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.storage.blob._shared.policies import StorageContentValidation from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError, ResourceNotFoundError @@ -22,8 +25,8 @@ BlobType, ContentSettings, BlobBlock, - StandardBlobTier, generate_blob_sas, BlobSasPermissions, CustomerProvidedEncryptionKey -) + StandardBlobTier, generate_blob_sas, BlobSasPermissions, CustomerProvidedEncryptionKey, + BlobImmutabilityPolicyMode) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from _shared.testcase import StorageTestCase, GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -421,6 +424,47 @@ def test_put_block_list(self, resource_group, location, storage_account, storage self.assertEqual(content.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(content.properties.last_modified, put_block_list_resp.get('last_modified')) + @GlobalStorageAccountPreparer() + def test_put_block_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + container_name = self.get_resource_name('vlwcontainer') + + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = self._get_blob_reference() + blob = self.bsc.get_blob_client(container_name, blob_name) + blob.stage_block('1', b'AAA') + blob.stage_block('2', b'BBB') + blob.stage_block('3', b'CCC') + + # Act + block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] + put_block_list_resp = blob.commit_block_list(block_list, + immutability_policy_expiry_time=datetime.utcnow() + timedelta( + seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + ) + + # Assert + download_resp = blob.download_blob() + self.assertEqual(download_resp.readall(), b'AAABBBCCC') + self.assertEqual(download_resp.properties.etag, put_block_list_resp.get('etag')) + self.assertEqual(download_resp.properties.last_modified, put_block_list_resp.get('last_modified')) + self.assertTrue(download_resp.properties['legal_hold']) + self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + @GlobalStorageAccountPreparer() def test_put_block_list_invalid_block_id(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index a2c9155b762f..1020d4c3516a 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -13,6 +13,9 @@ from datetime import datetime, timedelta +from azure.mgmt.storage.aio import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.storage.blob._shared.policies import StorageContentValidation from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError, ResourceNotFoundError @@ -28,8 +31,8 @@ BlobBlock, StandardBlobTier, generate_blob_sas, - BlobSasPermissions, CustomerProvidedEncryptionKey -) + BlobSasPermissions, CustomerProvidedEncryptionKey, + BlobImmutabilityPolicyMode) from azure.storage.blob.aio import ( BlobServiceClient, @@ -525,6 +528,48 @@ async def test_put_block_list(self, resource_group, location, storage_account, s self.assertEqual(content.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(content.properties.last_modified, put_block_list_resp.get('last_modified')) + @GlobalStorageAccountPreparer() + async def test_put_block_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + container_name = self.get_resource_name('vlwcontainer') + + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = self._get_blob_reference() + blob = self.bsc.get_blob_client(container_name, blob_name) + await blob.stage_block('1', b'AAA') + await blob.stage_block('2', b'BBB') + await blob.stage_block('3', b'CCC') + + # Act + block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] + put_block_list_resp = await blob.commit_block_list(block_list, + immutability_policy_expiry_time=datetime.utcnow() + timedelta( + seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + ) + + # Assert + download_resp = await blob.download_blob() + content = await download_resp.readall() + self.assertEqual(content, b'AAABBBCCC') + self.assertEqual(download_resp.properties.etag, put_block_list_resp.get('etag')) + self.assertEqual(download_resp.properties.last_modified, put_block_list_resp.get('last_modified')) + self.assertTrue(download_resp.properties['legal_hold']) + self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test async def test_put_block_list_invalid_block_id(self, resource_group, location, storage_account, storage_account_key): diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index 0cd07c753780..a08e7d28b963 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -14,6 +14,9 @@ import sys from datetime import datetime, timedelta +from azure.mgmt.storage import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.credentials import AzureSasCredential from azure.core.exceptions import ( @@ -41,7 +44,7 @@ ResourceTypes, AccountSasPermissions, StandardBlobTier, -) + BlobImmutabilityPolicyMode) from azure.storage.blob._generated.models import RehydratePriority from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from _shared.testcase import StorageTestCase, GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -149,7 +152,7 @@ def _assert_blob_not_soft_deleted(self, blob): @GlobalStorageAccountPreparer() def test_blob_exists(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) - blob_name = self._create_block_blob() + blob_name = self._create_block_blob(overwrite=True) # Act blob = self.bsc.get_blob_client(self.container_name, blob_name) @@ -1160,6 +1163,44 @@ def test_copy_blob_with_existing_blob(self, resource_group, location, storage_ac copy_content = copyblob.download_blob().readall() self.assertEqual(copy_content, self.byte_data) + @GlobalStorageAccountPreparer() + def test_copy_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = self._create_block_blob() + # Act + sourceblob = '{0}/{1}/{2}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob_name) + + copyblob = self.bsc.get_blob_client(container_name, 'blob1copy') + copy = copyblob.start_copy_from_url(sourceblob, + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + ) + + download_resp = copyblob.download_blob() + self.assertEqual(download_resp.readall(), self.byte_data) + + self.assertTrue(download_resp.properties['legal_hold']) + self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(copy) + self.assertEqual(copy['copy_status'], 'success') + self.assertFalse(isinstance(copy['copy_status'], Enum)) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + @GlobalResourceGroupPreparer() @StorageAccountPreparer(random_name_enabled=True, location="canadacentral", name_prefix='storagename') def test_async_copy_blob_with_if_tags(self, resource_group, location, storage_account, storage_account_key): @@ -1722,6 +1763,82 @@ def test_account_sas(self, resource_group, location, storage_account, storage_ac self.assertEqual(self.byte_data, blob_response.content) self.assertTrue(container_response.ok) + @pytest.mark.live_test_only + @GlobalStorageAccountPreparer() + def test_set_immutability_policy_using_sas(self, resource_group, location, storage_account, storage_account_key): + # SAS URL is calculated from storage key, so this test runs live only + + self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + blob.upload_blob(b"abc", overwrite=True) + + # Act using account sas + account_sas_token = generate_account_sas( + self.bsc.account_name, + self.bsc.credential.account_key, + ResourceTypes(container=True, object=True), + AccountSasPermissions(read=True, immutability_policy=True), + datetime.utcnow() + timedelta(hours=1), + ) + blob = BlobClient( + self.bsc.url, container_name= container_name, blob_name=blob_name, credential=account_sas_token) + resp_with_account_sas = blob.set_immutability_policy( + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + blob_response = requests.get(blob.url) + + # Assert response using account sas + self.assertTrue(blob_response.ok) + self.assertIsNotNone(resp_with_account_sas['immutability_policy_until_date']) + self.assertIsNotNone(resp_with_account_sas['immutability_policy_mode']) + + # Acting using container sas + container_sas_token = generate_container_sas( + self.bsc.account_name, + container_name, + account_key=self.bsc.credential.account_key, + permission=ContainerSasPermissions(read=True, immutability_policy=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + blob1 = BlobClient( + self.bsc.url, container_name=container_name, blob_name=blob_name, credential=container_sas_token) + resp_with_container_sas = blob1.set_immutability_policy( + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + # Assert response using container sas + self.assertIsNotNone(resp_with_container_sas['immutability_policy_until_date']) + self.assertIsNotNone(resp_with_container_sas['immutability_policy_mode']) + + # Acting using blob sas + blob_sas_token = generate_blob_sas( + self.bsc.account_name, + container_name, + blob_name, + account_key=self.bsc.credential.account_key, + permission=BlobSasPermissions(read=True, immutability_policy=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + blob2 = BlobClient( + self.bsc.url, container_name=container_name, blob_name=blob_name, credential=blob_sas_token) + resp_with_blob_sas = blob2.set_immutability_policy( + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + + # Assert response using blob sas + self.assertIsNotNone(resp_with_blob_sas['immutability_policy_until_date']) + self.assertIsNotNone(resp_with_blob_sas['immutability_policy_mode']) + @pytest.mark.live_test_only @GlobalStorageAccountPreparer() def test_account_sas_credential(self, resource_group, location, storage_account, storage_account_key): @@ -2400,4 +2517,147 @@ def fail_response(response): # Assert that the token attempts to refresh 4 times (i.e, get_token called 4 times) self.assertEqual(token_credential.get_token_count, 4) + @GlobalStorageAccountPreparer() + def test_blob_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + blob.upload_blob(b"abc", overwrite=True) + resp = blob.set_immutability_policy(immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + + # Assert + # check immutability policy after set_immutability_policy() + props = blob.get_blob_properties() + self.assertIsNotNone(resp['immutability_policy_until_date']) + self.assertIsNotNone(resp['immutability_policy_mode']) + self.assertIsNotNone(props.immutability_policy_expiry_time) + self.assertIsNotNone(props.immutability_policy_mode) + self.assertEqual(props.immutability_policy_mode, "unlocked") + + # check immutability policy after delete_immutability_policy() + blob.delete_immutability_policy() + props = blob.get_blob_properties() + self.assertIsNone(props.immutability_policy_mode) + self.assertIsNone(props.immutability_policy_mode) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + + @GlobalStorageAccountPreparer() + def test_blob_legal_hold(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + blob.upload_blob(b"abc", overwrite=True) + resp = blob.set_legal_hold(True) + props = blob.get_blob_properties() + + with self.assertRaises(HttpResponseError): + blob.delete_blob() + + self.assertTrue(resp['legal_hold']) + self.assertTrue(props['legal_hold']) + + resp2 = blob.set_legal_hold(False) + props2 = blob.get_blob_properties() + + self.assertFalse(resp2['legal_hold']) + self.assertFalse(props2['legal_hold']) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + + @GlobalStorageAccountPreparer() + def test_download_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + content = b"abcedfg" + blob.upload_blob(content, + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + overwrite=True) + + download_resp = blob.download_blob() + + with self.assertRaises(HttpResponseError): + blob.delete_blob() + + self.assertTrue(download_resp.properties['legal_hold']) + self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + + # Cleanup + blob.set_legal_hold(False) + blob.delete_immutability_policy() + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + + @GlobalStorageAccountPreparer() + def test_list_blobs_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + container_client = self.bsc.get_container_client(container_name) + blob = self.bsc.get_blob_client(container_name, blob_name) + content = b"abcedfg" + blob.upload_blob(content, + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + overwrite=True) + + blob_list = list(container_client.list_blobs(include=['immutabilitypolicy', 'legalhold'])) + + self.assertTrue(blob_list[0]['legal_hold']) + self.assertIsNotNone(blob_list[0]['immutability_policy_expiry_time']) + self.assertIsNotNone(blob_list[0]['immutability_policy_mode']) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 679bbb343970..8bcad12baa65 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -16,6 +16,9 @@ import uuid from datetime import datetime, timedelta +from azure.mgmt.storage.aio import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.credentials import AzureSasCredential from azure.core.exceptions import ( @@ -49,7 +52,7 @@ AccessPolicy, ResourceTypes, AccountSasPermissions, - StandardBlobTier, RehydratePriority) + StandardBlobTier, RehydratePriority, BlobImmutabilityPolicyMode) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -1432,6 +1435,44 @@ async def test_copy_blob_with_existing_blob(self, resource_group, location, stor copy_content = await (await copyblob.download_blob()).readall() self.assertEqual(copy_content, self.byte_data) + @GlobalStorageAccountPreparer() + async def test_copy_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = await self._create_block_blob() + # Act + sourceblob = '{0}/{1}/{2}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob_name) + + copyblob = self.bsc.get_blob_client(container_name, 'blob1copy') + copy = await copyblob.start_copy_from_url(sourceblob, + immutability_policy_expiry_time=datetime.utcnow() + timedelta( + seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + ) + + download_resp = await copyblob.download_blob() + self.assertEqual(await download_resp.readall(), self.byte_data) + + self.assertTrue(download_resp.properties['legal_hold']) + self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(copy) + self.assertEqual(copy['copy_status'], 'success') + self.assertFalse(isinstance(copy['copy_status'], Enum)) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) # @GlobalStorageAccountPreparer() # @AsyncStorageTestCase.await_prepared_test @@ -2488,4 +2529,150 @@ async def test_transport_closed_only_once(self, resource_group, location, storag await bsc.get_service_properties() assert transport.session is not None + @GlobalStorageAccountPreparer() + async def test_blob_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + await blob.upload_blob(b"abc", overwrite=True) + resp = await blob.set_immutability_policy( + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + + # Assert + # check immutability policy after set_immutability_policy() + props = await blob.get_blob_properties() + self.assertIsNotNone(resp['immutability_policy_until_date']) + self.assertIsNotNone(resp['immutability_policy_mode']) + self.assertIsNotNone(props.immutability_policy_expiry_time) + self.assertIsNotNone(props.immutability_policy_mode) + self.assertEqual(props.immutability_policy_mode, "unlocked") + + # check immutability policy after delete_immutability_policy() + await blob.delete_immutability_policy() + props = await blob.get_blob_properties() + self.assertIsNone(props.immutability_policy_mode) + self.assertIsNone(props.immutability_policy_mode) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + + @GlobalStorageAccountPreparer() + async def test_blob_legal_hold(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + await blob.upload_blob(b"abc", overwrite=True) + resp = await blob.set_legal_hold(True) + props = await blob.get_blob_properties() + + with self.assertRaises(HttpResponseError): + await blob.delete_blob() + + self.assertTrue(resp['legal_hold']) + self.assertTrue(props['legal_hold']) + + resp2 = await blob.set_legal_hold(False) + props2 = await blob.get_blob_properties() + + self.assertFalse(resp2['legal_hold']) + self.assertFalse(props2['legal_hold']) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + + @GlobalStorageAccountPreparer() + async def test_download_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + blob = self.bsc.get_blob_client(container_name, blob_name) + content = b"abcedfg" + await blob.upload_blob(content, + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + overwrite=True) + + download_resp = await blob.download_blob() + + with self.assertRaises(HttpResponseError): + await blob.delete_blob() + + self.assertTrue(download_resp.properties['legal_hold']) + self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + + # Cleanup + await blob.set_legal_hold(False) + await blob.delete_immutability_policy() + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + + @GlobalStorageAccountPreparer() + async def test_list_blobs_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + # Act + blob_name = self.get_resource_name('vlwblob') + container_client = self.bsc.get_container_client(container_name) + blob = self.bsc.get_blob_client(container_name, blob_name) + content = b"abcedfg" + await blob.upload_blob(content, + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True, + overwrite=True) + + blob_list = list() + async for blob in container_client.list_blobs(include=['immutabilitypolicy', 'legalhold']): + blob_list.append(blob) + + self.assertTrue(blob_list[0]['legal_hold']) + self.assertIsNotNone(blob_list[0]['immutability_policy_expiry_time']) + self.assertIsNotNone(blob_list[0]['immutability_policy_mode']) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_container.py b/sdk/storage/azure-storage-blob/tests/test_container.py index 4608f7a7bc17..e2a538568dfe 100644 --- a/sdk/storage/azure-storage-blob/tests/test_container.py +++ b/sdk/storage/azure-storage-blob/tests/test_container.py @@ -224,6 +224,7 @@ def test_list_containers(self, resource_group, location, storage_account, storag self.assertNamedItemInContainer(containers, container.container_name) self.assertIsNotNone(containers[0].has_immutability_policy) self.assertIsNotNone(containers[0].has_legal_hold) + self.assertIsNotNone(containers[0].is_immutable_storage_with_versioning_enabled) @GlobalStorageAccountPreparer() def test_list_containers_with_prefix(self, resource_group, location, storage_account, storage_account_key): @@ -396,6 +397,7 @@ def test_get_container_properties(self, resource_group, location, storage_accoun # Assert self.assertIsNotNone(props) self.assertDictEqual(props.metadata, metadata) + self.assertIsNotNone(props.is_immutable_storage_with_versioning_enabled) # self.assertEqual(props.lease.duration, 'infinite') # self.assertEqual(props.lease.state, 'leased') # self.assertEqual(props.lease.status, 'locked') diff --git a/sdk/storage/azure-storage-blob/tests/test_container_async.py b/sdk/storage/azure-storage-blob/tests/test_container_async.py index c6d60e99ddd9..ca484e0403b6 100644 --- a/sdk/storage/azure-storage-blob/tests/test_container_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_container_async.py @@ -276,6 +276,7 @@ async def test_list_containers(self, resource_group, location, storage_account, self.assertNamedItemInContainer(containers, container.container_name) self.assertIsNotNone(containers[0].has_immutability_policy) self.assertIsNotNone(containers[0].has_legal_hold) + self.assertIsNotNone(containers[0].is_immutable_storage_with_versioning_enabled) @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test @@ -476,6 +477,7 @@ async def test_get_container_properties(self, resource_group, location, storage_ # Assert self.assertIsNotNone(props) self.assertDictEqual(props.metadata, metadata) + self.assertIsNotNone(props.is_immutable_storage_with_versioning_enabled) # self.assertEqual(props.lease.duration, 'infinite') # self.assertEqual(props.lease.state, 'leased') # self.assertEqual(props.lease.status, 'locked') diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob.py b/sdk/storage/azure-storage-blob/tests/test_page_blob.py index ec8c669868f3..660250a0b1cf 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob.py @@ -12,6 +12,10 @@ import unittest import uuid from datetime import datetime, timedelta + +from azure.mgmt.storage import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError @@ -25,7 +29,7 @@ PremiumPageBlobTier, SequenceNumberAction, StorageErrorCode, - generate_blob_sas) + generate_blob_sas, BlobImmutabilityPolicyMode) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from azure.storage.blob._shared.policies import StorageContentValidation from _shared.testcase import StorageTestCase, GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -139,6 +143,39 @@ def test_create_blob(self, resource_group, location, storage_account, storage_ac self.assertIsNotNone(resp.get('last_modified')) self.assertTrue(blob.get_blob_properties()) + @GlobalStorageAccountPreparer() + def test_create_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + bsc = BlobServiceClient(self.account_url(storage_account, "blob"), credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024) + self._setup(bsc) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = self.get_resource_name("vlwblob") + blob = bsc.get_blob_client(container_name, blob_name) + + # Act + resp = blob.create_page_blob(1024, immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True) + props = blob.get_blob_properties() + + # Assert + self.assertIsNotNone(resp.get('etag')) + self.assertIsNotNone(resp.get('last_modified')) + self.assertTrue(props['legal_hold']) + self.assertIsNotNone(props['immutability_policy_expiry_time']) + self.assertIsNotNone(props['immutability_policy_mode']) + + if self.is_live: + mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + @pytest.mark.playback_test_only @GlobalStorageAccountPreparer() def test_create_page_blob_returns_vid(self, resource_group, location, storage_account, storage_account_key): diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py index 35e5890ef8ff..a13786860852 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py @@ -13,6 +13,9 @@ import uuid from datetime import datetime, timedelta +from azure.mgmt.storage.aio import StorageManagementClient +from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError from azure.core.pipeline.transport import AioHttpTransport @@ -27,8 +30,8 @@ PremiumPageBlobTier, SequenceNumberAction, StorageErrorCode, - generate_blob_sas -) + generate_blob_sas, + BlobImmutabilityPolicyMode) from azure.storage.blob.aio import ( BlobServiceClient, @@ -157,6 +160,40 @@ async def test_create_blob(self, resource_group, location, storage_account, stor self.assertIsNotNone(resp.get('last_modified')) self.assertTrue(await blob.get_blob_properties()) + @GlobalStorageAccountPreparer() + async def test_create_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): + bsc = BlobServiceClient(self.account_url(storage_account, "blob"), credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024) + await self._setup(bsc) + + container_name = self.get_resource_name('vlwcontainer') + if self.is_live: + token_credential = self.generate_oauth_token() + subscription_id = self.get_settings_value("SUBSCRIPTION_ID") + mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') + property = mgmt_client.models().BlobContainer( + immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + + blob_name = self.get_resource_name("vlwblob") + blob = bsc.get_blob_client(container_name, blob_name) + + # Act + resp = await blob.create_page_blob(1024, + immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), + immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + legal_hold=True) + props = await blob.get_blob_properties() + + # Assert + self.assertIsNotNone(resp.get('etag')) + self.assertIsNotNone(resp.get('last_modified')) + self.assertTrue(props['legal_hold']) + self.assertIsNotNone(props['immutability_policy_expiry_time']) + self.assertIsNotNone(props['immutability_policy_mode']) + + if self.is_live: + await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + @pytest.mark.playback_test_only @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test From 90b6c9a5e08865742bcda1ec8c8e3be9a3371b2d Mon Sep 17 00:00:00 2001 From: xiafu Date: Fri, 4 Jun 2021 10:54:22 -0700 Subject: [PATCH 02/14] edit import mgmt plane models --- .../azure-storage-blob/tests/test_append_blob.py | 4 ++-- .../tests/test_append_blob_async.py | 4 ++-- .../azure-storage-blob/tests/test_block_blob.py | 4 ++-- .../tests/test_block_blob_async.py | 4 ++-- .../azure-storage-blob/tests/test_common_blob.py | 14 +++++++------- .../tests/test_common_blob_async.py | 11 +++++------ .../azure-storage-blob/tests/test_page_blob.py | 4 ++-- .../tests/test_page_blob_async.py | 4 ++-- 8 files changed, 24 insertions(+), 25 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index 0c255a4811e2..254fc4b3395e 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -16,7 +16,7 @@ from datetime import datetime, timedelta from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import ResourceNotFoundError, ResourceModifiedError, HttpResponseError @@ -1336,7 +1336,7 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index 684578f8e06f..b3fb5d644fd1 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -18,7 +18,7 @@ import uuid from azure.mgmt.storage.aio import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceNotFoundError, ResourceModifiedError @@ -1419,7 +1419,7 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index 027347a7ee96..4a5f4b035057 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -13,7 +13,7 @@ import uuid from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.storage.blob._shared.policies import StorageContentValidation @@ -435,7 +435,7 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = self._get_blob_reference() diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index 1020d4c3516a..8b0123e53ca5 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -14,7 +14,7 @@ from datetime import datetime, timedelta from azure.mgmt.storage.aio import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.storage.blob._shared.policies import StorageContentValidation @@ -539,7 +539,7 @@ async def test_put_block_with_immutability_policy(self, resource_group, location mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = self._get_blob_reference() diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index a08e7d28b963..782dc4403b44 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -15,7 +15,7 @@ from datetime import datetime, timedelta from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.credentials import AzureSasCredential @@ -1173,7 +1173,7 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = self._create_block_blob() @@ -1776,7 +1776,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = self.get_resource_name('vlwblob') @@ -2527,7 +2527,7 @@ def test_blob_immutability_policy(self, resource_group, location, storage_accoun subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act @@ -2565,7 +2565,7 @@ def test_blob_legal_hold(self, resource_group, location, storage_account, storag subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act @@ -2599,7 +2599,7 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act @@ -2637,7 +2637,7 @@ def test_list_blobs_with_immutability_policy(self, resource_group, location, sto subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 8bcad12baa65..2a326ee47ff1 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -17,7 +17,6 @@ from datetime import datetime, timedelta from azure.mgmt.storage.aio import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning from azure.core import MatchConditions from azure.core.credentials import AzureSasCredential @@ -1445,7 +1444,7 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = await self._create_block_blob() @@ -2539,7 +2538,7 @@ async def test_blob_immutability_policy(self, resource_group, location, storage_ subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act @@ -2578,7 +2577,7 @@ async def test_blob_legal_hold(self, resource_group, location, storage_account, subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act @@ -2612,7 +2611,7 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act @@ -2650,7 +2649,7 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) # Act diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob.py b/sdk/storage/azure-storage-blob/tests/test_page_blob.py index 660250a0b1cf..45cee02055fd 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob.py @@ -14,7 +14,7 @@ from datetime import datetime, timedelta from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError @@ -154,7 +154,7 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = self.get_resource_name("vlwblob") diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py index a13786860852..4f05ebd042e3 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py @@ -14,7 +14,7 @@ from datetime import datetime, timedelta from azure.mgmt.storage.aio import StorageManagementClient -from azure.mgmt.storage.v2021_04_01.models import ImmutableStorageWithVersioning + from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError @@ -171,7 +171,7 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati subscription_id = self.get_settings_value("SUBSCRIPTION_ID") mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( - immutable_storage_with_versioning=ImmutableStorageWithVersioning(enabled=True)) + immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) blob_name = self.get_resource_name("vlwblob") From 3939a3f304f82135c5edd66a1ddb613a4e19a84c Mon Sep 17 00:00:00 2001 From: xiafu Date: Mon, 7 Jun 2021 15:02:54 -0700 Subject: [PATCH 03/14] fix doc pylint dependencies --- .../azure/storage/blob/_blob_client.py | 2 +- .../azure/storage/blob/_models.py | 24 ++++++++++++++++++- .../storage/blob/aio/_blob_client_async.py | 2 +- .../azure-storage-blob/dev_requirements.txt | 1 + 4 files changed, 26 insertions(+), 3 deletions(-) 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 4dcab7de7beb..ac45a10ada75 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 @@ -1432,7 +1432,7 @@ def delete_immutability_policy(self, **kwargs): @distributed_trace def set_legal_hold(self, legal_hold, **kwargs): - # type: (**Any) -> Dict[str, str] + # type: (**Any) -> Dict[str, Union[str, datetime, bool]] """The Set Legal Hold operation sets a legal hold on the blob. .. versionadded:: 12.10.0 diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py index 31c4d58780ce..779e6313b4a5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -358,7 +358,8 @@ def _from_generated(cls, generated): props.lease = LeaseProperties._from_generated(generated) # pylint: disable=protected-access props.public_access = generated.properties.public_access props.has_immutability_policy = generated.properties.has_immutability_policy - props.is_immutable_storage_with_versioning_enabled = generated.properties.is_immutable_storage_with_versioning_enabled + props.is_immutable_storage_with_versioning_enabled = \ + generated.properties.is_immutable_storage_with_versioning_enabled props.deleted = generated.deleted props.version = generated.version props.has_legal_hold = generated.properties.has_legal_hold @@ -528,6 +529,27 @@ class BlobProperties(DictMixin): .. versionadded:: 12.4.0 + :ivar ~datetime.datetime immutability_policy_expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :ivar str immutability_policy_mode: + Specifies the immutability policy mode to set on the blob. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :ivar bool legal_hold: + Specified if a legal hold should be set on the blob. + Currently this parameter of upload_blob() API is for BlockBlob only. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + """ def __init__(self, **kwargs): 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 9b79575ef93b..f3482acd8e02 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 @@ -852,7 +852,7 @@ async def delete_immutability_policy(self, **kwargs): @distributed_trace_async async def set_legal_hold(self, legal_hold, **kwargs): - # type: (**Any) -> Dict[str, str] + # type: (**Any) -> Dict[str, Union[str, datetime, bool]] """The Set Legal Hold operation sets a legal hold on the blob. .. versionadded:: 12.10.0 diff --git a/sdk/storage/azure-storage-blob/dev_requirements.txt b/sdk/storage/azure-storage-blob/dev_requirements.txt index 9938821516f1..bd84436b2565 100644 --- a/sdk/storage/azure-storage-blob/dev_requirements.txt +++ b/sdk/storage/azure-storage-blob/dev_requirements.txt @@ -2,4 +2,5 @@ -e ../../../tools/azure-sdk-tools ../../core/azure-core -e ../../identity/azure-identity +-e ../../storage/azure-mgmt-storage aiohttp>=3.0; python_version >= '3.5' From aa14b21fc77ecc36d82593635cc4dbba34abea75 Mon Sep 17 00:00:00 2001 From: xiafu Date: Mon, 7 Jun 2021 22:34:14 -0700 Subject: [PATCH 04/14] fix test --- .../azure-storage-blob/azure/storage/blob/_blob_client.py | 1 - .../azure-storage-blob/azure/storage/blob/_upload_helpers.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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 ac45a10ada75..378eca7a1f7b 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 @@ -407,7 +407,6 @@ def _upload_blob_options( # pylint:disable=too-many-statements kwargs['blob_settings'] = self._config kwargs['max_concurrency'] = max_concurrency kwargs['encryption_options'] = encryption_options - kwargs['immutability_policy_expiry'] = kwargs.pop('immutability_policy_expiry_time', None) if blob_type == BlobType.BlockBlob: kwargs['client'] = self._client.block_blob diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py index d62ffddeca08..5acedff2adeb 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py @@ -79,7 +79,7 @@ def upload_block_blob( # pylint: disable=too-many-locals blob_headers = kwargs.pop('blob_headers', None) tier = kwargs.pop('standard_blob_tier', None) blob_tags_string = kwargs.pop('blob_tags_string', None) - immutability_policy_expiry = kwargs.pop('immutability_policy_expiry', None) + immutability_policy_expiry = kwargs.pop('immutability_policy_expiry_time', None) immutability_policy_mode = kwargs.pop('immutability_policy_mode', None) legal_hold = kwargs.pop('legal_hold', None) From c581de094bb3befe92e8319e2608bda529aa373a Mon Sep 17 00:00:00 2001 From: xiafu Date: Mon, 19 Jul 2021 11:22:26 -0700 Subject: [PATCH 05/14] rename immutability_policy permission --- .../azure/storage/blob/_blob_client.py | 2 +- .../azure/storage/blob/_models.py | 26 ++++++++++--------- .../azure/storage/blob/_shared/models.py | 13 +++++----- .../storage/blob/aio/_blob_client_async.py | 2 +- .../tests/test_common_blob.py | 6 ++--- 5 files changed, 26 insertions(+), 23 deletions(-) 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 9ada2e3fb52a..b210771c6a9a 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 @@ -2057,7 +2057,7 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, :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] + :rtype: dict[str, Union[str, ~datetime.datetime]] .. admonition:: Example: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py index 4d4faa8f4529..a9ff3e3189cc 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -885,8 +885,9 @@ class ContainerSasPermissions(object): List blobs in the container. :param bool tag: Set or get tags on the blobs in the container. - :keyword bool immutability_policy: - To enable operations related to immutability policy. + :keyword bool set_immutability_policy: + To enable operations related to set/delete immutability policy. + To get immutability policy, you just need read permission. """ def __init__(self, read=False, write=False, delete=False, list=False, delete_previous_version=False, tag=False, **kwargs): # pylint: disable=redefined-builtin @@ -896,14 +897,14 @@ def __init__(self, read=False, write=False, delete=False, self.list = list self.delete_previous_version = delete_previous_version self.tag = tag - self.immutability_policy = kwargs.pop('immutability_policy', False) + self.set_immutability_policy = kwargs.pop('set_immutability_policy', False) self._str = (('r' if self.read else '') + ('w' if self.write else '') + ('d' if self.delete else '') + ('x' if self.delete_previous_version else '') + ('l' if self.list else '') + ('t' if self.tag else '') + - ('i' if self.immutability_policy else '')) + ('i' if self.set_immutability_policy else '')) def __str__(self): return self._str @@ -927,10 +928,10 @@ def from_string(cls, permission): p_list = 'l' in permission p_delete_previous_version = 'x' in permission p_tag = 't' in permission - p_immutability_policy = 'i' in permission + p_set_immutability_policy = 'i' in permission parsed = cls(read=p_read, write=p_write, delete=p_delete, list=p_list, delete_previous_version=p_delete_previous_version, tag=p_tag, - immutability_policy=p_immutability_policy) + set_immutability_policy=p_set_immutability_policy) return parsed @@ -956,8 +957,9 @@ class BlobSasPermissions(object): Delete the previous blob version for the versioning enabled storage account. :param bool tag: Set or get tags on the blob. - :keyword bool immutability_policy: - To enable operations related to immutability policy. + :keyword bool set_immutability_policy: + To enable operations related to set/delete immutability policy. + To get immutability policy, you just need read permission. """ def __init__(self, read=False, add=False, create=False, write=False, delete=False, delete_previous_version=False, tag=True, **kwargs): @@ -968,7 +970,7 @@ def __init__(self, read=False, add=False, create=False, write=False, self.delete = delete self.delete_previous_version = delete_previous_version self.tag = tag - self.immutability_policy = kwargs.pop('immutability_policy', False) + self.set_immutability_policy = kwargs.pop('set_immutability_policy', False) self._str = (('r' if self.read else '') + ('a' if self.add else '') + ('c' if self.create else '') + @@ -976,7 +978,7 @@ def __init__(self, read=False, add=False, create=False, write=False, ('d' if self.delete else '') + ('x' if self.delete_previous_version else '') + ('t' if self.tag else '') + - ('i' if self.immutability_policy else '')) + ('i' if self.set_immutability_policy else '')) def __str__(self): return self._str @@ -1001,11 +1003,11 @@ def from_string(cls, permission): p_delete = 'd' in permission p_delete_previous_version = 'x' in permission p_tag = 't' in permission - p_immutability_policy = 'i' in permission + p_set_immutability_policy = 'i' in permission parsed = cls(read=p_read, add=p_add, create=p_create, write=p_write, delete=p_delete, delete_previous_version=p_delete_previous_version, tag=p_tag, - immutability_policy=p_immutability_policy) + set_immutability_policy=p_set_immutability_policy) return parsed diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py index 58b4cb238428..6f6052a642f3 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/models.py @@ -328,8 +328,9 @@ class AccountSasPermissions(object): To enable set or get tags on the blobs in the container. :keyword bool filter_by_tags: To enable get blobs by tags, this should be used together with list permission. - :keyword bool immutability_policy: - To enable operations related to immutability policy. + :keyword bool set_immutability_policy: + To enable operations related to set/delete immutability policy. + To get immutability policy, you just need read permission. """ def __init__(self, read=False, write=False, delete=False, list=False, # pylint: disable=redefined-builtin @@ -345,7 +346,7 @@ def __init__(self, read=False, write=False, delete=False, self.process = process self.tag = kwargs.pop('tag', False) self.filter_by_tags = kwargs.pop('filter_by_tags', False) - self.immutability_policy = kwargs.pop('immutability_policy', False) + self.set_immutability_policy = kwargs.pop('set_immutability_policy', False) self._str = (('r' if self.read else '') + ('w' if self.write else '') + ('d' if self.delete else '') + @@ -357,7 +358,7 @@ def __init__(self, read=False, write=False, delete=False, ('p' if self.process else '') + ('f' if self.filter_by_tags else '') + ('t' if self.tag else '') + - ('i' if self.immutability_policy else '') + ('i' if self.set_immutability_policy else '') ) def __str__(self): @@ -387,10 +388,10 @@ def from_string(cls, permission): p_process = 'p' in permission p_tag = 't' in permission p_filter_by_tags = 'f' in permission - p_immutability_policy = 'i' in permission + p_set_immutability_policy = 'i' in permission parsed = cls(read=p_read, write=p_write, delete=p_delete, delete_previous_version=p_delete_previous_version, list=p_list, add=p_add, create=p_create, update=p_update, process=p_process, tag=p_tag, - filter_by_tags=p_filter_by_tags, immutability_policy=p_immutability_policy) + filter_by_tags=p_filter_by_tags, set_immutability_policy=p_set_immutability_policy) return parsed 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 4f74813ca39c..33b44e43bd49 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 @@ -1298,7 +1298,7 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= :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] + :rtype: dict[str, Union[str, ~datetime.datetime]] .. admonition:: Example: diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index 22eddcf7fa76..debf2c5961d6 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -1789,7 +1789,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora self.bsc.account_name, self.bsc.credential.account_key, ResourceTypes(container=True, object=True), - AccountSasPermissions(read=True, immutability_policy=True), + AccountSasPermissions(read=True, set_immutability_policy=True), datetime.utcnow() + timedelta(hours=1), ) blob = BlobClient( @@ -1809,7 +1809,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora self.bsc.account_name, container_name, account_key=self.bsc.credential.account_key, - permission=ContainerSasPermissions(read=True, immutability_policy=True), + permission=ContainerSasPermissions(read=True, set_immutability_policy=True), expiry=datetime.utcnow() + timedelta(hours=1), ) blob1 = BlobClient( @@ -1827,7 +1827,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora container_name, blob_name, account_key=self.bsc.credential.account_key, - permission=BlobSasPermissions(read=True, immutability_policy=True), + permission=BlobSasPermissions(read=True, set_immutability_policy=True), expiry=datetime.utcnow() + timedelta(hours=1), ) blob2 = BlobClient( From 86b677f2c0e1c7d74bc594d536be1cfc5487162c Mon Sep 17 00:00:00 2001 From: xiafu Date: Mon, 19 Jul 2021 15:41:11 -0700 Subject: [PATCH 06/14] rename legal_hold --- sdk/storage/azure-storage-blob/azure/storage/blob/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py index a9ff3e3189cc..0ab26b1c4203 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -555,7 +555,7 @@ class BlobProperties(DictMixin): .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :ivar bool legal_hold: + :ivar bool has_legal_hold: Specified if a legal hold should be set on the blob. Currently this parameter of upload_blob() API is for BlockBlob only. @@ -603,7 +603,7 @@ def __init__(self, **kwargs): self.tags = None self.immutability_policy_expiry_time = kwargs.get('x-ms-immutability-policy-until-date') self.immutability_policy_mode = kwargs.get('x-ms-immutability-policy-mode') - self.legal_hold = kwargs.get('x-ms-legal-hold') + self.has_legal_hold = kwargs.get('x-ms-legal-hold') self.has_versions_only = None class FilteredBlob(DictMixin): From c2d9026d014bb90e57d53bdeb4676ef8d72ed3f9 Mon Sep 17 00:00:00 2001 From: Xiaoxi Fu <49707495+xiafu-msft@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:41:23 -0700 Subject: [PATCH 07/14] Update _deserialize.py --- .../azure-storage-blob/azure/storage/blob/_deserialize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py index de46cf7c5c9b..47437b12d52e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py @@ -155,7 +155,7 @@ def get_blob_properties_from_generated_code(generated): blob.last_accessed_on = generated.properties.last_accessed_on blob.immutability_policy_expiry_time = generated.properties.immutability_policy_expires_on blob.immutability_policy_mode = generated.properties.immutability_policy_mode - blob.legal_hold = generated.properties.legal_hold + blob.has_legal_hold = generated.properties.legal_hold blob.has_versions_only = generated.has_versions_only return blob From 197c3390edff5fa732b9519a2868291c3b79f2ec Mon Sep 17 00:00:00 2001 From: xiafu Date: Mon, 19 Jul 2021 17:49:36 -0700 Subject: [PATCH 08/14] rename legal_hold --- .../azure-storage-blob/tests/test_append_blob.py | 2 +- .../azure-storage-blob/tests/test_append_blob_async.py | 2 +- .../azure-storage-blob/tests/test_common_blob.py | 10 +++++----- .../azure-storage-blob/tests/test_common_blob_async.py | 4 ++-- sdk/storage/azure-storage-blob/tests/test_page_blob.py | 2 +- .../azure-storage-blob/tests/test_page_blob_async.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index bbf00a349aa3..e00d33ff28a5 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -1351,7 +1351,7 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat with self.assertRaises(HttpResponseError): blob.delete_blob() - self.assertTrue(props['legal_hold']) + self.assertTrue(props['has_legal_hold']) self.assertIsNotNone(props['immutability_policy_expiry_time']) self.assertIsNotNone(props['immutability_policy_mode']) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index ed45091c3d48..b843ee548f39 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -1434,7 +1434,7 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ with self.assertRaises(HttpResponseError): await blob.delete_blob() - self.assertTrue(props['legal_hold']) + self.assertTrue(props['has_legal_hold']) self.assertIsNotNone(props['immutability_policy_expiry_time']) self.assertIsNotNone(props['immutability_policy_mode']) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index debf2c5961d6..17abeeb28b56 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -1192,7 +1192,7 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor download_resp = copyblob.download_blob() self.assertEqual(download_resp.readall(), self.byte_data) - self.assertTrue(download_resp.properties['legal_hold']) + self.assertTrue(download_resp.properties['has_legal_hold']) self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) self.assertIsNotNone(copy) @@ -2580,13 +2580,13 @@ def test_blob_legal_hold(self, resource_group, location, storage_account, storag blob.delete_blob() self.assertTrue(resp['legal_hold']) - self.assertTrue(props['legal_hold']) + self.assertTrue(props['has_legal_hold']) resp2 = blob.set_legal_hold(False) props2 = blob.get_blob_properties() self.assertFalse(resp2['legal_hold']) - self.assertFalse(props2['legal_hold']) + self.assertFalse(props2['has_legal_hold']) if self.is_live: mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) @@ -2618,7 +2618,7 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, with self.assertRaises(HttpResponseError): blob.delete_blob() - self.assertTrue(download_resp.properties['legal_hold']) + self.assertTrue(download_resp.properties['has_legal_hold']) self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) @@ -2654,7 +2654,7 @@ def test_list_blobs_with_immutability_policy(self, resource_group, location, sto blob_list = list(container_client.list_blobs(include=['immutabilitypolicy', 'legalhold'])) - self.assertTrue(blob_list[0]['legal_hold']) + self.assertTrue(blob_list[0]['has_legal_hold']) self.assertIsNotNone(blob_list[0]['immutability_policy_expiry_time']) self.assertIsNotNone(blob_list[0]['immutability_policy_mode']) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index fcd7b5f987ff..e25e7cb8e0b6 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -2591,13 +2591,13 @@ async def test_blob_legal_hold(self, resource_group, location, storage_account, await blob.delete_blob() self.assertTrue(resp['legal_hold']) - self.assertTrue(props['legal_hold']) + self.assertTrue(props['has_legal_hold']) resp2 = await blob.set_legal_hold(False) props2 = await blob.get_blob_properties() self.assertFalse(resp2['legal_hold']) - self.assertFalse(props2['legal_hold']) + self.assertFalse(props2['has_legal_hold']) if self.is_live: await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob.py b/sdk/storage/azure-storage-blob/tests/test_page_blob.py index 36950e4228f9..e0859d44c01d 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob.py @@ -170,7 +170,7 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st # Assert self.assertIsNotNone(resp.get('etag')) self.assertIsNotNone(resp.get('last_modified')) - self.assertTrue(props['legal_hold']) + self.assertTrue(props['has_legal_hold']) self.assertIsNotNone(props['immutability_policy_expiry_time']) self.assertIsNotNone(props['immutability_policy_mode']) diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py index dee492cc6851..1c1b2a0584b5 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py @@ -187,7 +187,7 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati # Assert self.assertIsNotNone(resp.get('etag')) self.assertIsNotNone(resp.get('last_modified')) - self.assertTrue(props['legal_hold']) + self.assertTrue(props['has_legal_hold']) self.assertIsNotNone(props['immutability_policy_expiry_time']) self.assertIsNotNone(props['immutability_policy_mode']) From 2593525f463d7000184645bdfa4499345043938b Mon Sep 17 00:00:00 2001 From: xiafu Date: Mon, 19 Jul 2021 19:42:15 -0700 Subject: [PATCH 09/14] rename legal_hold --- sdk/storage/azure-storage-blob/tests/test_block_blob.py | 2 +- .../azure-storage-blob/tests/test_block_blob_async.py | 2 +- .../azure-storage-blob/tests/test_common_blob_async.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index ecf128f3089c..77e294ac8dcb 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -459,7 +459,7 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor self.assertEqual(download_resp.readall(), b'AAABBBCCC') self.assertEqual(download_resp.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(download_resp.properties.last_modified, put_block_list_resp.get('last_modified')) - self.assertTrue(download_resp.properties['legal_hold']) + self.assertTrue(download_resp.properties['has_legal_hold']) self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index dd7ca43b23cf..c546ef78e4dd 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -563,7 +563,7 @@ async def test_put_block_with_immutability_policy(self, resource_group, location self.assertEqual(content, b'AAABBBCCC') self.assertEqual(download_resp.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(download_resp.properties.last_modified, put_block_list_resp.get('last_modified')) - self.assertTrue(download_resp.properties['legal_hold']) + self.assertTrue(download_resp.properties['has_legal_hold']) self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index e25e7cb8e0b6..89039fa82f47 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -1463,7 +1463,7 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location download_resp = await copyblob.download_blob() self.assertEqual(await download_resp.readall(), self.byte_data) - self.assertTrue(download_resp.properties['legal_hold']) + self.assertTrue(download_resp.properties['has_legal_hold']) self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) self.assertIsNotNone(copy) @@ -2629,7 +2629,7 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca with self.assertRaises(HttpResponseError): await blob.delete_blob() - self.assertTrue(download_resp.properties['legal_hold']) + self.assertTrue(download_resp.properties['has_legal_hold']) self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) @@ -2667,7 +2667,7 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio async for blob in container_client.list_blobs(include=['immutabilitypolicy', 'legalhold']): blob_list.append(blob) - self.assertTrue(blob_list[0]['legal_hold']) + self.assertTrue(blob_list[0]['has_legal_hold']) self.assertIsNotNone(blob_list[0]['immutability_policy_expiry_time']) self.assertIsNotNone(blob_list[0]['immutability_policy_mode']) From 8dea0929fcfd6c94655dc1af82ec0a459c186fce Mon Sep 17 00:00:00 2001 From: xiafu Date: Wed, 21 Jul 2021 22:55:26 -0700 Subject: [PATCH 10/14] Create ImmutabilityPolicy class --- .../azure/storage/blob/__init__.py | 4 +- .../azure/storage/blob/_blob_client.py | 100 +++++++----------- .../azure/storage/blob/_deserialize.py | 5 +- .../azure/storage/blob/_models.py | 43 +++++--- .../azure/storage/blob/_upload_helpers.py | 6 +- .../storage/blob/aio/_blob_client_async.py | 75 ++++--------- .../azure/storage/blob/aio/_upload_helpers.py | 6 +- .../tests/test_append_blob.py | 12 ++- .../tests/test_append_blob_async.py | 12 ++- .../tests/test_block_blob.py | 12 +-- .../tests/test_block_blob_async.py | 12 +-- .../tests/test_common_blob.py | 63 ++++++----- .../tests/test_common_blob_async.py | 49 +++++---- .../tests/test_page_blob.py | 11 +- .../tests/test_page_blob_async.py | 11 +- 15 files changed, 205 insertions(+), 216 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py index 1da75ac3d9b8..5c546a65b537 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py @@ -59,7 +59,8 @@ ArrowDialect, ArrowType, ObjectReplicationPolicy, - ObjectReplicationRule + ObjectReplicationRule, + ImmutabilityPolicy ) from ._list_blobs_helper import BlobPrefix @@ -197,6 +198,7 @@ def download_blob_from_url( 'PremiumPageBlobTier', 'SequenceNumberAction', 'BlobImmutabilityPolicyMode', + 'ImmutabilityPolicy', 'PublicAccess', 'BlobAnalyticsLogging', 'Metrics', 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 b210771c6a9a..ad4e34c13f45 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 @@ -645,21 +645,13 @@ def upload_blob( # pylint: disable=too-many-locals :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. - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. Currently this parameter of upload_blob() API is for BlockBlob only. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - Currently this parameter of upload_blob() API is for BlockBlob only. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. Currently this parameter of upload_blob() API is for BlockBlob only. @@ -1408,27 +1400,28 @@ def set_blob_metadata(self, metadata=None, **kwargs): process_storage_error(error) @distributed_trace - def set_immutability_policy(self, **kwargs): + def set_immutability_policy(self, immutability_policy, **kwargs): # type: (**Any) -> Dict[str, str] """The Set Immutability Policy operation sets the immutability policy on the blob. .. versionadded:: 12.10.0 This operation was introduced in API version '2020-10-02'. - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :param ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Key value pairs of blob tags. :rtype: Dict[str, str] """ - return self._client.blob.set_immutability_policy( - immutability_policy_expiry=kwargs.pop('immutability_policy_expiry_time', None), - cls=return_response_headers, **kwargs) + kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time + kwargs['immutability_policy_mode'] = immutability_policy.policy_mode + return self._client.blob.set_immutability_policy(cls=return_response_headers, **kwargs) @distributed_trace def delete_immutability_policy(self, **kwargs): @@ -1499,6 +1492,11 @@ def _create_page_blob_options( # type: ignore cpk_info = CpkInfo(encryption_key=cpk.key_value, encryption_key_sha256=cpk.key_hash, encryption_algorithm=cpk.algorithm) + immutability_policy = kwargs.pop('immutability_policy', None) + if immutability_policy: + kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time + kwargs['immutability_policy_mode'] = immutability_policy.policy_mode + if premium_page_blob_tier: try: headers['x-ms-access-tier'] = premium_page_blob_tier.value # type: ignore @@ -1512,7 +1510,6 @@ def _create_page_blob_options( # type: ignore 'blob_content_length': size, 'blob_sequence_number': sequence_number, 'blob_http_headers': blob_headers, - 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'timeout': kwargs.pop('timeout', None), 'lease_access_conditions': access_conditions, 'modified_access_conditions': mod_conditions, @@ -1566,19 +1563,12 @@ def create_page_blob( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. @@ -1658,12 +1648,17 @@ def _create_append_blob_options(self, content_settings=None, metadata=None, **kw raise ValueError("Customer provided encryption key must be used over HTTPS.") cpk_info = CpkInfo(encryption_key=cpk.key_value, encryption_key_sha256=cpk.key_hash, encryption_algorithm=cpk.algorithm) + + immutability_policy = kwargs.pop('immutability_policy', None) + if immutability_policy: + kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time + kwargs['immutability_policy_mode'] = immutability_policy.policy_mode + blob_tags_string = serialize_blob_tags_header(kwargs.pop('tags', None)) options = { 'content_length': 0, 'blob_http_headers': blob_headers, - 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'timeout': kwargs.pop('timeout', None), 'lease_access_conditions': access_conditions, 'modified_access_conditions': mod_conditions, @@ -1700,19 +1695,12 @@ def create_append_blob(self, content_settings=None, metadata=None, **kwargs): Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. @@ -1884,10 +1872,14 @@ def _start_copy_from_url_options(self, source_url, metadata=None, incremental_co dest_mod_conditions = get_modify_conditions(kwargs) blob_tags_string = serialize_blob_tags_header(kwargs.pop('tags', None)) + immutability_policy = kwargs.pop('immutability_policy', None) + if immutability_policy: + kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time + kwargs['immutability_policy_mode'] = immutability_policy.policy_mode + options = { 'copy_source': source_url, 'seal_blob': kwargs.pop('seal_destination_blob', None), - 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'timeout': timeout, 'modified_access_conditions': dest_mod_conditions, 'blob_tags_string': blob_tags_string, @@ -1972,19 +1964,12 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, .. versionadded:: 12.4.0 :paramtype tags: dict(str, str) - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. @@ -2534,6 +2519,11 @@ def _commit_block_list_options( # type: ignore cpk_info = CpkInfo(encryption_key=cpk.key_value, encryption_key_sha256=cpk.key_hash, encryption_algorithm=cpk.algorithm) + immutability_policy = kwargs.pop('immutability_policy', None) + if immutability_policy: + kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time + kwargs['immutability_policy_mode'] = immutability_policy.policy_mode + tier = kwargs.pop('standard_blob_tier', None) blob_tags_string = serialize_blob_tags_header(kwargs.pop('tags', None)) @@ -2547,7 +2537,6 @@ def _commit_block_list_options( # type: ignore 'validate_content': validate_content, 'cpk_scope_info': cpk_scope_info, 'cpk_info': cpk_info, - 'immutability_policy_expiry': kwargs.pop('immutability_policy_expiry_time', None), 'tier': tier.value if tier else None, 'blob_tags_string': blob_tags_string, 'headers': headers @@ -2588,19 +2577,12 @@ def commit_block_list( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py index 47437b12d52e..c724753efffa 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py @@ -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 @@ -153,8 +153,7 @@ 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_expiry_time = generated.properties.immutability_policy_expires_on - blob.immutability_policy_mode = generated.properties.immutability_policy_mode + 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 diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py index 0ab26b1c4203..eccd176af04d 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -435,6 +435,32 @@ def _build_item(item): return ContainerProperties._from_generated(item) # pylint: disable=protected-access +class ImmutabilityPolicy(DictMixin): + """Optional parameters for setting the immutability policy of a blob, blob snapshot or blob version. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + + :param ~datetime.datetime expiry_time: + Specifies the date time when the blobs immutability policy is set to expire. + :param str or ~azure.storage.blob.BlobImmutabilityPolicyMode policy_mode: + Specifies the immutability policy mode to set on the blob. + Possible values to set include: "Locked", "Unlocked". + "Mutable" can only be returned by service, don't set to "Mutable". + """ + + def __init__(self, expiry_time=None, policy_mode=None): + self.expiry_time = expiry_time + self.policy_mode = policy_mode + + @classmethod + def _from_generated(cls, generated): + immutability_policy = cls() + immutability_policy.expiry_time = generated.properties.immutability_policy_expires_on + immutability_policy.policy_mode = generated.properties.immutability_policy_mode + return immutability_policy + + class BlobProperties(DictMixin): """ Blob Properties. @@ -541,16 +567,8 @@ class BlobProperties(DictMixin): .. versionadded:: 12.10.0 - :ivar ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - Currently this parameter of upload_blob() API is for BlockBlob only. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :ivar str immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - Currently this parameter of upload_blob() API is for BlockBlob only. + :ivar ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. @@ -601,11 +619,12 @@ def __init__(self, **kwargs): self.last_accessed_on = kwargs.get('x-ms-last-access-time') self.tag_count = kwargs.get('x-ms-tag-count') self.tags = None - self.immutability_policy_expiry_time = kwargs.get('x-ms-immutability-policy-until-date') - self.immutability_policy_mode = kwargs.get('x-ms-immutability-policy-mode') + self.immutability_policy = ImmutabilityPolicy(expiry_time=kwargs.get('x-ms-immutability-policy-until-date'), + policy_mode=kwargs.get('x-ms-immutability-policy-mode')) self.has_legal_hold = kwargs.get('x-ms-legal-hold') self.has_versions_only = None + class FilteredBlob(DictMixin): """Blob info from a Filter Blobs API call. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py index 5acedff2adeb..30d5bfae9265 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py @@ -79,8 +79,10 @@ def upload_block_blob( # pylint: disable=too-many-locals blob_headers = kwargs.pop('blob_headers', None) tier = kwargs.pop('standard_blob_tier', None) blob_tags_string = kwargs.pop('blob_tags_string', None) - immutability_policy_expiry = kwargs.pop('immutability_policy_expiry_time', None) - immutability_policy_mode = kwargs.pop('immutability_policy_mode', None) + + immutability_policy = kwargs.pop('immutability_policy', None) + immutability_policy_expiry = None if immutability_policy is None else immutability_policy.expiry_time + immutability_policy_mode = None if immutability_policy is None else immutability_policy.policy_mode legal_hold = kwargs.pop('legal_hold', None) # Do single put if the size is smaller than or equal config.max_single_put_size 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 33b44e43bd49..6c4d9fa20d81 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 @@ -318,21 +318,13 @@ async def upload_blob( 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 ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. Currently this parameter of upload_blob() API is for BlockBlob only. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - Currently this parameter of upload_blob() API is for BlockBlob only. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. Currently this parameter of upload_blob() API is for BlockBlob only. @@ -811,27 +803,28 @@ async def set_blob_metadata(self, metadata=None, **kwargs): process_storage_error(error) @distributed_trace_async - async def set_immutability_policy(self, **kwargs): + async def set_immutability_policy(self, immutability_policy, **kwargs): # type: (**Any) -> Dict[str, str] """The Set Immutability Policy operation sets the immutability policy on the blob. .. versionadded:: 12.10.0 This operation was introduced in API version '2020-10-02'. - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str + :param ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. + + .. versionadded:: 12.10.0 + This was introduced in API version '2020-10-02'. + :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Key value pairs of blob tags. :rtype: Dict[str, str] """ - return await self._client.blob.set_immutability_policy( - immutability_policy_expiry=kwargs.pop('immutability_policy_expiry_time', None), - cls=return_response_headers, **kwargs) + kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time + kwargs['immutability_policy_mode'] = immutability_policy.policy_mode + return await self._client.blob.set_immutability_policy(cls=return_response_headers, **kwargs) @distributed_trace_async() async def delete_immutability_policy(self, **kwargs): @@ -909,19 +902,12 @@ async def create_page_blob( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.aio.BlobLeaseClient or str - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. @@ -995,19 +981,12 @@ async def create_append_blob(self, content_settings=None, metadata=None, **kwarg .. versionadded:: 12.4.0 :paramtype tags: dict(str, str) - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. @@ -1207,19 +1186,12 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= .. versionadded:: 12.4.0 :paramtype tags: dict(str, str) - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. @@ -1640,19 +1612,12 @@ async def commit_block_list( # type: ignore Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.aio.BlobLeaseClient or str - :keyword ~datetime.datetime immutability_policy_expiry_time: - Specifies the date time when the blobs immutability policy is set to expire. - - .. versionadded:: 12.10.0 - This was introduced in API version '2020-10-02'. - - :keyword immutability_policy_mode: - Specifies the immutability policy mode to set on the blob. + :keyword ~azure.storage.blob.ImmutabilityPolicy immutability_policy: + Specifies the immutability policy of a blob, blob snapshot or blob version. .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :paramtype immutability_policy_mode: ~azure.storage.blob.BlobImmutabilityPolicyMode or str :keyword bool legal_hold: Specified if a legal hold should be set on the blob. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py index f26340c4fec1..985e731b5766 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py @@ -54,8 +54,10 @@ async def upload_block_blob( # pylint: disable=too-many-locals blob_headers = kwargs.pop('blob_headers', None) tier = kwargs.pop('standard_blob_tier', None) blob_tags_string = kwargs.pop('blob_tags_string', None) - immutability_policy_expiry = kwargs.pop('immutability_policy_expiry', None) - immutability_policy_mode = kwargs.pop('immutability_policy_mode', None) + + immutability_policy = kwargs.pop('immutability_policy', None) + immutability_policy_expiry = None if immutability_policy is None else immutability_policy.expiry_time + immutability_policy_mode = None if immutability_policy is None else immutability_policy.policy_mode legal_hold = kwargs.pop('legal_hold', None) # Do single put if the size is smaller than config.max_single_put_size diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index e00d33ff28a5..9e02d99cd0ff 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -16,7 +16,7 @@ from datetime import datetime, timedelta from azure.mgmt.storage import StorageManagementClient - +from azure.mgmt.storage.v2018_02_01.models import ImmutabilityPolicy from azure.core import MatchConditions from azure.core.exceptions import ResourceNotFoundError, ResourceModifiedError, HttpResponseError @@ -1342,8 +1342,10 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat # Act blob_name = self.get_resource_name('vlwblob') blob = bsc.get_blob_client(container_name, blob_name) - blob.create_append_blob(immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + blob.create_append_blob(immutability_policy=immutability_policy, legal_hold=True) props = blob.get_blob_properties() @@ -1352,8 +1354,8 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat blob.delete_blob() self.assertTrue(props['has_legal_hold']) - self.assertIsNotNone(props['immutability_policy_expiry_time']) - self.assertIsNotNone(props['immutability_policy_mode']) + self.assertIsNotNone(props['immutability_policy']['expiry_time']) + self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index b843ee548f39..98ea5ed814a7 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -25,7 +25,7 @@ from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy -from azure.storage.blob import BlobSasPermissions, generate_blob_sas, BlobImmutabilityPolicyMode +from azure.storage.blob import BlobSasPermissions, generate_blob_sas, BlobImmutabilityPolicyMode, ImmutabilityPolicy from azure.storage.blob._shared.policies import StorageContentValidation from azure.storage.blob import BlobType from azure.storage.blob.aio import ( @@ -1425,8 +1425,10 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ # Act blob_name = self.get_resource_name('vlwblob') blob = bsc.get_blob_client(container_name, blob_name) - await blob.create_append_blob(immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + await blob.create_append_blob(immutability_policy=immutability_policy, legal_hold=True) props = await blob.get_blob_properties() @@ -1435,8 +1437,8 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ await blob.delete_blob() self.assertTrue(props['has_legal_hold']) - self.assertIsNotNone(props['immutability_policy_expiry_time']) - self.assertIsNotNone(props['immutability_policy_mode']) + self.assertIsNotNone(props['immutability_policy']['expiry_time']) + self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index 77e294ac8dcb..227934384e78 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -26,7 +26,7 @@ ContentSettings, BlobBlock, StandardBlobTier, generate_blob_sas, BlobSasPermissions, CustomerProvidedEncryptionKey, - BlobImmutabilityPolicyMode) + BlobImmutabilityPolicyMode, ImmutabilityPolicy) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -447,10 +447,10 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor # Act block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) put_block_list_resp = blob.commit_block_list(block_list, - immutability_policy_expiry_time=datetime.utcnow() + timedelta( - seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy=immutability_policy, legal_hold=True, ) @@ -460,8 +460,8 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor self.assertEqual(download_resp.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(download_resp.properties.last_modified, put_block_list_resp.get('last_modified')) self.assertTrue(download_resp.properties['has_legal_hold']) - self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) - self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) if self.is_live: mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index c546ef78e4dd..b26a90f82fde 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -32,7 +32,7 @@ StandardBlobTier, generate_blob_sas, BlobSasPermissions, CustomerProvidedEncryptionKey, - BlobImmutabilityPolicyMode) + BlobImmutabilityPolicyMode, ImmutabilityPolicy) from azure.storage.blob.aio import ( BlobServiceClient, @@ -550,10 +550,10 @@ async def test_put_block_with_immutability_policy(self, resource_group, location # Act block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) put_block_list_resp = await blob.commit_block_list(block_list, - immutability_policy_expiry_time=datetime.utcnow() + timedelta( - seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy=immutability_policy, legal_hold=True, ) @@ -564,8 +564,8 @@ async def test_put_block_with_immutability_policy(self, resource_group, location self.assertEqual(download_resp.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(download_resp.properties.last_modified, put_block_list_resp.get('last_modified')) self.assertTrue(download_resp.properties['has_legal_hold']) - self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) - self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) if self.is_live: await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index 17abeeb28b56..60a937699645 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -44,7 +44,7 @@ ResourceTypes, AccountSasPermissions, StandardBlobTier, - BlobImmutabilityPolicyMode) + BlobImmutabilityPolicyMode, ImmutabilityPolicy) from azure.storage.blob._generated.models import RehydratePriority from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -1183,9 +1183,9 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor self.account_url(storage_account, "blob"), self.container_name, blob_name) copyblob = self.bsc.get_blob_client(container_name, 'blob1copy') - copy = copyblob.start_copy_from_url(sourceblob, - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + copy = copyblob.start_copy_from_url(sourceblob, immutability_policy=immutability_policy, legal_hold=True, ) @@ -1193,8 +1193,8 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor self.assertEqual(download_resp.readall(), self.byte_data) self.assertTrue(download_resp.properties['has_legal_hold']) - self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) - self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) self.assertIsNotNone(copy) self.assertEqual(copy['copy_status'], 'success') self.assertFalse(isinstance(copy['copy_status'], Enum)) @@ -1794,9 +1794,9 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora ) blob = BlobClient( self.bsc.url, container_name= container_name, blob_name=blob_name, credential=account_sas_token) - resp_with_account_sas = blob.set_immutability_policy( - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + resp_with_account_sas = blob.set_immutability_policy(immutability_policy=immutability_policy) blob_response = requests.get(blob.url) # Assert response using account sas @@ -1814,9 +1814,10 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora ) blob1 = BlobClient( self.bsc.url, container_name=container_name, blob_name=blob_name, credential=container_sas_token) - resp_with_container_sas = blob1.set_immutability_policy( - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + resp_with_container_sas = blob1.set_immutability_policy(immutability_policy=immutability_policy) # Assert response using container sas self.assertIsNotNone(resp_with_container_sas['immutability_policy_until_date']) self.assertIsNotNone(resp_with_container_sas['immutability_policy_mode']) @@ -1832,9 +1833,9 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora ) blob2 = BlobClient( self.bsc.url, container_name=container_name, blob_name=blob_name, credential=blob_sas_token) - resp_with_blob_sas = blob2.set_immutability_policy( - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + resp_with_blob_sas = blob2.set_immutability_policy(immutability_policy=immutability_policy) # Assert response using blob sas self.assertIsNotNone(resp_with_blob_sas['immutability_policy_until_date']) @@ -2535,17 +2536,18 @@ def test_blob_immutability_policy(self, resource_group, location, storage_accoun blob_name = self.get_resource_name('vlwblob') blob = self.bsc.get_blob_client(container_name, blob_name) blob.upload_blob(b"abc", overwrite=True) - resp = blob.set_immutability_policy(immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + resp = blob.set_immutability_policy(immutability_policy=immutability_policy) # Assert # check immutability policy after set_immutability_policy() props = blob.get_blob_properties() self.assertIsNotNone(resp['immutability_policy_until_date']) self.assertIsNotNone(resp['immutability_policy_mode']) - self.assertIsNotNone(props.immutability_policy_expiry_time) - self.assertIsNotNone(props.immutability_policy_mode) - self.assertEqual(props.immutability_policy_mode, "unlocked") + self.assertIsNotNone(props['immutability_policy']['expiry_time']) + self.assertIsNotNone(props['immutability_policy']['policy_mode']) + self.assertEqual(props['immutability_policy']['policy_mode'], "unlocked") # check immutability policy after delete_immutability_policy() blob.delete_immutability_policy() @@ -2607,9 +2609,11 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, blob_name = self.get_resource_name('vlwblob') blob = self.bsc.get_blob_client(container_name, blob_name) content = b"abcedfg" + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) blob.upload_blob(content, - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy=immutability_policy, legal_hold=True, overwrite=True) @@ -2619,8 +2623,8 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, blob.delete_blob() self.assertTrue(download_resp.properties['has_legal_hold']) - self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) - self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) # Cleanup blob.set_legal_hold(False) @@ -2646,17 +2650,18 @@ def test_list_blobs_with_immutability_policy(self, resource_group, location, sto container_client = self.bsc.get_container_client(container_name) blob = self.bsc.get_blob_client(container_name, blob_name) content = b"abcedfg" - blob.upload_blob(content, - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + blob.upload_blob(content,immutability_policy=immutability_policy, legal_hold=True, overwrite=True) blob_list = list(container_client.list_blobs(include=['immutabilitypolicy', 'legalhold'])) self.assertTrue(blob_list[0]['has_legal_hold']) - self.assertIsNotNone(blob_list[0]['immutability_policy_expiry_time']) - self.assertIsNotNone(blob_list[0]['immutability_policy_mode']) + self.assertIsNotNone(blob_list[0]['immutability_policy']['expiry_time']) + self.assertIsNotNone(blob_list[0]['immutability_policy']['policy_mode']) if self.is_live: mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 89039fa82f47..c806239bc9fd 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -51,7 +51,7 @@ AccessPolicy, ResourceTypes, AccountSasPermissions, - StandardBlobTier, RehydratePriority, BlobImmutabilityPolicyMode) + StandardBlobTier, RehydratePriority, BlobImmutabilityPolicyMode, ImmutabilityPolicy) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -1453,10 +1453,11 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location self.account_url(storage_account, "blob"), self.container_name, blob_name) copyblob = self.bsc.get_blob_client(container_name, 'blob1copy') - copy = await copyblob.start_copy_from_url(sourceblob, - immutability_policy_expiry_time=datetime.utcnow() + timedelta( - seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + + copy = await copyblob.start_copy_from_url(sourceblob, immutability_policy=immutability_policy, legal_hold=True, ) @@ -1464,8 +1465,8 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location self.assertEqual(await download_resp.readall(), self.byte_data) self.assertTrue(download_resp.properties['has_legal_hold']) - self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) - self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) self.assertIsNotNone(copy) self.assertEqual(copy['copy_status'], 'success') self.assertFalse(isinstance(copy['copy_status'], Enum)) @@ -2545,24 +2546,26 @@ async def test_blob_immutability_policy(self, resource_group, location, storage_ blob_name = self.get_resource_name('vlwblob') blob = self.bsc.get_blob_client(container_name, blob_name) await blob.upload_blob(b"abc", overwrite=True) + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) resp = await blob.set_immutability_policy( - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + immutability_policy=immutability_policy) # Assert # check immutability policy after set_immutability_policy() props = await blob.get_blob_properties() self.assertIsNotNone(resp['immutability_policy_until_date']) self.assertIsNotNone(resp['immutability_policy_mode']) - self.assertIsNotNone(props.immutability_policy_expiry_time) - self.assertIsNotNone(props.immutability_policy_mode) + self.assertIsNotNone(props['immutability_policy']['expiry_time']) + self.assertIsNotNone(props['immutability_policy']['policy_mode']) self.assertEqual(props.immutability_policy_mode, "unlocked") # check immutability policy after delete_immutability_policy() await blob.delete_immutability_policy() props = await blob.get_blob_properties() - self.assertIsNone(props.immutability_policy_mode) - self.assertIsNone(props.immutability_policy_mode) + self.assertIsNone(props['immutability_policy']['policy_mode']) + self.assertIsNone(props['immutability_policy']['policy_mode']) if self.is_live: await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) @@ -2618,9 +2621,11 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca blob_name = self.get_resource_name('vlwblob') blob = self.bsc.get_blob_client(container_name, blob_name) content = b"abcedfg" + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) await blob.upload_blob(content, - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy=immutability_policy, legal_hold=True, overwrite=True) @@ -2630,8 +2635,8 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca await blob.delete_blob() self.assertTrue(download_resp.properties['has_legal_hold']) - self.assertIsNotNone(download_resp.properties['immutability_policy_expiry_time']) - self.assertIsNotNone(download_resp.properties['immutability_policy_mode']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['expiry_time']) + self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) # Cleanup await blob.set_legal_hold(False) @@ -2657,9 +2662,11 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio container_client = self.bsc.get_container_client(container_name) blob = self.bsc.get_blob_client(container_name, blob_name) content = b"abcedfg" + + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) await blob.upload_blob(content, - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy=immutability_policy, legal_hold=True, overwrite=True) @@ -2668,8 +2675,8 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio blob_list.append(blob) self.assertTrue(blob_list[0]['has_legal_hold']) - self.assertIsNotNone(blob_list[0]['immutability_policy_expiry_time']) - self.assertIsNotNone(blob_list[0]['immutability_policy_mode']) + self.assertIsNotNone(blob_list[0]['immutability_policy']['expiry_time']) + self.assertIsNotNone(blob_list[0]['immutability_policy']['policy_mode']) if self.is_live: await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob.py b/sdk/storage/azure-storage-blob/tests/test_page_blob.py index e0859d44c01d..d02a4bc0ca4a 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob.py @@ -29,7 +29,7 @@ PremiumPageBlobTier, SequenceNumberAction, StorageErrorCode, - generate_blob_sas, BlobImmutabilityPolicyMode) + generate_blob_sas, BlobImmutabilityPolicyMode, ImmutabilityPolicy) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer from azure.storage.blob._shared.policies import StorageContentValidation from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer @@ -162,8 +162,9 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st blob = bsc.get_blob_client(container_name, blob_name) # Act - resp = blob.create_page_blob(1024, immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + resp = blob.create_page_blob(1024, immutability_policy=immutability_policy, legal_hold=True) props = blob.get_blob_properties() @@ -171,8 +172,8 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st self.assertIsNotNone(resp.get('etag')) self.assertIsNotNone(resp.get('last_modified')) self.assertTrue(props['has_legal_hold']) - self.assertIsNotNone(props['immutability_policy_expiry_time']) - self.assertIsNotNone(props['immutability_policy_mode']) + self.assertIsNotNone(props['immutability_policy']['expiry_time']) + self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py index 1c1b2a0584b5..9a928f4d37ba 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py @@ -31,7 +31,7 @@ SequenceNumberAction, StorageErrorCode, generate_blob_sas, - BlobImmutabilityPolicyMode) + BlobImmutabilityPolicyMode, ImmutabilityPolicy) from azure.storage.blob.aio import ( BlobServiceClient, @@ -178,9 +178,10 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati blob = bsc.get_blob_client(container_name, blob_name) # Act + immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), + policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) resp = await blob.create_page_blob(1024, - immutability_policy_expiry_time=datetime.utcnow() + timedelta(seconds=5), - immutability_policy_mode=BlobImmutabilityPolicyMode.UNLOCKED, + immutability_policy=immutability_policy, legal_hold=True) props = await blob.get_blob_properties() @@ -188,8 +189,8 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati self.assertIsNotNone(resp.get('etag')) self.assertIsNotNone(resp.get('last_modified')) self.assertTrue(props['has_legal_hold']) - self.assertIsNotNone(props['immutability_policy_expiry_time']) - self.assertIsNotNone(props['immutability_policy_mode']) + self.assertIsNotNone(props['immutability_policy']['expiry_time']) + self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) From 880758c777f6fcb5ba2895366325354c7e2de393 Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 22 Jul 2021 00:29:42 -0700 Subject: [PATCH 11/14] consume BlobAccountPreparer --- .../tests/test_append_blob.py | 8 ++-- .../tests/test_append_blob_async.py | 10 ++--- .../tests/test_block_blob.py | 9 +++-- .../tests/test_block_blob_async.py | 9 +++-- .../tests/test_common_blob.py | 39 +++++++++++-------- .../tests/test_common_blob_async.py | 35 ++++++++++------- .../tests/test_container.py | 4 +- .../tests/test_container_async.py | 5 ++- .../tests/test_page_blob.py | 9 +++-- .../tests/test_page_blob_async.py | 9 +++-- 10 files changed, 78 insertions(+), 59 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index 9e02d99cd0ff..ece34e7a96b6 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -17,6 +17,7 @@ from azure.mgmt.storage import StorageManagementClient from azure.mgmt.storage.v2018_02_01.models import ImmutabilityPolicy +from devtools_testutils import BlobAccountPreparer, ResourceGroupPreparer from azure.core import MatchConditions from azure.core.exceptions import ResourceNotFoundError, ResourceModifiedError, HttpResponseError @@ -1325,7 +1326,8 @@ def test_copy_sealed_blob_with_seal_blob_will_get_a_sealed_blob(self, resource_g self.assertIsNone(prop.is_append_blob_sealed) copied_blob3.append_block("abc") - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_create_append_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): bsc = BlobServiceClient(self.account_url(storage_account, "blob"), storage_account_key, max_block_size=4 * 1024) self._setup(bsc) @@ -1337,7 +1339,7 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -1358,6 +1360,6 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index 98ea5ed814a7..d7784d12ddcf 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -18,7 +18,7 @@ import uuid from azure.mgmt.storage.aio import StorageManagementClient - +from devtools_testutils import BlobAccountPreparer from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceNotFoundError, ResourceModifiedError @@ -1407,8 +1407,8 @@ async def test_copy_sealed_blob_with_seal_blob_will_get_a_sealed_blob(self, reso self.assertIsNone(prop.is_append_blob_sealed) await copied_blob3.append_block("abc") - @GlobalStorageAccountPreparer() - @AsyncStorageTestCase.await_prepared_test + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_create_append_blob_with_immutability_policy_async(self, resource_group, location, storage_account, storage_account_key): bsc = BlobServiceClient(self.account_url(storage_account, "blob"), storage_account_key, max_block_size=4 * 1024) await self._setup(bsc) @@ -1420,7 +1420,7 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -1441,6 +1441,6 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index 227934384e78..298ff79216a5 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -27,7 +27,7 @@ BlobBlock, StandardBlobTier, generate_blob_sas, BlobSasPermissions, CustomerProvidedEncryptionKey, BlobImmutabilityPolicyMode, ImmutabilityPolicy) -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from devtools_testutils.storage import StorageTestCase @@ -425,7 +425,8 @@ def test_put_block_list(self, resource_group, location, storage_account, storage self.assertEqual(content.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(content.properties.last_modified, put_block_list_resp.get('last_modified')) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_put_block_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) container_name = self.get_resource_name('vlwcontainer') @@ -437,7 +438,7 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = self._get_blob_reference() blob = self.bsc.get_blob_client(container_name, blob_name) @@ -464,7 +465,7 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @GlobalStorageAccountPreparer() def test_put_block_list_invalid_block_id(self, resource_group, location, storage_account, storage_account_key): diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index b26a90f82fde..a94707a5ff33 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -21,7 +21,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError, ResourceNotFoundError from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from devtools_testutils.storage.aio import AsyncStorageTestCase @@ -528,7 +528,8 @@ async def test_put_block_list(self, resource_group, location, storage_account, s self.assertEqual(content.properties.etag, put_block_list_resp.get('etag')) self.assertEqual(content.properties.last_modified, put_block_list_resp.get('last_modified')) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_put_block_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): await self._setup(storage_account, storage_account_key) container_name = self.get_resource_name('vlwcontainer') @@ -540,7 +541,7 @@ async def test_put_block_with_immutability_policy(self, resource_group, location mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = self._get_blob_reference() blob = self.bsc.get_blob_client(container_name, blob_name) @@ -568,7 +569,7 @@ async def test_put_block_with_immutability_policy(self, resource_group, location self.assertIsNotNone(download_resp.properties['immutability_policy']['policy_mode']) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index 60a937699645..a8f258985ff0 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -46,7 +46,7 @@ StandardBlobTier, BlobImmutabilityPolicyMode, ImmutabilityPolicy) from azure.storage.blob._generated.models import RehydratePriority -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from devtools_testutils.storage import StorageTestCase @@ -1164,7 +1164,8 @@ def test_copy_blob_with_existing_blob(self, resource_group, location, storage_ac copy_content = copyblob.download_blob().readall() self.assertEqual(copy_content, self.byte_data) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_copy_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) @@ -1175,7 +1176,7 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = self._create_block_blob() # Act @@ -1200,7 +1201,7 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor self.assertFalse(isinstance(copy['copy_status'], Enum)) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @GlobalResourceGroupPreparer() @StorageAccountPreparer(random_name_enabled=True, location="canadacentral", name_prefix='storagename') @@ -1765,7 +1766,8 @@ def test_account_sas(self, resource_group, location, storage_account, storage_ac self.assertTrue(container_response.ok) @pytest.mark.live_test_only - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_set_immutability_policy_using_sas(self, resource_group, location, storage_account, storage_account_key): # SAS URL is calculated from storage key, so this test runs live only @@ -1778,7 +1780,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = self.get_resource_name('vlwblob') blob = self.bsc.get_blob_client(container_name, blob_name) @@ -2519,7 +2521,8 @@ def fail_response(response): # Assert that the token attempts to refresh 4 times (i.e, get_token called 4 times) self.assertEqual(token_credential.get_token_count, 4) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_blob_immutability_policy(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) @@ -2530,7 +2533,7 @@ def test_blob_immutability_policy(self, resource_group, location, storage_accoun mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2556,7 +2559,7 @@ def test_blob_immutability_policy(self, resource_group, location, storage_accoun self.assertIsNone(props.immutability_policy_mode) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @GlobalStorageAccountPreparer() def test_blob_legal_hold(self, resource_group, location, storage_account, storage_account_key): @@ -2569,7 +2572,7 @@ def test_blob_legal_hold(self, resource_group, location, storage_account, storag mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2591,9 +2594,10 @@ def test_blob_legal_hold(self, resource_group, location, storage_account, storag self.assertFalse(props2['has_legal_hold']) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_download_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) container_name = self.get_resource_name('vlwcontainer') @@ -2603,7 +2607,7 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2631,9 +2635,10 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, blob.delete_immutability_policy() if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_list_blobs_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) container_name = self.get_resource_name('vlwcontainer') @@ -2643,7 +2648,7 @@ def test_list_blobs_with_immutability_policy(self, resource_group, location, sto mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2664,6 +2669,6 @@ def test_list_blobs_with_immutability_policy(self, resource_group, location, sto self.assertIsNotNone(blob_list[0]['immutability_policy']['policy_mode']) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index c806239bc9fd..3483ea79dda4 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -53,7 +53,8 @@ AccountSasPermissions, StandardBlobTier, RehydratePriority, BlobImmutabilityPolicyMode, ImmutabilityPolicy) -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer, \ + CachedResourceGroupPreparer from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from devtools_testutils.storage.aio import AsyncStorageTestCase @@ -1434,7 +1435,8 @@ async def test_copy_blob_with_existing_blob(self, resource_group, location, stor copy_content = await (await copyblob.download_blob()).readall() self.assertEqual(copy_content, self.byte_data) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_copy_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): await self._setup(storage_account, storage_account_key) @@ -1445,7 +1447,7 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = await self._create_block_blob() # Act @@ -1472,7 +1474,7 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location self.assertFalse(isinstance(copy['copy_status'], Enum)) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) # @GlobalStorageAccountPreparer() # @AsyncStorageTestCase.await_prepared_test @@ -2529,7 +2531,8 @@ async def test_transport_closed_only_once(self, resource_group, location, storag await bsc.get_service_properties() assert transport.session is not None - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_blob_immutability_policy(self, resource_group, location, storage_account, storage_account_key): await self._setup(storage_account, storage_account_key) @@ -2540,7 +2543,7 @@ async def test_blob_immutability_policy(self, resource_group, location, storage_ mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2568,7 +2571,7 @@ async def test_blob_immutability_policy(self, resource_group, location, storage_ self.assertIsNone(props['immutability_policy']['policy_mode']) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @GlobalStorageAccountPreparer() async def test_blob_legal_hold(self, resource_group, location, storage_account, storage_account_key): @@ -2581,7 +2584,7 @@ async def test_blob_legal_hold(self, resource_group, location, storage_account, mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2603,9 +2606,10 @@ async def test_blob_legal_hold(self, resource_group, location, storage_account, self.assertFalse(props2['has_legal_hold']) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_download_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): await self._setup(storage_account, storage_account_key) container_name = self.get_resource_name('vlwcontainer') @@ -2615,7 +2619,7 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2643,9 +2647,10 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca await blob.delete_immutability_policy() if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_list_blobs_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): await self._setup(storage_account, storage_account_key) container_name = self.get_resource_name('vlwcontainer') @@ -2655,7 +2660,7 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) # Act blob_name = self.get_resource_name('vlwblob') @@ -2679,6 +2684,6 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio self.assertIsNotNone(blob_list[0]['immutability_policy']['policy_mode']) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) # ------------------------------------------------------------------------------ diff --git a/sdk/storage/azure-storage-blob/tests/test_container.py b/sdk/storage/azure-storage-blob/tests/test_container.py index ea9fefd10338..ba9b21c67d06 100644 --- a/sdk/storage/azure-storage-blob/tests/test_container.py +++ b/sdk/storage/azure-storage-blob/tests/test_container.py @@ -12,6 +12,7 @@ import pytest import requests +from devtools_testutils import ResourceGroupPreparer, BlobAccountPreparer from _shared.testcase import StorageTestCase, LogCaptured, GlobalStorageAccountPreparer, GlobalResourceGroupPreparer, StorageAccountPreparer from azure.core import MatchConditions @@ -1087,7 +1088,8 @@ def test_list_blobs_with_include_metadata(self, resource_group, location, storag self.assertEqual(blobs[1].content_settings.content_language, 'spanish') self.assertEqual(blobs[1].content_settings.content_disposition, 'inline') - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_list_blobs_include_deletedwithversion(self, resource_group, location, storage_account, storage_account_key): bsc = BlobServiceClient(self.account_url(storage_account, "blob"), storage_account_key) # pytest.skip("Waiting on metadata XML fix in msrest") diff --git a/sdk/storage/azure-storage-blob/tests/test_container_async.py b/sdk/storage/azure-storage-blob/tests/test_container_async.py index d6a459f11a20..f630bd76404d 100644 --- a/sdk/storage/azure-storage-blob/tests/test_container_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_container_async.py @@ -19,7 +19,7 @@ from azure.core.exceptions import HttpResponseError, ResourceNotFoundError, ResourceExistsError, ResourceModifiedError from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer from azure.storage.blob import ( PublicAccess, @@ -1163,7 +1163,8 @@ async def test_list_blobs_with_include_metadata(self, resource_group, location, self.assertEqual(blobs[1].metadata['number'], '2') self.assertEqual(blobs[1].metadata['name'], 'car') - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_list_blobs_include_deletedwithversion_async(self, resource_group, location, storage_account, storage_account_key): bsc = BlobServiceClient(self.account_url(storage_account, "blob"), storage_account_key) # pytest.skip("Waiting on metadata XML fix in msrest") diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob.py b/sdk/storage/azure-storage-blob/tests/test_page_blob.py index d02a4bc0ca4a..e8ac76b9ce82 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob.py @@ -30,7 +30,7 @@ SequenceNumberAction, StorageErrorCode, generate_blob_sas, BlobImmutabilityPolicyMode, ImmutabilityPolicy) -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer from azure.storage.blob._shared.policies import StorageContentValidation from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from devtools_testutils.storage import StorageTestCase @@ -144,7 +144,8 @@ def test_create_blob(self, resource_group, location, storage_account, storage_ac self.assertIsNotNone(resp.get('last_modified')) self.assertTrue(blob.get_blob_properties()) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) def test_create_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): bsc = BlobServiceClient(self.account_url(storage_account, "blob"), credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024) self._setup(bsc) @@ -156,7 +157,7 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = self.get_resource_name("vlwblob") blob = bsc.get_blob_client(container_name, blob_name) @@ -176,7 +177,7 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: - mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @pytest.mark.playback_test_only @GlobalStorageAccountPreparer() diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py index 9a928f4d37ba..543c2f3e064e 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py @@ -21,7 +21,7 @@ from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy from azure.storage.blob._shared.policies import StorageContentValidation -from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer +from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer, BlobAccountPreparer from azure.storage.blob import ( BlobProperties, @@ -160,7 +160,8 @@ async def test_create_blob(self, resource_group, location, storage_account, stor self.assertIsNotNone(resp.get('last_modified')) self.assertTrue(await blob.get_blob_properties()) - @GlobalStorageAccountPreparer() + @ResourceGroupPreparer(name_prefix='storagename', use_cache=True) + @BlobAccountPreparer(name_prefix='storagename', is_versioning_enabled=True, location="canadacentral", use_cache=True) async def test_create_blob_with_immutability_policy(self, resource_group, location, storage_account, storage_account_key): bsc = BlobServiceClient(self.account_url(storage_account, "blob"), credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024) await self._setup(bsc) @@ -172,7 +173,7 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati mgmt_client = StorageManagementClient(token_credential, subscription_id, '2021-04-01') property = mgmt_client.models().BlobContainer( immutable_storage_with_versioning=mgmt_client.models().ImmutableStorageWithVersioning(enabled=True)) - await mgmt_client.blob_containers.create("XClient", storage_account.name, container_name, blob_container=property) + await mgmt_client.blob_containers.create(resource_group.name, storage_account.name, container_name, blob_container=property) blob_name = self.get_resource_name("vlwblob") blob = bsc.get_blob_client(container_name, blob_name) @@ -193,7 +194,7 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati self.assertIsNotNone(props['immutability_policy']['policy_mode']) if self.is_live: - await mgmt_client.blob_containers.delete("XClient", storage_account.name, self.container_name) + await mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) @pytest.mark.playback_test_only @GlobalStorageAccountPreparer() From 1611deb7f1e8c95c6b0bb6742fe1cf316feed5c3 Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 22 Jul 2021 10:55:11 -0700 Subject: [PATCH 12/14] add import --- sdk/storage/azure-storage-blob/tests/test_append_blob_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index d7784d12ddcf..0fed67675466 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -18,7 +18,7 @@ import uuid from azure.mgmt.storage.aio import StorageManagementClient -from devtools_testutils import BlobAccountPreparer +from devtools_testutils import BlobAccountPreparer, ResourceGroupPreparer from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError, ResourceNotFoundError, ResourceModifiedError From 859208aa69370fa2d61e53b9c1de3afadb85cfe5 Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 22 Jul 2021 12:00:20 -0700 Subject: [PATCH 13/14] fix import --- sdk/storage/azure-storage-blob/tests/test_append_blob.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index ece34e7a96b6..4984f0bf1334 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -16,7 +16,6 @@ from datetime import datetime, timedelta from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.v2018_02_01.models import ImmutabilityPolicy from devtools_testutils import BlobAccountPreparer, ResourceGroupPreparer from azure.core import MatchConditions @@ -27,7 +26,7 @@ ContainerClient, BlobClient, BlobType, - BlobSasPermissions, BlobImmutabilityPolicyMode) + BlobSasPermissions, BlobImmutabilityPolicyMode, ImmutabilityPolicy) from azure.storage.blob._shared.policies import StorageContentValidation from _shared.testcase import GlobalStorageAccountPreparer, StorageAccountPreparer, GlobalResourceGroupPreparer From 9cb1d566e9e7cdf6fee72e7d71ac44842fe832ad Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 22 Jul 2021 12:07:48 -0700 Subject: [PATCH 14/14] fix tests --- sdk/storage/azure-storage-blob/tests/test_common_blob.py | 4 ++-- .../azure-storage-blob/tests/test_common_blob_async.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index a8f258985ff0..9a22a748ea94 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -2555,8 +2555,8 @@ def test_blob_immutability_policy(self, resource_group, location, storage_accoun # check immutability policy after delete_immutability_policy() blob.delete_immutability_policy() props = blob.get_blob_properties() - self.assertIsNone(props.immutability_policy_mode) - self.assertIsNone(props.immutability_policy_mode) + self.assertIsNone(props['immutability_policy']['policy_mode']) + self.assertIsNone(props['immutability_policy']['policy_mode']) if self.is_live: mgmt_client.blob_containers.delete(resource_group.name, storage_account.name, self.container_name) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 3483ea79dda4..44e7373d338a 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -2562,7 +2562,7 @@ async def test_blob_immutability_policy(self, resource_group, location, storage_ self.assertIsNotNone(resp['immutability_policy_mode']) self.assertIsNotNone(props['immutability_policy']['expiry_time']) self.assertIsNotNone(props['immutability_policy']['policy_mode']) - self.assertEqual(props.immutability_policy_mode, "unlocked") + self.assertEqual(props['immutability_policy']['policy_mode'], "unlocked") # check immutability policy after delete_immutability_policy() await blob.delete_immutability_policy()