From 0659533bdced45f72a8b3e62e2d44e3ce2b58ff7 Mon Sep 17 00:00:00 2001 From: tasherif-msft <69483382+tasherif-msft@users.noreply.github.com> Date: Thu, 3 Dec 2020 15:02:32 -0800 Subject: [PATCH] Merge STG75 into master (#15598) * [Blob]Generate STG75 Blob Tags (#14986) * [Blob]Generate STG75 Blob Tags * update api version * generator problem * Fixed tags value * Removed tag value altogether Co-authored-by: tasherif-msft <69483382+tasherif-msft@users.noreply.github.com> * [Storage][STG75]Lease on Get/Set Tags & Find Blob by Tags (#15090) * [Storage][STG75]Lease on Get/Set Tags & Find Blob by Tags * pylint * [Fileshare] Share enable protocol share squash root (#15048) * generated root squash swagger * added api version * added new params * fixed valueerror * rerecorded * docstring fix * fixed docstrings * added sync tests * added async tests * fixed docstrings * renamed params and class * renamed params * renamed enabled protocols to protocols * fixed tests * fixed the validation issue * changed models to support list[str] * added tests * changed models type * [Blob] Added upload blob from url feature (#15027) * fixed swagger and added put blob * added method signitures * added str * added more kwargs docstrings * finished adding kwargs * return type * implemented new api * BlockBlob client fix * renamed param * renamed param * added content length * test experiment * added tests sync * added all tests * attempting to fix ci * added if tags match cond keyword * added more tests * added extra header * added more tests and removed keywords * recorded sync tests * added async tests * fixed import issue * rerecorded test * changed docstring * added overwrite and tests * rerecorded * cleaned up options method * cleaned up options method some more * fixed merge conflict * marked playback only for fileshares Co-authored-by: Xiaoxi Fu <49707495+xiafu-msft@users.noreply.github.com> --- .../azure/storage/blob/_blob_client.py | 156 +- .../storage/blob/_blob_service_client.py | 4 +- .../blob/_generated/_azure_blob_storage.py | 2 +- .../storage/blob/_generated/_configuration.py | 2 +- .../aio/_azure_blob_storage_async.py | 2 +- .../_generated/aio/_configuration_async.py | 2 +- .../_blob_operations_async.py | 24 +- .../_block_blob_operations_async.py | 244 ++ .../_container_operations_async.py | 4 +- .../models/_azure_blob_storage_enums.py | 1 + .../storage/blob/_generated/models/_models.py | 9 +- .../blob/_generated/models/_models_py3.py | 11 +- .../_generated/operations/_blob_operations.py | 24 +- .../operations/_block_blob_operations.py | 244 ++ .../operations/_container_operations.py | 4 +- .../azure/storage/blob/_generated/version.py | 2 +- .../azure/storage/blob/_list_blobs_helper.py | 75 +- .../azure/storage/blob/_models.py | 73 +- .../azure/storage/blob/_serialize.py | 1 + .../storage/blob/aio/_blob_client_async.py | 107 + .../azure/storage/blob/aio/_models.py | 4 +- .../test_blob_tags.test_filter_blobs.yaml | 222 +- ...ob_tags.test_set_blob_tags_with_lease.yaml | 372 +++ ...est_blob_tags_async.test_filter_blobs.yaml | 220 +- ...s_async.test_set_blob_tags_with_lease.yaml | 270 ++ ...load_blob_from_url_if_match_condition.yaml | 537 ++++ ...ad_blob_from_url_overwrite_properties.yaml | 238 ++ ...url_source_and_destination_properties.yaml | 462 ++++ ...ob.test_upload_blob_from_url_with_cpk.yaml | 243 ++ ...load_blob_from_url_with_existing_blob.yaml | 210 ++ ...blob_from_url_with_source_content_md5.yaml | 329 +++ ...from_url_with_standard_tier_specified.yaml | 212 ++ ...pload_blob_with_and_without_overwrite.yaml | 307 +++ ...st_upload_blob_with_destination_lease.yaml | 339 +++ ...load_blob_from_url_if_match_condition.yaml | 395 +++ ...ad_blob_from_url_overwrite_properties.yaml | 166 ++ ...url_source_and_destination_properties.yaml | 308 +++ ...nc.test_upload_blob_from_url_with_cpk.yaml | 171 ++ ...load_blob_from_url_with_existing_blob.yaml | 145 + ...blob_from_url_with_source_content_md5.yaml | 224 ++ ...from_url_with_standard_tier_specified.yaml | 144 + ...pload_blob_with_and_without_overwrite.yaml | 216 ++ ...st_upload_blob_with_destination_lease.yaml | 246 ++ .../tests/test_blob_tags.py | 34 +- .../tests/test_blob_tags_async.py | 36 +- .../tests/test_block_blob.py | 273 +- .../tests/test_block_blob_async.py | 284 +- .../azure/storage/fileshare/__init__.py | 6 + .../_generated/_azure_file_storage.py | 2 +- .../aio/_azure_file_storage_async.py | 2 +- .../_share_operations_async.py | 24 +- .../fileshare/_generated/models/__init__.py | 14 +- .../models/_azure_file_storage_enums.py | 7 + .../fileshare/_generated/models/_models.py | 25 +- .../_generated/models/_models_py3.py | 27 +- .../operations/_share_operations.py | 24 +- .../storage/fileshare/_generated/version.py | 2 +- .../azure/storage/fileshare/_models.py | 20 +- .../azure/storage/fileshare/_serialize.py | 1 + .../azure/storage/fileshare/_share_client.py | 25 +- .../fileshare/aio/_share_client_async.py | 25 +- ...share.test_create_share_with_metadata.yaml | 2396 ++++++++++++++++- ...share.test_create_share_with_protocol.yaml | 190 ++ ...shares_with_root_squash_and_protocols.yaml | 236 ++ ...set_share_properties_with_root_squash.yaml | 274 ++ ...async.test_create_share_with_protocol.yaml | 89 + ...shares_with_root_squash_and_protocols.yaml | 172 ++ ...set_share_properties_with_root_squash.yaml | 262 ++ .../tests/test_share.py | 66 +- .../tests/test_share_async.py | 74 +- 70 files changed, 11168 insertions(+), 393 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_set_blob_tags_with_lease.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_set_blob_tags_with_lease.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_if_match_condition.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_overwrite_properties.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_source_and_destination_properties.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_cpk.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_existing_blob.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_source_content_md5.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_standard_tier_specified.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_and_without_overwrite.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_destination_lease.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_if_match_condition.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_overwrite_properties.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_source_and_destination_properties.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_cpk.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_existing_blob.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_source_content_md5.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_standard_tier_specified.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_and_without_overwrite.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_destination_lease.yaml create mode 100644 sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_protocol.yaml create mode 100644 sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_list_shares_with_root_squash_and_protocols.yaml create mode 100644 sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_set_share_properties_with_root_squash.yaml create mode 100644 sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_create_share_with_protocol.yaml create mode 100644 sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_list_shares_with_root_squash_and_protocols.yaml create mode 100644 sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_set_share_properties_with_root_squash.yaml 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 0d2d783988a9..a7db835a99b3 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 @@ -52,7 +52,7 @@ from ._upload_helpers import ( upload_block_blob, upload_append_blob, - upload_page_blob) + upload_page_blob, _any_conditions) from ._models import BlobType, BlobBlock, BlobProperties, BlobQueryError from ._download import StorageStreamDownloader from ._lease import BlobLeaseClient @@ -406,6 +406,146 @@ def _upload_blob_options( # pylint:disable=too-many-statements raise ValueError("Unsupported BlobType: {}".format(blob_type)) return kwargs + def _upload_blob_from_url_options(self, source_url, **kwargs): + # type: (...) -> Dict[str, Any] + tier = kwargs.pop('standard_blob_tier', None) + overwrite = kwargs.pop('overwrite', False) + content_settings = kwargs.pop('content_settings', None) + if content_settings: + kwargs['blob_http_headers'] = BlobHTTPHeaders( + blob_cache_control=content_settings.cache_control, + blob_content_type=content_settings.content_type, + blob_content_md5=None, + blob_content_encoding=content_settings.content_encoding, + blob_content_language=content_settings.content_language, + blob_content_disposition=content_settings.content_disposition + ) + cpk = kwargs.pop('cpk', None) + cpk_info = None + if cpk: + if self.scheme.lower() != 'https': + 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) + + options = { + 'content_length': 0, + 'copy_source_blob_properties': kwargs.pop('include_source_blob_properties', True), + 'source_content_md5': kwargs.pop('source_content_md5', None), + 'copy_source': source_url, + 'modified_access_conditions': get_modify_conditions(kwargs), + 'blob_tags_string': serialize_blob_tags_header(kwargs.pop('tags', None)), + 'cls': return_response_headers, + 'lease_access_conditions': get_access_conditions(kwargs.pop('destination_lease', None)), + 'tier': tier.value if tier else None, + 'source_modified_access_conditions': get_source_conditions(kwargs), + 'cpk_info': cpk_info, + 'cpk_scope_info': get_cpk_scope_info(kwargs) + } + options.update(kwargs) + if not overwrite and not _any_conditions(**options): # pylint: disable=protected-access + options['modified_access_conditions'].if_none_match = '*' + return options + + @distributed_trace + def upload_blob_from_url(self, source_url, **kwargs): + # type: (str, Any) -> Dict[str, Any] + """ + Creates a new Block Blob where the content of the blob is read from a given URL. + The content of an existing blob is overwritten with the new blob. + + :param str source_url: + A URL of up to 2 KB in length that specifies a file or blob. + The value should be URL-encoded as it would appear in a request URI. + If the source is in another account, the source must either be public + or must be authenticated via a shared access signature. If the source + is public, no authentication is required. + Examples: + https://myaccount.blob.core.windows.net/mycontainer/myblob + + https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= + + https://otheraccount.blob.core.windows.net/mycontainer/myblob?sastoken + :keyword bool overwrite: Whether the blob to be uploaded should overwrite the current data. + If True, upload_blob will overwrite the existing data. If set to False, the + operation will fail with ResourceExistsError. + :keyword bool include_source_blob_properties: + Indicates if properties from the source blob should be copied. Defaults to True. + :keyword tags: + Name-value pairs associated with the blob as tag. Tags are case-sensitive. + The tag set may contain at most 10 tags. Tag keys must be between 1 and 128 characters, + and tag values must be between 0 and 256 characters. + Valid tag key and value characters include: lowercase and uppercase letters, digits (0-9), + space (` `), plus (+), minus (-), period (.), solidus (/), colon (:), equals (=), underscore (_) + :paramtype tags: dict(str, str) + :keyword bytearray source_content_md5: + Specify the md5 that is used to verify the integrity of the source bytes. + :keyword ~datetime.datetime source_if_modified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only + if the source resource has been modified since the specified time. + :keyword ~datetime.datetime source_if_unmodified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only if + the source resource has not been modified since the specified date/time. + :keyword str source_etag: + The source ETag value, or the wildcard character (*). Used to check if the resource has changed, + and act according to the condition specified by the `match_condition` parameter. + :keyword ~azure.core.MatchConditions source_match_condition: + The source match condition to use upon the etag. + :keyword ~datetime.datetime if_modified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only + if the resource has been modified since the specified time. + :keyword ~datetime.datetime if_unmodified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only if + the resource has not been modified since the specified date/time. + :keyword str etag: + The destination ETag value, or the wildcard character (*). Used to check if the resource has changed, + and act according to the condition specified by the `match_condition` parameter. + :keyword ~azure.core.MatchConditions match_condition: + The destination match condition to use upon the etag. + :keyword destination_lease: + The lease ID specified for this header must match the lease ID of the + destination blob. If the request does not include the lease ID or it is not + valid, the operation fails with status code 412 (Precondition Failed). + :paramtype destination_lease: ~azure.storage.blob.BlobLeaseClient or str + :keyword int timeout: + The timeout parameter is expressed in seconds. + :keyword ~azure.storage.blob.ContentSettings content_settings: + ContentSettings object used to set blob properties. Used to set content type, encoding, + language, disposition, md5, and cache control. + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + Encrypts the data on the service-side with the given key. + Use of customer-provided keys must be done over HTTPS. + As the encryption key itself is provided in the request, + a secure connection must be established to transfer the key. + :keyword str encryption_scope: + A predefined encryption scope used to encrypt the data on the service. An encryption + scope can be created using the Management API and referenced here by name. If a default + encryption scope has been defined at the container, this value will override it if the + container-level scope is configured to allow overrides. Otherwise an error will be raised. + :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. + """ + options = self._upload_blob_from_url_options( + source_url=self._encode_source_url(source_url), + **kwargs) + try: + return self._client.block_blob.put_blob_from_url(**options) + except StorageErrorException as error: + process_storage_error(error) + @distributed_trace def upload_blob( # pylint: disable=too-many-locals self, data, # type: Union[Iterable[AnyStr], IO[AnyStr]] @@ -2372,10 +2512,12 @@ def set_premium_page_blob_tier(self, premium_page_blob_tier, **kwargs): def _set_blob_tags_options(self, tags=None, **kwargs): # type: (Optional[Dict[str, str]], **Any) -> Dict[str, Any] tags = serialize_blob_tags(tags) + access_conditions = get_access_conditions(kwargs.pop('lease', None)) mod_conditions = get_modify_conditions(kwargs) options = { 'tags': tags, + 'lease_access_conditions': access_conditions, 'modified_access_conditions': mod_conditions, 'cls': return_response_headers} options.update(kwargs) @@ -2410,6 +2552,11 @@ def set_blob_tags(self, tags=None, **kwargs): blob. :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. + eg. ``\"\\\"tagname\\\"='my tag'\"`` + :keyword lease: + 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 int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified) @@ -2423,11 +2570,13 @@ def set_blob_tags(self, tags=None, **kwargs): def _get_blob_tags_options(self, **kwargs): # type: (**Any) -> Dict[str, str] + access_conditions = get_access_conditions(kwargs.pop('lease', None)) mod_conditions = get_modify_conditions(kwargs) options = { 'version_id': kwargs.pop('version_id', None), 'snapshot': self.snapshot, + 'lease_access_conditions': access_conditions, 'modified_access_conditions': mod_conditions, 'timeout': kwargs.pop('timeout', None), 'cls': return_headers_and_deserialized} @@ -2446,6 +2595,11 @@ def get_blob_tags(self, **kwargs): value that, when present, specifies the version of the blob to add tags to. :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. + eg. ``\"\\\"tagname\\\"='my tag'\"`` + :keyword lease: + 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 int timeout: The timeout parameter is expressed in seconds. :returns: Key value pairs of blob tags. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py index 1ab68c1f0fe5..b10d626fca5c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py @@ -28,7 +28,8 @@ from ._generated.models import StorageErrorException, StorageServiceProperties, KeyInfo from ._container_client import ContainerClient from ._blob_client import BlobClient -from ._models import ContainerPropertiesPaged, FilteredBlobPaged +from ._models import ContainerPropertiesPaged +from ._list_blobs_helper import FilteredBlobPaged from ._serialize import get_api_version from ._deserialize import service_stats_deserialize, service_properties_deserialize @@ -47,6 +48,7 @@ CorsRule, RetentionPolicy, StaticWebsite, + FilteredBlob ) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py index 831f6ce2033c..6ca7b303e9a6 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py @@ -55,7 +55,7 @@ def __init__(self, url, **kwargs): self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-02-10' + self.api_version = '2020-04-08' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py index c8a1875b6af8..e1092d0495bc 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py @@ -40,7 +40,7 @@ def __init__(self, url, **kwargs): self.generate_client_request_id = True self.url = url - self.version = "2020-02-10" + self.version = "2020-04-08" def _configure(self, **kwargs): self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py index 367e296ea6f0..b7ca1f4f11b9 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py @@ -56,7 +56,7 @@ def __init__( self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-02-10' + self.api_version = '2020-04-08' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py index 609cb82ac858..26e469a69935 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py @@ -41,7 +41,7 @@ def __init__(self, url, **kwargs): self.accept_language = None self.url = url - self.version = "2020-02-10" + self.version = "2020-04-08" def _configure(self, **kwargs): self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py index 54d6dab2a31b..eb8fc217a20e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py @@ -1119,7 +1119,7 @@ async def set_expiry(self, expiry_options, timeout=None, request_id=None, expire header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') header_parameters['x-ms-expiry-option'] = self._serialize.header("expiry_options", expiry_options, 'str') if expires_on is not None: - header_parameters['x-ms-expiry-time'] = self._serialize.header("expires_on", expires_on, 'rfc-1123') + header_parameters['x-ms-expiry-time'] = self._serialize.header("expires_on", expires_on, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -2876,7 +2876,7 @@ async def query(self, query_request=None, snapshot=None, timeout=None, request_i return deserialized query.metadata = {'url': '/{containerName}/{blob}'} - async def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Get Tags operation enables users to get the tags associated with a blob. @@ -2903,6 +2903,10 @@ async def get_tags(self, timeout=None, request_id=None, snapshot=None, version_i operation :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: BlobTags or the result of cls(response) @@ -2914,6 +2918,9 @@ async def get_tags(self, timeout=None, request_id=None, snapshot=None, version_i if_tags = None if modified_access_conditions is not None: if_tags = modified_access_conditions.if_tags + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id comp = "tags" @@ -2942,6 +2949,8 @@ async def get_tags(self, timeout=None, request_id=None, snapshot=None, version_i header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') if if_tags is not None: header_parameters['x-ms-if-tags'] = self._serialize.header("if_tags", if_tags, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -2970,7 +2979,7 @@ async def get_tags(self, timeout=None, request_id=None, snapshot=None, version_i return deserialized get_tags.metadata = {'url': '/{containerName}/{blob}'} - async def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None, transactional_content_crc64=None, request_id=None, tags=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None, transactional_content_crc64=None, request_id=None, tags=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Set Tags operation enables users to set tags on a blob. :param timeout: The timeout parameter is expressed in seconds. For @@ -2998,6 +3007,10 @@ async def set_tags(self, timeout=None, version_id=None, transactional_content_md operation :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -3009,6 +3022,9 @@ async def set_tags(self, timeout=None, version_id=None, transactional_content_md if_tags = None if modified_access_conditions is not None: if_tags = modified_access_conditions.if_tags + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id comp = "tags" @@ -3039,6 +3055,8 @@ async def set_tags(self, timeout=None, version_id=None, transactional_content_md header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') if if_tags is not None: header_parameters['x-ms-if-tags'] = self._serialize.header("if_tags", if_tags, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') # Construct body if tags is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py index e06937056b0b..77924ed39645 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py @@ -239,6 +239,250 @@ async def upload(self, body, content_length, timeout=None, transactional_content return cls(response, None, response_headers) upload.metadata = {'url': '/{containerName}/{blob}'} + async def put_blob_from_url(self, content_length, copy_source, timeout=None, transactional_content_md5=None, metadata=None, tier=None, request_id=None, source_content_md5=None, blob_tags_string=None, copy_source_blob_properties=None, blob_http_headers=None, lease_access_conditions=None, cpk_info=None, cpk_scope_info=None, modified_access_conditions=None, source_modified_access_conditions=None, *, cls=None, **kwargs): + """The Put Blob from URL operation creates a new Block Blob where the + contents of the blob are read from a given URL. This API is supported + beginning with the 2020-04-08 version. Partial updates are not + supported with Put Blob from URL; the content of an existing blob is + overwritten with the content of the new blob. To perform partial + updates to a block blob’s contents using a source URL, use the Put + Block from URL API in conjunction with Put Block List. + + :param content_length: The length of the request. + :type content_length: long + :param copy_source: Specifies the name of the source page blob + snapshot. This value is a URL of up to 2 KB in length that specifies a + page blob snapshot. The value should be URL-encoded as it would appear + in a request URI. The source blob must either be public or must be + authenticated via a shared access signature. + :type copy_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param metadata: Optional. Specifies a user-defined name-value pair + associated with the blob. If no name-value pairs are specified, the + operation will copy the metadata from the source blob or file to the + destination blob. If one or more name-value pairs are specified, the + destination blob is created with the specified metadata, and metadata + is not copied from the source blob or file. Note that beginning with + version 2009-09-19, metadata names must adhere to the naming rules for + C# identifiers. See Naming and Referencing Containers, Blobs, and + Metadata for more information. + :type metadata: str + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'P4', 'P6', 'P10', 'P15', 'P20', 'P30', + 'P40', 'P50', 'P60', 'P70', 'P80', 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param source_content_md5: Specify the md5 calculated for the range of + bytes that must be read from the copy source. + :type source_content_md5: bytearray + :param blob_tags_string: Optional. Used to set blob tags in various + blob operations. + :type blob_tags_string: str + :param copy_source_blob_properties: Optional, default is true. + Indicates if properties from the source blob should be copied. + :type copy_source_blob_properties: bool + :param blob_http_headers: Additional parameters for the operation + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param cpk_info: Additional parameters for the operation + :type cpk_info: ~azure.storage.blob.models.CpkInfo + :param cpk_scope_info: Additional parameters for the operation + :type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + blob_content_type = None + if blob_http_headers is not None: + blob_content_type = blob_http_headers.blob_content_type + blob_content_encoding = None + if blob_http_headers is not None: + blob_content_encoding = blob_http_headers.blob_content_encoding + blob_content_language = None + if blob_http_headers is not None: + blob_content_language = blob_http_headers.blob_content_language + blob_content_md5 = None + if blob_http_headers is not None: + blob_content_md5 = blob_http_headers.blob_content_md5 + blob_cache_control = None + if blob_http_headers is not None: + blob_cache_control = blob_http_headers.blob_cache_control + blob_content_disposition = None + if blob_http_headers is not None: + blob_content_disposition = blob_http_headers.blob_content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + encryption_key = None + if cpk_info is not None: + encryption_key = cpk_info.encryption_key + encryption_key_sha256 = None + if cpk_info is not None: + encryption_key_sha256 = cpk_info.encryption_key_sha256 + encryption_algorithm = None + if cpk_info is not None: + encryption_algorithm = cpk_info.encryption_algorithm + encryption_scope = None + if cpk_scope_info is not None: + encryption_scope = cpk_scope_info.encryption_scope + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + if_tags = None + if modified_access_conditions is not None: + if_tags = modified_access_conditions.if_tags + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + source_if_tags = None + if source_modified_access_conditions is not None: + source_if_tags = source_modified_access_conditions.source_if_tags + + # Construct URL + url = self.put_blob_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + + # Construct headers + header_parameters = {} + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if metadata is not None: + header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if source_content_md5 is not None: + header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if blob_tags_string is not None: + header_parameters['x-ms-tags'] = self._serialize.header("blob_tags_string", blob_tags_string, 'str') + header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') + if copy_source_blob_properties is not None: + header_parameters['x-ms-copy-source-blob-properties'] = self._serialize.header("copy_source_blob_properties", copy_source_blob_properties, 'bool') + header_parameters['x-ms-blob-type'] = self._serialize.header("self.x_ms_blob_type", self.x_ms_blob_type, 'str') + if blob_content_type is not None: + header_parameters['x-ms-blob-content-type'] = self._serialize.header("blob_content_type", blob_content_type, 'str') + if blob_content_encoding is not None: + header_parameters['x-ms-blob-content-encoding'] = self._serialize.header("blob_content_encoding", blob_content_encoding, 'str') + if blob_content_language is not None: + header_parameters['x-ms-blob-content-language'] = self._serialize.header("blob_content_language", blob_content_language, 'str') + if blob_content_md5 is not None: + header_parameters['x-ms-blob-content-md5'] = self._serialize.header("blob_content_md5", blob_content_md5, 'bytearray') + if blob_cache_control is not None: + header_parameters['x-ms-blob-cache-control'] = self._serialize.header("blob_cache_control", blob_cache_control, 'str') + if blob_content_disposition is not None: + header_parameters['x-ms-blob-content-disposition'] = self._serialize.header("blob_content_disposition", blob_content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if encryption_key is not None: + header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", encryption_key, 'str') + if encryption_key_sha256 is not None: + header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", encryption_key_sha256, 'str') + if encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", encryption_scope, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if if_tags is not None: + header_parameters['x-ms-if-tags'] = self._serialize.header("if_tags", if_tags, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + if source_if_tags is not None: + header_parameters['x-ms-source-if-tags'] = self._serialize.header("source_if_tags", source_if_tags, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + put_blob_from_url.metadata = {'url': '/{containerName}/{blob}'} + async def stage_block(self, block_id, content_length, body, transactional_content_md5=None, transactional_content_crc64=None, timeout=None, request_id=None, lease_access_conditions=None, cpk_info=None, cpk_scope_info=None, *, cls=None, **kwargs): """The Stage Block operation creates a new block to be committed as part of a blob. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py index b7e1eb840e75..aefb8f2eb912 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py @@ -604,10 +604,10 @@ async def restore(self, timeout=None, request_id=None, deleted_container_name=No analytics logging is enabled. :type request_id: str :param deleted_container_name: Optional. Version 2019-12-12 and - laster. Specifies the name of the deleted container to restore. + later. Specifies the name of the deleted container to restore. :type deleted_container_name: str :param deleted_container_version: Optional. Version 2019-12-12 and - laster. Specifies the version of the deleted container to restore. + later. Specifies the version of the deleted container to restore. :type deleted_container_version: str :param callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py index e45eea3f2f3f..64310397688d 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py @@ -130,6 +130,7 @@ class StorageErrorCode(str, Enum): unsupported_http_verb = "UnsupportedHttpVerb" append_position_condition_not_met = "AppendPositionConditionNotMet" blob_already_exists = "BlobAlreadyExists" + blob_immutable_due_to_policy = "BlobImmutableDueToPolicy" blob_not_found = "BlobNotFound" blob_overwritten = "BlobOverwritten" blob_tier_inadequate_for_content_length = "BlobTierInadequateForContentLength" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py index 1fdddbe96a08..5e91298828fb 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py @@ -1084,20 +1084,19 @@ class FilterBlobItem(Model): :type name: str :param container_name: Required. :type container_name: str - :param tag_value: Required. - :type tag_value: str + :param tags: + :type tags: ~azure.storage.blob.models.BlobTags """ _validation = { 'name': {'required': True}, 'container_name': {'required': True}, - 'tag_value': {'required': True}, } _attribute_map = { 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, 'container_name': {'key': 'ContainerName', 'type': 'str', 'xml': {'name': 'ContainerName'}}, - 'tag_value': {'key': 'TagValue', 'type': 'str', 'xml': {'name': 'TagValue'}}, + 'tags': {'key': 'Tags', 'type': 'BlobTags', 'xml': {'name': 'Tags'}}, } _xml_map = { 'name': 'Blob' @@ -1107,7 +1106,7 @@ def __init__(self, **kwargs): super(FilterBlobItem, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.container_name = kwargs.get('container_name', None) - self.tag_value = kwargs.get('tag_value', None) + self.tags = kwargs.get('tags', None) class FilterBlobSegment(Model): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py index 7e5a3fc91364..76f62ef96780 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py @@ -1084,30 +1084,29 @@ class FilterBlobItem(Model): :type name: str :param container_name: Required. :type container_name: str - :param tag_value: Required. - :type tag_value: str + :param tags: + :type tags: ~azure.storage.blob.models.BlobTags """ _validation = { 'name': {'required': True}, 'container_name': {'required': True}, - 'tag_value': {'required': True}, } _attribute_map = { 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, 'container_name': {'key': 'ContainerName', 'type': 'str', 'xml': {'name': 'ContainerName'}}, - 'tag_value': {'key': 'TagValue', 'type': 'str', 'xml': {'name': 'TagValue'}}, + 'tags': {'key': 'Tags', 'type': 'BlobTags', 'xml': {'name': 'Tags'}}, } _xml_map = { 'name': 'Blob' } - def __init__(self, *, name: str, container_name: str, tag_value: str, **kwargs) -> None: + def __init__(self, *, name: str, container_name: str, tags=None, **kwargs) -> None: super(FilterBlobItem, self).__init__(**kwargs) self.name = name self.container_name = container_name - self.tag_value = tag_value + self.tags = tags class FilterBlobSegment(Model): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py index 394a519856a6..1eb778b8d6be 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py @@ -1118,7 +1118,7 @@ def set_expiry(self, expiry_options, timeout=None, request_id=None, expires_on=N header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') header_parameters['x-ms-expiry-option'] = self._serialize.header("expiry_options", expiry_options, 'str') if expires_on is not None: - header_parameters['x-ms-expiry-time'] = self._serialize.header("expires_on", expires_on, 'rfc-1123') + header_parameters['x-ms-expiry-time'] = self._serialize.header("expires_on", expires_on, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -2874,7 +2874,7 @@ def query(self, query_request=None, snapshot=None, timeout=None, request_id=None return deserialized query.metadata = {'url': '/{containerName}/{blob}'} - def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None, modified_access_conditions=None, cls=None, **kwargs): + def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): """The Get Tags operation enables users to get the tags associated with a blob. @@ -2901,6 +2901,10 @@ def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None operation :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: BlobTags or the result of cls(response) @@ -2912,6 +2916,9 @@ def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None if_tags = None if modified_access_conditions is not None: if_tags = modified_access_conditions.if_tags + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id comp = "tags" @@ -2940,6 +2947,8 @@ def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') if if_tags is not None: header_parameters['x-ms-if-tags'] = self._serialize.header("if_tags", if_tags, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -2968,7 +2977,7 @@ def get_tags(self, timeout=None, request_id=None, snapshot=None, version_id=None return deserialized get_tags.metadata = {'url': '/{containerName}/{blob}'} - def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None, transactional_content_crc64=None, request_id=None, tags=None, modified_access_conditions=None, cls=None, **kwargs): + def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None, transactional_content_crc64=None, request_id=None, tags=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): """The Set Tags operation enables users to set tags on a blob. :param timeout: The timeout parameter is expressed in seconds. For @@ -2996,6 +3005,10 @@ def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None operation :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -3007,6 +3020,9 @@ def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None if_tags = None if modified_access_conditions is not None: if_tags = modified_access_conditions.if_tags + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id comp = "tags" @@ -3037,6 +3053,8 @@ def set_tags(self, timeout=None, version_id=None, transactional_content_md5=None header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') if if_tags is not None: header_parameters['x-ms-if-tags'] = self._serialize.header("if_tags", if_tags, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') # Construct body if tags is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py index 8228c4782b6b..30aaa8fd578e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py @@ -239,6 +239,250 @@ def upload(self, body, content_length, timeout=None, transactional_content_md5=N return cls(response, None, response_headers) upload.metadata = {'url': '/{containerName}/{blob}'} + def put_blob_from_url(self, content_length, copy_source, timeout=None, transactional_content_md5=None, metadata=None, tier=None, request_id=None, source_content_md5=None, blob_tags_string=None, copy_source_blob_properties=None, blob_http_headers=None, lease_access_conditions=None, cpk_info=None, cpk_scope_info=None, modified_access_conditions=None, source_modified_access_conditions=None, cls=None, **kwargs): + """The Put Blob from URL operation creates a new Block Blob where the + contents of the blob are read from a given URL. This API is supported + beginning with the 2020-04-08 version. Partial updates are not + supported with Put Blob from URL; the content of an existing blob is + overwritten with the content of the new blob. To perform partial + updates to a block blob’s contents using a source URL, use the Put + Block from URL API in conjunction with Put Block List. + + :param content_length: The length of the request. + :type content_length: long + :param copy_source: Specifies the name of the source page blob + snapshot. This value is a URL of up to 2 KB in length that specifies a + page blob snapshot. The value should be URL-encoded as it would appear + in a request URI. The source blob must either be public or must be + authenticated via a shared access signature. + :type copy_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param metadata: Optional. Specifies a user-defined name-value pair + associated with the blob. If no name-value pairs are specified, the + operation will copy the metadata from the source blob or file to the + destination blob. If one or more name-value pairs are specified, the + destination blob is created with the specified metadata, and metadata + is not copied from the source blob or file. Note that beginning with + version 2009-09-19, metadata names must adhere to the naming rules for + C# identifiers. See Naming and Referencing Containers, Blobs, and + Metadata for more information. + :type metadata: str + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'P4', 'P6', 'P10', 'P15', 'P20', 'P30', + 'P40', 'P50', 'P60', 'P70', 'P80', 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param source_content_md5: Specify the md5 calculated for the range of + bytes that must be read from the copy source. + :type source_content_md5: bytearray + :param blob_tags_string: Optional. Used to set blob tags in various + blob operations. + :type blob_tags_string: str + :param copy_source_blob_properties: Optional, default is true. + Indicates if properties from the source blob should be copied. + :type copy_source_blob_properties: bool + :param blob_http_headers: Additional parameters for the operation + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param cpk_info: Additional parameters for the operation + :type cpk_info: ~azure.storage.blob.models.CpkInfo + :param cpk_scope_info: Additional parameters for the operation + :type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + blob_content_type = None + if blob_http_headers is not None: + blob_content_type = blob_http_headers.blob_content_type + blob_content_encoding = None + if blob_http_headers is not None: + blob_content_encoding = blob_http_headers.blob_content_encoding + blob_content_language = None + if blob_http_headers is not None: + blob_content_language = blob_http_headers.blob_content_language + blob_content_md5 = None + if blob_http_headers is not None: + blob_content_md5 = blob_http_headers.blob_content_md5 + blob_cache_control = None + if blob_http_headers is not None: + blob_cache_control = blob_http_headers.blob_cache_control + blob_content_disposition = None + if blob_http_headers is not None: + blob_content_disposition = blob_http_headers.blob_content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + encryption_key = None + if cpk_info is not None: + encryption_key = cpk_info.encryption_key + encryption_key_sha256 = None + if cpk_info is not None: + encryption_key_sha256 = cpk_info.encryption_key_sha256 + encryption_algorithm = None + if cpk_info is not None: + encryption_algorithm = cpk_info.encryption_algorithm + encryption_scope = None + if cpk_scope_info is not None: + encryption_scope = cpk_scope_info.encryption_scope + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + if_tags = None + if modified_access_conditions is not None: + if_tags = modified_access_conditions.if_tags + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + source_if_tags = None + if source_modified_access_conditions is not None: + source_if_tags = source_modified_access_conditions.source_if_tags + + # Construct URL + url = self.put_blob_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + + # Construct headers + header_parameters = {} + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if metadata is not None: + header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if source_content_md5 is not None: + header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if blob_tags_string is not None: + header_parameters['x-ms-tags'] = self._serialize.header("blob_tags_string", blob_tags_string, 'str') + header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') + if copy_source_blob_properties is not None: + header_parameters['x-ms-copy-source-blob-properties'] = self._serialize.header("copy_source_blob_properties", copy_source_blob_properties, 'bool') + header_parameters['x-ms-blob-type'] = self._serialize.header("self.x_ms_blob_type", self.x_ms_blob_type, 'str') + if blob_content_type is not None: + header_parameters['x-ms-blob-content-type'] = self._serialize.header("blob_content_type", blob_content_type, 'str') + if blob_content_encoding is not None: + header_parameters['x-ms-blob-content-encoding'] = self._serialize.header("blob_content_encoding", blob_content_encoding, 'str') + if blob_content_language is not None: + header_parameters['x-ms-blob-content-language'] = self._serialize.header("blob_content_language", blob_content_language, 'str') + if blob_content_md5 is not None: + header_parameters['x-ms-blob-content-md5'] = self._serialize.header("blob_content_md5", blob_content_md5, 'bytearray') + if blob_cache_control is not None: + header_parameters['x-ms-blob-cache-control'] = self._serialize.header("blob_cache_control", blob_cache_control, 'str') + if blob_content_disposition is not None: + header_parameters['x-ms-blob-content-disposition'] = self._serialize.header("blob_content_disposition", blob_content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if encryption_key is not None: + header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", encryption_key, 'str') + if encryption_key_sha256 is not None: + header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", encryption_key_sha256, 'str') + if encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", encryption_scope, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if if_tags is not None: + header_parameters['x-ms-if-tags'] = self._serialize.header("if_tags", if_tags, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + if source_if_tags is not None: + header_parameters['x-ms-source-if-tags'] = self._serialize.header("source_if_tags", source_if_tags, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + put_blob_from_url.metadata = {'url': '/{containerName}/{blob}'} + def stage_block(self, block_id, content_length, body, transactional_content_md5=None, transactional_content_crc64=None, timeout=None, request_id=None, lease_access_conditions=None, cpk_info=None, cpk_scope_info=None, cls=None, **kwargs): """The Stage Block operation creates a new block to be committed as part of a blob. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py index 5730483519a4..328ac16b0293 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py @@ -604,10 +604,10 @@ def restore(self, timeout=None, request_id=None, deleted_container_name=None, de analytics logging is enabled. :type request_id: str :param deleted_container_name: Optional. Version 2019-12-12 and - laster. Specifies the name of the deleted container to restore. + later. Specifies the name of the deleted container to restore. :type deleted_container_name: str :param deleted_container_version: Optional. Version 2019-12-12 and - laster. Specifies the version of the deleted container to restore. + later. Specifies the version of the deleted container to restore. :type deleted_container_version: str :param callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py index 6ef707dd11c9..61ca5b37e14a 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2020-02-10" +VERSION = "2020-04-08" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_list_blobs_helper.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_list_blobs_helper.py index 4d082fec96fc..a660b109ca38 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_list_blobs_helper.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_list_blobs_helper.py @@ -6,9 +6,9 @@ # -------------------------------------------------------------------------- from azure.core.paging import PageIterator, ItemPaged -from azure.storage.blob._deserialize import get_blob_properties_from_generated_code -from ._generated.models import StorageErrorException, BlobItemInternal, BlobPrefix as GenBlobPrefix -from ._models import BlobProperties +from ._deserialize import get_blob_properties_from_generated_code, parse_tags +from ._generated.models import StorageErrorException, BlobItemInternal, BlobPrefix as GenBlobPrefix, FilterBlobItem +from ._models import BlobProperties, FilteredBlob from ._shared.models import DictMixin from ._shared.response_handlers import return_context_and_deserialized, process_storage_error @@ -164,3 +164,72 @@ def __init__(self, *args, **kwargs): self.container = kwargs.get('container') self.delimiter = kwargs.get('delimiter') self.location_mode = kwargs.get('location_mode') + + +class FilteredBlobPaged(PageIterator): + """An Iterable of Blob properties. + + :ivar str service_endpoint: The service URL. + :ivar str prefix: A blob name prefix being used to filter the list. + :ivar str marker: The continuation token of the current page of results. + :ivar int results_per_page: The maximum number of results retrieved per API call. + :ivar str continuation_token: The continuation token to retrieve the next page of results. + :ivar str location_mode: The location mode being used to list results. The available + options include "primary" and "secondary". + :ivar current_page: The current page of listed results. + :vartype current_page: list(~azure.storage.blob.FilteredBlob) + :ivar str container: The container that the blobs are listed from. + + :param callable command: Function to retrieve the next page of items. + :param str container: The name of the container. + :param int results_per_page: The maximum number of blobs to retrieve per + call. + :param str continuation_token: An opaque continuation token. + :param location_mode: Specifies the location the request should be sent to. + This mode only applies for RA-GRS accounts which allow secondary read access. + Options include 'primary' or 'secondary'. + """ + def __init__( + self, command, + container=None, + results_per_page=None, + continuation_token=None, + location_mode=None): + super(FilteredBlobPaged, self).__init__( + get_next=self._get_next_cb, + extract_data=self._extract_data_cb, + continuation_token=continuation_token or "" + ) + self._command = command + self.service_endpoint = None + self.marker = continuation_token + self.results_per_page = results_per_page + self.container = container + self.current_page = None + self.location_mode = location_mode + + def _get_next_cb(self, continuation_token): + try: + return self._command( + marker=continuation_token or None, + maxresults=self.results_per_page, + cls=return_context_and_deserialized, + use_location=self.location_mode) + except StorageErrorException as error: + process_storage_error(error) + + def _extract_data_cb(self, get_next_return): + self.location_mode, self._response = get_next_return + self.service_endpoint = self._response.service_endpoint + self.marker = self._response.next_marker + self.current_page = [self._build_item(item) for item in self._response.blobs] + + return self._response.next_marker or None, self.current_page + + @staticmethod + def _build_item(item): + if isinstance(item, FilterBlobItem): + tags = parse_tags(item.tags) + blob = FilteredBlob(name=item.name, container_name=item.container_name, tags=tags) + return blob + return item 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 c27fa9c02fc4..5fe44dcb2ece 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -9,7 +9,7 @@ from enum import Enum from azure.core.paging import PageIterator -from azure.storage.blob._generated.models import FilterBlobItem, ArrowField +from ._generated.models import ArrowField from ._shared import decode_base64_to_text from ._shared.response_handlers import return_context_and_deserialized, process_storage_error @@ -565,78 +565,13 @@ class FilteredBlob(DictMixin): :type name: str :ivar container_name: Container name. :type container_name: str + :ivar tags: Key value pairs of blob tags. + :type tags: Dict[str, str] """ def __init__(self, **kwargs): self.name = kwargs.get('name', None) self.container_name = kwargs.get('container_name', None) - - -class FilteredBlobPaged(PageIterator): - """An Iterable of Blob properties. - - :ivar str service_endpoint: The service URL. - :ivar str prefix: A blob name prefix being used to filter the list. - :ivar str marker: The continuation token of the current page of results. - :ivar int results_per_page: The maximum number of results retrieved per API call. - :ivar str continuation_token: The continuation token to retrieve the next page of results. - :ivar str location_mode: The location mode being used to list results. The available - options include "primary" and "secondary". - :ivar current_page: The current page of listed results. - :vartype current_page: list(~azure.storage.blob.FilteredBlob) - :ivar str container: The container that the blobs are listed from. - - :param callable command: Function to retrieve the next page of items. - :param str container: The name of the container. - :param int results_per_page: The maximum number of blobs to retrieve per - call. - :param str continuation_token: An opaque continuation token. - :param location_mode: Specifies the location the request should be sent to. - This mode only applies for RA-GRS accounts which allow secondary read access. - Options include 'primary' or 'secondary'. - """ - def __init__( - self, command, - container=None, - results_per_page=None, - continuation_token=None, - location_mode=None): - super(FilteredBlobPaged, self).__init__( - get_next=self._get_next_cb, - extract_data=self._extract_data_cb, - continuation_token=continuation_token or "" - ) - self._command = command - self.service_endpoint = None - self.marker = continuation_token - self.results_per_page = results_per_page - self.container = container - self.current_page = None - self.location_mode = location_mode - - def _get_next_cb(self, continuation_token): - try: - return self._command( - marker=continuation_token or None, - maxresults=self.results_per_page, - cls=return_context_and_deserialized, - use_location=self.location_mode) - except StorageErrorException as error: - process_storage_error(error) - - def _extract_data_cb(self, get_next_return): - self.location_mode, self._response = get_next_return - self.service_endpoint = self._response.service_endpoint - self.marker = self._response.next_marker - self.current_page = [self._build_item(item) for item in self._response.blobs] - - return self._response.next_marker or None, self.current_page - - @staticmethod - def _build_item(item): - if isinstance(item, FilterBlobItem): - blob = FilteredBlob(name=item.name, container_name=item.container_name) # pylint: disable=protected-access - return blob - return item + self.tags = kwargs.get('tags', None) class LeaseProperties(DictMixin): 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 a4b13dad938e..cb576c2e4835 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py @@ -36,6 +36,7 @@ '2019-10-10', '2019-12-12', '2020-02-10', + '2020-04-08' ] 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 2c42e050604d..58d3a1f3e398 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 @@ -136,6 +136,105 @@ async def get_account_information(self, **kwargs): # type: ignore except StorageErrorException as error: process_storage_error(error) + @distributed_trace_async + async def upload_blob_from_url(self, source_url, **kwargs): + # type: (str, Any) -> Dict[str, Any] + """ + Creates a new Block Blob where the content of the blob is read from a given URL. + The content of an existing blob is overwritten with the new blob. + + :param str source_url: + A URL of up to 2 KB in length that specifies a file or blob. + The value should be URL-encoded as it would appear in a request URI. + If the source is in another account, the source must either be public + or must be authenticated via a shared access signature. If the source + is public, no authentication is required. + Examples: + https://myaccount.blob.core.windows.net/mycontainer/myblob + + https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= + + https://otheraccount.blob.core.windows.net/mycontainer/myblob?sastoken + :keyword bool overwrite: Whether the blob to be uploaded should overwrite the current data. + If True, upload_blob will overwrite the existing data. If set to False, the + operation will fail with ResourceExistsError. + :keyword bool include_source_blob_properties: + Indicates if properties from the source blob should be copied. Defaults to True. + :keyword tags: + Name-value pairs associated with the blob as tag. Tags are case-sensitive. + The tag set may contain at most 10 tags. Tag keys must be between 1 and 128 characters, + and tag values must be between 0 and 256 characters. + Valid tag key and value characters include: lowercase and uppercase letters, digits (0-9), + space (` `), plus (+), minus (-), period (.), solidus (/), colon (:), equals (=), underscore (_) + :paramtype tags: dict(str, str) + :keyword bytearray source_content_md5: + Specify the md5 that is used to verify the integrity of the source bytes. + :keyword ~datetime.datetime source_if_modified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only + if the source resource has been modified since the specified time. + :keyword ~datetime.datetime source_if_unmodified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only if + the source resource has not been modified since the specified date/time. + :keyword str source_etag: + The source ETag value, or the wildcard character (*). Used to check if the resource has changed, + and act according to the condition specified by the `match_condition` parameter. + :keyword ~azure.core.MatchConditions source_match_condition: + The source match condition to use upon the etag. + :keyword ~datetime.datetime if_modified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only + if the resource has been modified since the specified time. + :keyword ~datetime.datetime if_unmodified_since: + A DateTime value. Azure expects the date value passed in to be UTC. + If timezone is included, any non-UTC datetimes will be converted to UTC. + If a date is passed in without timezone info, it is assumed to be UTC. + Specify this header to perform the operation only if + the resource has not been modified since the specified date/time. + :keyword str etag: + The destination ETag value, or the wildcard character (*). Used to check if the resource has changed, + and act according to the condition specified by the `match_condition` parameter. + :keyword ~azure.core.MatchConditions match_condition: + The destination match condition to use upon the etag. + :keyword destination_lease: + The lease ID specified for this header must match the lease ID of the + destination blob. If the request does not include the lease ID or it is not + valid, the operation fails with status code 412 (Precondition Failed). + :paramtype destination_lease: ~azure.storage.blob.BlobLeaseClient or str + :keyword int timeout: + The timeout parameter is expressed in seconds. + :keyword ~azure.storage.blob.ContentSettings content_settings: + ContentSettings object used to set blob properties. Used to set content type, encoding, + language, disposition, md5, and cache control. + :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk: + Encrypts the data on the service-side with the given key. + Use of customer-provided keys must be done over HTTPS. + As the encryption key itself is provided in the request, + a secure connection must be established to transfer the key. + :keyword str encryption_scope: + A predefined encryption scope used to encrypt the data on the service. An encryption + scope can be created using the Management API and referenced here by name. If a default + encryption scope has been defined at the container, this value will override it if the + container-level scope is configured to allow overrides. Otherwise an error will be raised. + :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. + """ + options = self._upload_blob_from_url_options( + source_url=self._encode_source_url(source_url), + **kwargs) + try: + return await self._client.block_blob.put_blob_from_url(**options) + except StorageErrorException as error: + process_storage_error(error) + @distributed_trace_async async def upload_blob( self, data, # type: Union[Iterable[AnyStr], IO[AnyStr]] @@ -1527,6 +1626,10 @@ async def set_blob_tags(self, tags=None, **kwargs): :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. ``\"\\\"tagname\\\"='my tag'\"`` + :keyword lease: + 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 int timeout: The timeout parameter is expressed in seconds. :returns: Blob-updated property dict (Etag and last modified) @@ -1552,6 +1655,10 @@ async def get_blob_tags(self, **kwargs): :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. ``\"\\\"tagname\\\"='my tag'\"`` + :keyword lease: + 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 int timeout: The timeout parameter is expressed in seconds. :returns: Key value pairs of blob tags. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_models.py index 44d5d6314a2c..9b8bd9f2af72 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_models.py @@ -7,6 +7,7 @@ # pylint: disable=super-init-not-called, too-many-lines from azure.core.async_paging import AsyncPageIterator +from .._deserialize import parse_tags from .._models import ContainerProperties, FilteredBlob from .._shared.response_handlers import return_context_and_deserialized, process_storage_error @@ -136,6 +137,7 @@ async def _extract_data_cb(self, get_next_return): @staticmethod def _build_item(item): if isinstance(item, FilterBlobItem): - blob = FilteredBlob(name=item.name, container_name=item.container_name, tag_value=item.tag_value) # pylint: disable=protected-access + tags = parse_tags(item.tags) + blob = FilteredBlob(name=item.name, container_name=item.container_name, tags=tags) return blob return item diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_filter_blobs.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_filter_blobs.yaml index 59ae949b576f..25ab5e6a1d9b 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_filter_blobs.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_filter_blobs.yaml @@ -11,32 +11,33 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:03:45 GMT + - Fri, 06 Nov 2020 19:43:26 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/containerd79a0d11?timeout=5&restype=container + uri: https://storagename.blob.core.windows.net/containerd79a0d11?timeout=5&restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:820fefb8-101e-0017-8075-b473c9000000\nTime:2020-11-06T19:43:26.7136424Z" headers: content-length: - - '0' + - '230' + content-type: + - application/xml date: - - Thu, 02 Jul 2020 22:03:45 GMT - etag: - - '"0x8D81ED3CB3980B2"' - last-modified: - - Thu, 02 Jul 2020 22:03:46 GMT + - Fri, 06 Nov 2020 19:43:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists x-ms-version: - - '2019-12-12' + - '2020-04-08' status: - code: 201 - message: Created + code: 409 + message: The specified container already exists. - request: body: null headers: @@ -49,32 +50,33 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container1d79a0d11?restype=container + uri: https://storagename.blob.core.windows.net/container1d79a0d11?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:820feff2-101e-0017-3575-b473c9000000\nTime:2020-11-06T19:43:26.7946995Z" headers: content-length: - - '0' + - '230' + content-type: + - application/xml date: - - Thu, 02 Jul 2020 22:03:46 GMT - etag: - - '"0x8D81ED3CB4717B8"' - last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists x-ms-version: - - '2019-12-12' + - '2020-04-08' status: - code: 201 - message: Created + code: 409 + message: The specified container already exists. - request: body: null headers: @@ -87,32 +89,33 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container2d79a0d11?restype=container + uri: https://storagename.blob.core.windows.net/container2d79a0d11?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:820ff013-101e-0017-5075-b473c9000000\nTime:2020-11-06T19:43:26.8517405Z" headers: content-length: - - '0' + - '230' + content-type: + - application/xml date: - - Thu, 02 Jul 2020 22:03:46 GMT - etag: - - '"0x8D81ED3CB5487AE"' - last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists x-ms-version: - - '2019-12-12' + - '2020-04-08' status: - code: 201 - message: Created + code: 409 + message: The specified container already exists. - request: body: null headers: @@ -125,32 +128,33 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container3d79a0d11?restype=container + uri: https://storagename.blob.core.windows.net/container3d79a0d11?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:820ff01c-101e-0017-5675-b473c9000000\nTime:2020-11-06T19:43:26.9087810Z" headers: content-length: - - '0' + - '230' + content-type: + - application/xml date: - - Thu, 02 Jul 2020 22:03:46 GMT - etag: - - '"0x8D81ED3CB68AF9D"' - last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists x-ms-version: - - '2019-12-12' + - '2020-04-08' status: - code: 201 - message: Created + code: 409 + message: The specified container already exists. - request: body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa headers: @@ -165,17 +169,17 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/containerd79a0d11/blob1 + uri: https://storagename.blob.core.windows.net/containerd79a0d11/blob1 response: body: string: '' @@ -185,11 +189,11 @@ interactions: content-md5: - yaNM/IXZgmmMasifdgcavQ== date: - - Thu, 02 Jul 2020 22:03:46 GMT + - Fri, 06 Nov 2020 19:43:26 GMT etag: - - '"0x8D81ED3CB7B9C18"' + - '"0x8D8828C3B00FC83"' last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: @@ -197,7 +201,9 @@ interactions: x-ms-request-server-encrypted: - 'true' x-ms-version: - - '2019-12-12' + - '2020-04-08' + x-ms-version-id: + - '2020-11-06T19:43:26.9887891Z' status: code: 201 message: Created @@ -215,17 +221,17 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:27 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container1d79a0d11/blob2 + uri: https://storagename.blob.core.windows.net/container1d79a0d11/blob2 response: body: string: '' @@ -235,11 +241,11 @@ interactions: content-md5: - yaNM/IXZgmmMasifdgcavQ== date: - - Thu, 02 Jul 2020 22:03:46 GMT + - Fri, 06 Nov 2020 19:43:26 GMT etag: - - '"0x8D81ED3CB8B2F58"' + - '"0x8D8828C3B0BACE8"' last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:27 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: @@ -247,7 +253,9 @@ interactions: x-ms-request-server-encrypted: - 'true' x-ms-version: - - '2019-12-12' + - '2020-04-08' + x-ms-version-id: + - '2020-11-06T19:43:27.0588408Z' status: code: 201 message: Created @@ -265,17 +273,17 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:27 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container2d79a0d11/blob3 + uri: https://storagename.blob.core.windows.net/container2d79a0d11/blob3 response: body: string: '' @@ -285,11 +293,11 @@ interactions: content-md5: - yaNM/IXZgmmMasifdgcavQ== date: - - Thu, 02 Jul 2020 22:03:46 GMT + - Fri, 06 Nov 2020 19:43:26 GMT etag: - - '"0x8D81ED3CB991492"' + - '"0x8D8828C3B191CC5"' last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:27 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: @@ -297,7 +305,9 @@ interactions: x-ms-request-server-encrypted: - 'true' x-ms-version: - - '2019-12-12' + - '2020-04-08' + x-ms-version-id: + - '2020-11-06T19:43:27.1479018Z' status: code: 201 message: Created @@ -315,17 +325,17 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:27 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container3d79a0d11/blob4 + uri: https://storagename.blob.core.windows.net/container3d79a0d11/blob4 response: body: string: '' @@ -335,11 +345,11 @@ interactions: content-md5: - yaNM/IXZgmmMasifdgcavQ== date: - - Thu, 02 Jul 2020 22:03:46 GMT + - Fri, 06 Nov 2020 19:43:26 GMT etag: - - '"0x8D81ED3CBAB1941"' + - '"0x8D8828C3B270205"' last-modified: - - Thu, 02 Jul 2020 22:03:47 GMT + - Fri, 06 Nov 2020 19:43:27 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: @@ -347,7 +357,9 @@ interactions: x-ms-request-server-encrypted: - 'true' x-ms-version: - - '2019-12-12' + - '2020-04-08' + x-ms-version-id: + - '2020-11-06T19:43:27.2389673Z' status: code: 201 message: Created @@ -361,28 +373,31 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:06:12 GMT + - Fri, 06 Nov 2020 19:43:37 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: GET - uri: https://pytagstoragestorname.blob.core.windows.net/?where=tag1%3D%27firsttag%27&maxresults=2&comp=blobs + uri: https://storagename.blob.core.windows.net/?where=tag1%3D%27firsttag%27%20and%20tag2%3D%27secondtag%27&maxresults=2&comp=blobs response: body: string: "\uFEFF\ntag1='firsttag'2blob2container1d79a0d11firsttagblob3container2d79a0d11firsttag2!244!MDAwMDM1IWNvbnRhaW5lcjNkNzlhMGQxMQEwMUQ2NTBCQ0E4RjFBQjJDITAwMDAwNSFibG9iNCEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhMTdjN2Y5YzMtODZlMC00ODdjLTg1YjAtODRkMGViNmI1M2MzITAwMDAwNCF0YWcxIQ--" + ServiceEndpoint=\"https://storagename.blob.core.windows.net/\">tag1='firsttag' + and tag2='secondtag'2blob2container12fd60f8etag1firsttagtag2secondtagblob2container1d79a0d11tag1firsttagtag2secondtag2!244!MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhMzI5OTE2MzEtZmU0OC00MmU5LThiMWItMDA5YjU0ZGVkM2JjITAwMDAwNCF0YWcxIQ--" headers: content-type: - application/xml date: - - Thu, 02 Jul 2020 22:06:12 GMT + - Fri, 06 Nov 2020 19:43:37 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + vary: + - Origin x-ms-version: - - '2019-12-12' + - '2020-04-08' status: code: 200 message: OK @@ -396,28 +411,31 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:06:48 GMT + - Fri, 06 Nov 2020 19:43:37 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: GET - uri: https://pytagstoragestorname.blob.core.windows.net/?where=tag1%3D%27firsttag%27&marker=2%21244%21MDAwMDM1IWNvbnRhaW5lcjNkNzlhMGQxMQEwMUQ2NTBCQ0E4RjFBQjJDITAwMDAwNSFibG9iNCEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhMTdjN2Y5YzMtODZlMC00ODdjLTg1YjAtODRkMGViNmI1M2MzITAwMDAwNCF0YWcxIQ--&maxresults=2&comp=blobs + uri: https://storagename.blob.core.windows.net/?where=tag1%3D%27firsttag%27%20and%20tag2%3D%27secondtag%27&marker=2%21244%21MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhMzI5OTE2MzEtZmU0OC00MmU5LThiMWItMDA5YjU0ZGVkM2JjITAwMDAwNCF0YWcxIQ--&maxresults=2&comp=blobs response: body: string: "\uFEFF\n2!244!MDAwMDM1IWNvbnRhaW5lcjNkNzlhMGQxMQEwMUQ2NTBCQ0E4RjFBQjJDITAwMDAwNSFibG9iNCEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhMTdjN2Y5YzMtODZlMC00ODdjLTg1YjAtODRkMGViNmI1M2MzITAwMDAwNCF0YWcxIQ--tag1='firsttag'2blob4container3d79a0d11firsttagblob1containerd79a0d11firsttag" + ServiceEndpoint=\"https://storagename.blob.core.windows.net/\">2!244!MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhMzI5OTE2MzEtZmU0OC00MmU5LThiMWItMDA5YjU0ZGVkM2JjITAwMDAwNCF0YWcxIQ--tag1='firsttag' + and tag2='secondtag'2blob3container22fd60f8etag1firsttagtag2secondtagblob3container2d79a0d11tag1firsttagtag2secondtag2!240!MDAwMDM0IWNvbnRhaW5lcjJmZDYwZjhlATAxRDZCNDcwNjA2NDc2NjIhMDAwMDA1IWJsb2IxITAwMDAxNiEIAAAACAAAAGZpcnN0dGFnITAwMDAwMSEwITAwMDAyOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaITAwMDAzNiFlYTY0ZTA3Mi0wZGJiLTRkYTgtYmUzYi01ZjdiOTYxNDYyNTchMDAwMDA0IXRhZzEh" headers: content-type: - application/xml date: - - Thu, 02 Jul 2020 22:06:48 GMT + - Fri, 06 Nov 2020 19:43:37 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + vary: + - Origin x-ms-version: - - '2019-12-12' + - '2020-04-08' status: code: 200 message: OK diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_set_blob_tags_with_lease.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_set_blob_tags_with_lease.yaml new file mode 100644 index 000000000000..0117c5523fa3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_set_blob_tags_with_lease.yaml @@ -0,0 +1,372 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:47 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/container942b11f6?timeout=5&restype=container + response: + body: + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:6b2d2938-f01e-000f-1885-b4acae000000\nTime:2020-11-06T21:43:47.5808008Z" + headers: + content-length: + - '230' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 21:43:46 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ContainerAlreadyExists + x-ms-version: + - '2020-04-08' + status: + code: 409 + message: The specified container already exists. +- request: + body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 06 Nov 2020 21:43:47 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6 + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - yaNM/IXZgmmMasifdgcavQ== + date: + - Fri, 06 Nov 2020 21:43:47 GMT + etag: + - '"0x8D8829D0ADB38C6"' + last-modified: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - ov8U1LLnyKc= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-11-06T21:43:47.6540614Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:47 GMT + x-ms-lease-action: + - acquire + x-ms-lease-duration: + - '-1' + x-ms-proposed-lease-id: + - 2e317d7c-4e67-4f47-b3e4-c65dc53e30d4 + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6?comp=lease + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 06 Nov 2020 21:43:47 GMT + etag: + - '"0x8D8829D0ADB38C6"' + last-modified: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-lease-id: + - 2e317d7c-4e67-4f47-b3e4-c65dc53e30d4 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: ' + + tag1firsttagtag2secondtagtag3thirdtag' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '217' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:47 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6?comp=tags + response: + body: + string: "\uFEFF\nLeaseIdMissingThere + is currently a lease on the blob and no lease ID was specified in the request.\nRequestId:6b2d29d0-f01e-000f-2785-b4acae000000\nTime:2020-11-06T21:43:47.9960936Z" + headers: + content-length: + - '268' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the blob and no lease ID was specified + in the request. +- request: + body: ' + + tag1firsttagtag2secondtagtag3thirdtag' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '217' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:48 GMT + x-ms-lease-id: + - 2e317d7c-4e67-4f47-b3e4-c65dc53e30d4 + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6?comp=tags + response: + body: + string: '' + headers: + date: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:48 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6?comp=tags + response: + body: + string: "\uFEFF\ntag1firsttagtag2secondtagtag3thirdtag" + headers: + content-length: + - '220' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + vary: + - Origin + x-ms-version: + - '2020-04-08' + 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.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:48 GMT + x-ms-lease-id: + - '''d92e6954-3274-4715-811c-727ca7145303''' + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6?comp=tags + response: + body: + string: "\uFEFF\nInvalidHeaderValueThe + value for one of the HTTP headers is not in the correct format.\nRequestId:6b2d2b0d-f01e-000f-4a85-b4acae000000\nTime:2020-11-06T21:43:48.2933032Zx-ms-lease-id'd92e6954-3274-4715-811c-727ca7145303'" + headers: + content-length: + - '368' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + vary: + - Origin + x-ms-error-code: + - InvalidHeaderValue + x-ms-version: + - '2020-04-08' + status: + code: 400 + message: The value for one of the HTTP headers is not in the correct format. +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:48 GMT + x-ms-lease-id: + - 2e317d7c-4e67-4f47-b3e4-c65dc53e30d4 + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6?comp=tags + response: + body: + string: "\uFEFF\ntag1firsttagtag2secondtagtag3thirdtag" + headers: + content-length: + - '220' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 21:43:47 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + vary: + - Origin + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:43:48 GMT + x-ms-lease-id: + - 2e317d7c-4e67-4f47-b3e4-c65dc53e30d4 + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.blob.core.windows.net/container942b11f6/blob942b11f6 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 06 Nov 2020 21:43:48 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-delete-type-permanent: + - 'false' + x-ms-version: + - '2020-04-08' + status: + code: 202 + message: Accepted +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_filter_blobs.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_filter_blobs.yaml index 33704cef9a73..6290de18b2a4 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_filter_blobs.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_filter_blobs.yaml @@ -3,102 +3,106 @@ interactions: body: null headers: User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:12:35 GMT + - Fri, 06 Nov 2020 19:44:38 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container2fd60f8e?timeout=5&restype=container + uri: https://storagename.blob.core.windows.net/container2fd60f8e?timeout=5&restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:1bf4f8c6-801e-0015-4b75-b4cd71000000\nTime:2020-11-06T19:44:38.6773417Z" headers: - content-length: '0' - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED5071497F3"' - last-modified: Thu, 02 Jul 2020 22:12:36 GMT + content-length: '230' + content-type: application/xml + date: Fri, 06 Nov 2020 19:44:38 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-12-12' + x-ms-error-code: ContainerAlreadyExists + x-ms-version: '2020-04-08' status: - code: 201 - message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container2fd60f8e?timeout=5&restype=container + code: 409 + message: The specified container already exists. + url: https://seanmcccanary3.blob.core.windows.net/container2fd60f8e?timeout=5&restype=container - request: body: null headers: User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:12:36 GMT + - Fri, 06 Nov 2020 19:44:38 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container12fd60f8e?restype=container + uri: https://storagename.blob.core.windows.net/container12fd60f8e?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:1bf4f8d5-801e-0015-5175-b4cd71000000\nTime:2020-11-06T19:44:38.7594004Z" headers: - content-length: '0' - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED507225687"' - last-modified: Thu, 02 Jul 2020 22:12:36 GMT + content-length: '230' + content-type: application/xml + date: Fri, 06 Nov 2020 19:44:38 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-12-12' + x-ms-error-code: ContainerAlreadyExists + x-ms-version: '2020-04-08' status: - code: 201 - message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container12fd60f8e?restype=container + code: 409 + message: The specified container already exists. + url: https://seanmcccanary3.blob.core.windows.net/container12fd60f8e?restype=container - request: body: null headers: User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:12:37 GMT + - Fri, 06 Nov 2020 19:44:38 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container22fd60f8e?restype=container + uri: https://storagename.blob.core.windows.net/container22fd60f8e?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:1bf4f8d9-801e-0015-5475-b4cd71000000\nTime:2020-11-06T19:44:38.8284490Z" headers: - content-length: '0' - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED5072F51A5"' - last-modified: Thu, 02 Jul 2020 22:12:37 GMT + content-length: '230' + content-type: application/xml + date: Fri, 06 Nov 2020 19:44:38 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-12-12' + x-ms-error-code: ContainerAlreadyExists + x-ms-version: '2020-04-08' status: - code: 201 - message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container22fd60f8e?restype=container + code: 409 + message: The specified container already exists. + url: https://seanmcccanary3.blob.core.windows.net/container22fd60f8e?restype=container - request: body: null headers: User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:12:37 GMT + - Fri, 06 Nov 2020 19:44:38 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container32fd60f8e?restype=container + uri: https://storagename.blob.core.windows.net/container32fd60f8e?restype=container response: body: - string: '' + string: "\uFEFFContainerAlreadyExistsThe + specified container already exists.\nRequestId:1bf4f8e6-801e-0015-6075-b4cd71000000\nTime:2020-11-06T19:44:38.8844884Z" headers: - content-length: '0' - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED5073D1034"' - last-modified: Thu, 02 Jul 2020 22:12:37 GMT + content-length: '230' + content-type: application/xml + date: Fri, 06 Nov 2020 19:44:38 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-version: '2019-12-12' + x-ms-error-code: ContainerAlreadyExists + x-ms-version: '2020-04-08' status: - code: 201 - message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container32fd60f8e?restype=container + code: 409 + message: The specified container already exists. + url: https://seanmcccanary3.blob.core.windows.net/container32fd60f8e?restype=container - request: body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa headers: @@ -107,34 +111,35 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:12:37 GMT + - Fri, 06 Nov 2020 19:44:38 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container2fd60f8e/blob1 + uri: https://storagename.blob.core.windows.net/container2fd60f8e/blob1 response: body: string: '' headers: content-length: '0' content-md5: yaNM/IXZgmmMasifdgcavQ== - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED5074BB319"' - last-modified: Thu, 02 Jul 2020 22:12:37 GMT + date: Fri, 06 Nov 2020 19:44:38 GMT + etag: '"0x8D8828C65F4D6FC"' + last-modified: Fri, 06 Nov 2020 19:44:39 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: ov8U1LLnyKc= x-ms-request-server-encrypted: 'true' - x-ms-version: '2019-12-12' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-11-06T19:44:39.0512140Z' status: code: 201 message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container2fd60f8e/blob1 + url: https://seanmcccanary3.blob.core.windows.net/container2fd60f8e/blob1 - request: body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa headers: @@ -143,34 +148,35 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:12:37 GMT + - Fri, 06 Nov 2020 19:44:39 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container12fd60f8e/blob2 + uri: https://storagename.blob.core.windows.net/container12fd60f8e/blob2 response: body: string: '' headers: content-length: '0' content-md5: yaNM/IXZgmmMasifdgcavQ== - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED5075AF89D"' - last-modified: Thu, 02 Jul 2020 22:12:37 GMT + date: Fri, 06 Nov 2020 19:44:38 GMT + etag: '"0x8D8828C66018375"' + last-modified: Fri, 06 Nov 2020 19:44:39 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: ov8U1LLnyKc= x-ms-request-server-encrypted: 'true' - x-ms-version: '2019-12-12' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-11-06T19:44:39.1342725Z' status: code: 201 message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container12fd60f8e/blob2 + url: https://seanmcccanary3.blob.core.windows.net/container12fd60f8e/blob2 - request: body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa headers: @@ -179,34 +185,35 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:12:37 GMT + - Fri, 06 Nov 2020 19:44:39 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container22fd60f8e/blob3 + uri: https://storagename.blob.core.windows.net/container22fd60f8e/blob3 response: body: string: '' headers: content-length: '0' content-md5: yaNM/IXZgmmMasifdgcavQ== - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED50769EFF0"' - last-modified: Thu, 02 Jul 2020 22:12:37 GMT + date: Fri, 06 Nov 2020 19:44:38 GMT + etag: '"0x8D8828C660BBE8E"' + last-modified: Fri, 06 Nov 2020 19:44:39 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: ov8U1LLnyKc= x-ms-request-server-encrypted: 'true' - x-ms-version: '2019-12-12' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-11-06T19:44:39.2013214Z' status: code: 201 message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container22fd60f8e/blob3 + url: https://seanmcccanary3.blob.core.windows.net/container22fd60f8e/blob3 - request: body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa headers: @@ -215,86 +222,91 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 02 Jul 2020 22:12:37 GMT + - Fri, 06 Nov 2020 19:44:39 GMT x-ms-tags: - tag1=firsttag&tag2=secondtag&tag3=thirdtag x-ms-version: - - '2019-12-12' + - '2020-04-08' method: PUT - uri: https://pytagstoragestorname.blob.core.windows.net/container32fd60f8e/blob4 + uri: https://storagename.blob.core.windows.net/container32fd60f8e/blob4 response: body: string: '' headers: content-length: '0' content-md5: yaNM/IXZgmmMasifdgcavQ== - date: Thu, 02 Jul 2020 22:12:36 GMT - etag: '"0x8D81ED5077B58C5"' - last-modified: Thu, 02 Jul 2020 22:12:37 GMT + date: Fri, 06 Nov 2020 19:44:38 GMT + etag: '"0x8D8828C6619076A"' + last-modified: Fri, 06 Nov 2020 19:44:39 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: ov8U1LLnyKc= x-ms-request-server-encrypted: 'true' - x-ms-version: '2019-12-12' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-11-06T19:44:39.2893843Z' status: code: 201 message: Created - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/container32fd60f8e/blob4 + url: https://seanmcccanary3.blob.core.windows.net/container32fd60f8e/blob4 - request: body: null headers: Accept: - application/xml User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:12:43 GMT + - Fri, 06 Nov 2020 19:50:02 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: GET - uri: https://pytagstoragestorname.blob.core.windows.net/?where=tag1%3D'firsttag'&maxresults=2&comp=blobs + uri: https://storagename.blob.core.windows.net/?where=%22tag1%22%3D'firsttag'%20and%20%22tag2%22%3D'secondtag'&maxresults=2&comp=blobs response: body: string: "\uFEFF\ntag1='firsttag'2blob2container12fd60f8efirsttagblob3container22fd60f8efirsttag2!240!MDAwMDM0IWNvbnRhaW5lcjJmZDYwZjhlATAxRDY1MEJERTQ5REMwRDYhMDAwMDA1IWJsb2IxITAwMDAxNiEIAAAACAAAAGZpcnN0dGFnITAwMDAwMSEwITAwMDAyOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaITAwMDAzNiFhODVmY2U3MS0zOGU4LTQ0OTgtYWM3My0xZThhYjUzYWIwMmYhMDAwMDA0IXRhZzEh" + ServiceEndpoint=\"https://storagename.blob.core.windows.net/\">"tag1"='firsttag' + and "tag2"='secondtag'2blob2container12fd60f8etag1firsttagtag2secondtagblob2container1d79a0d11tag1firsttagtag2secondtag2!244!MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhNGY3YjQ2NWYtODM0My00M2ZlLTg5YjItYzkzOTVhMTMwN2RmITAwMDAwNCF0YWcxIQ--" headers: content-type: application/xml - date: Thu, 02 Jul 2020 22:12:42 GMT + date: Fri, 06 Nov 2020 19:50:03 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked - x-ms-version: '2019-12-12' + vary: Origin + x-ms-version: '2020-04-08' status: code: 200 message: OK - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/?where=tag1%3D'firsttag'&maxresults=2&comp=blobs + url: https://seanmcccanary3.blob.core.windows.net/?where=%22tag1%22%3D'firsttag'%20and%20%22tag2%22%3D'secondtag'&maxresults=2&comp=blobs - request: body: null headers: Accept: - application/xml User-Agent: - - azsdk-python-storage-blob/12.3.3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-date: - - Thu, 02 Jul 2020 22:13:02 GMT + - Fri, 06 Nov 2020 19:50:04 GMT x-ms-version: - - '2019-12-12' + - '2020-04-08' method: GET - uri: https://pytagstoragestorname.blob.core.windows.net/?where=tag1%3D'firsttag'&marker=2!240!MDAwMDM0IWNvbnRhaW5lcjJmZDYwZjhlATAxRDY1MEJERTQ5REMwRDYhMDAwMDA1IWJsb2IxITAwMDAxNiEIAAAACAAAAGZpcnN0dGFnITAwMDAwMSEwITAwMDAyOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaITAwMDAzNiFhODVmY2U3MS0zOGU4LTQ0OTgtYWM3My0xZThhYjUzYWIwMmYhMDAwMDA0IXRhZzEh&maxresults=2&comp=blobs + uri: https://storagename.blob.core.windows.net/?where=%22tag1%22%3D'firsttag'%20and%20%22tag2%22%3D'secondtag'&marker=2!244!MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhNGY3YjQ2NWYtODM0My00M2ZlLTg5YjItYzkzOTVhMTMwN2RmITAwMDAwNCF0YWcxIQ--&maxresults=2&comp=blobs response: body: string: "\uFEFF\n2!240!MDAwMDM0IWNvbnRhaW5lcjJmZDYwZjhlATAxRDY1MEJERTQ5REMwRDYhMDAwMDA1IWJsb2IxITAwMDAxNiEIAAAACAAAAGZpcnN0dGFnITAwMDAwMSEwITAwMDAyOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaITAwMDAzNiFhODVmY2U3MS0zOGU4LTQ0OTgtYWM3My0xZThhYjUzYWIwMmYhMDAwMDA0IXRhZzEhtag1='firsttag'2blob1container2fd60f8efirsttagblob4container32fd60f8efirsttag" + ServiceEndpoint=\"https://storagename.blob.core.windows.net/\">2!244!MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhNGY3YjQ2NWYtODM0My00M2ZlLTg5YjItYzkzOTVhMTMwN2RmITAwMDAwNCF0YWcxIQ--"tag1"='firsttag' + and "tag2"='secondtag'2blob3container22fd60f8etag1firsttagtag2secondtagblob3container2d79a0d11tag1firsttagtag2secondtag2!240!MDAwMDM0IWNvbnRhaW5lcjJmZDYwZjhlATAxRDZCNDcwNjA2NDc2NjIhMDAwMDA1IWJsb2IxITAwMDAxNiEIAAAACAAAAGZpcnN0dGFnITAwMDAwMSEwITAwMDAyOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaITAwMDAzNiEwZGJkMTMwZi0yNzU0LTRiYjUtOTg2OC01ZGZkYzM2OGY3ZTkhMDAwMDA0IXRhZzEh" headers: content-type: application/xml - date: Thu, 02 Jul 2020 22:13:02 GMT + date: Fri, 06 Nov 2020 19:50:03 GMT server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked - x-ms-version: '2019-12-12' + vary: Origin + x-ms-version: '2020-04-08' status: code: 200 message: OK - url: https://pytagstoragerbckbwvtpu4v.blob.core.windows.net/?where=tag1%3D'firsttag'&marker=2!240!MDAwMDM0IWNvbnRhaW5lcjJmZDYwZjhlATAxRDY1MEJERTQ5REMwRDYhMDAwMDA1IWJsb2IxITAwMDAxNiEIAAAACAAAAGZpcnN0dGFnITAwMDAwMSEwITAwMDAyOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaITAwMDAzNiFhODVmY2U3MS0zOGU4LTQ0OTgtYWM3My0xZThhYjUzYWIwMmYhMDAwMDA0IXRhZzEh&maxresults=2&comp=blobs + url: https://seanmcccanary3.blob.core.windows.net/?where=%22tag1%22%3D'firsttag'%20and%20%22tag2%22%3D'secondtag'&marker=2!244!MDAwMDM1IWNvbnRhaW5lcjIyZmQ2MGY4ZQEwMUQ2QjQ3MDYwN0ZBNDdBITAwMDAwNSFibG9iMyEwMDAwMTYhCAAAAAgAAABmaXJzdHRhZyEwMDAwMDEhMCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiEwMDAwMzYhNGY3YjQ2NWYtODM0My00M2ZlLTg5YjItYzkzOTVhMTMwN2RmITAwMDAwNCF0YWcxIQ--&maxresults=2&comp=blobs version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_set_blob_tags_with_lease.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_set_blob_tags_with_lease.yaml new file mode 100644 index 000000000000..5ec08a3549a1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags_async.test_set_blob_tags_with_lease.yaml @@ -0,0 +1,270 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:53 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/containera431473?timeout=5&restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 06 Nov 2020 21:47:52 GMT + etag: '"0x8D8829D9D9E464C"' + last-modified: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/containera431473?timeout=5&restype=container +- request: + body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + headers: + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Fri, 06 Nov 2020 21:47:53 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473 + response: + body: + string: '' + headers: + content-length: '0' + content-md5: yaNM/IXZgmmMasifdgcavQ== + date: Fri, 06 Nov 2020 21:47:53 GMT + etag: '"0x8D8829D9DA61294"' + last-modified: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: ov8U1LLnyKc= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-11-06T21:47:53.9308180Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473 +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:53 GMT + x-ms-lease-action: + - acquire + x-ms-lease-duration: + - '-1' + x-ms-proposed-lease-id: + - c4582a27-fa57-40db-8cc8-379fde913433 + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473?comp=lease + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 06 Nov 2020 21:47:53 GMT + etag: '"0x8D8829D9DA61294"' + last-modified: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-lease-id: c4582a27-fa57-40db-8cc8-379fde913433 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473?comp=lease +- request: + body: ' + + tag1firsttagtag2secondtagtag3thirdtag' + headers: + Content-Length: + - '217' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:54 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473?comp=tags + response: + body: + string: "\uFEFF\nLeaseIdMissingThere + is currently a lease on the blob and no lease ID was specified in the request.\nRequestId:dccdd42d-401e-0035-4086-b4b6d6000000\nTime:2020-11-06T21:47:54.1899339Z" + headers: + content-length: '268' + content-type: application/xml + date: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: LeaseIdMissing + x-ms-version: '2020-04-08' + status: + code: 412 + message: There is currently a lease on the blob and no lease ID was specified + in the request. + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473?comp=tags +- request: + body: ' + + tag1firsttagtag2secondtagtag3thirdtag' + headers: + Content-Length: + - '217' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:54 GMT + x-ms-lease-id: + - c4582a27-fa57-40db-8cc8-379fde913433 + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473?comp=tags + response: + body: + string: '' + headers: + date: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 204 + message: No Content + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473?comp=tags +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:54 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473?comp=tags + response: + body: + string: "\uFEFF\ntag1firsttagtag2secondtagtag3thirdtag" + headers: + content-length: '220' + content-type: application/xml + date: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + vary: Origin + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473?comp=tags +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:54 GMT + x-ms-lease-id: + - '''d92e6954-3274-4715-811c-727ca7145303''' + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473?comp=tags + response: + body: + string: "\uFEFF\nInvalidHeaderValueThe + value for one of the HTTP headers is not in the correct format.\nRequestId:dccdd4c8-401e-0035-4986-b4b6d6000000\nTime:2020-11-06T21:47:54.3740649Zx-ms-lease-id'd92e6954-3274-4715-811c-727ca7145303'" + headers: + content-length: '368' + content-type: application/xml + date: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + vary: Origin + x-ms-error-code: InvalidHeaderValue + x-ms-version: '2020-04-08' + status: + code: 400 + message: The value for one of the HTTP headers is not in the correct format. + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473?comp=tags +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:54 GMT + x-ms-lease-id: + - c4582a27-fa57-40db-8cc8-379fde913433 + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473?comp=tags + response: + body: + string: "\uFEFF\ntag1firsttagtag2secondtagtag3thirdtag" + headers: + content-length: '220' + content-type: application/xml + date: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + vary: Origin + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473?comp=tags +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 21:47:54 GMT + x-ms-lease-id: + - c4582a27-fa57-40db-8cc8-379fde913433 + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.blob.core.windows.net/containera431473/bloba431473 + response: + body: + string: '' + headers: + content-length: '0' + date: Fri, 06 Nov 2020 21:47:53 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-delete-type-permanent: 'false' + x-ms-version: '2020-04-08' + status: + code: 202 + message: Accepted + url: https://seanmcccanary3.blob.core.windows.net/containera431473/bloba431473 +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_if_match_condition.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_if_match_condition.yaml new file mode 100644 index 000000000000..a6cdb68a1fab --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_if_match_condition.yaml @@ -0,0 +1,537 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:39 GMT + etag: + - '"0x8D89642DD41E438"' + last-modified: + - Tue, 01 Dec 2020 21:48:39 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - 1B2M2Y8AsgTpgAmY7PhCfg== + date: + - Tue, 01 Dec 2020 21:48:39 GMT + etag: + - '"0x8D89642DD526369"' + last-modified: + - Tue, 01 Dec 2020 21:48:39 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:39.8097257Z' + status: + code: 201 + message: Created +- request: + body: fake data + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '9' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - DHa+SUlusmH+AAI91Dli4g== + date: + - Tue, 01 Dec 2020 21:48:39 GMT + etag: + - '"0x8D89642DD6419E7"' + last-modified: + - Tue, 01 Dec 2020 21:48:39 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - i5c8XC72eYw= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:39.9258087Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-Modified-Since: + - Tue, 01 Dec 2020 22:03:42 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: "\uFEFFConditionNotMetThe + condition specified using HTTP conditional header(s) is not met.\nRequestId:c6d2b4b0-801e-0058-4d2b-c8029d000000\nTime:2020-12-01T21:48:40.0478576Z" + headers: + content-length: + - '252' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:48:39 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ConditionNotMet + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: The condition specified using HTTP conditional header(s) is not met. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-Modified-Since: + - Tue, 01 Dec 2020 21:33:42 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:40 GMT + etag: + - '"0x8D89642DD8711A1"' + last-modified: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:40.1559729Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-Unmodified-Since: + - Tue, 01 Dec 2020 21:33:42 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:43 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: "\uFEFFConditionNotMetThe + condition specified using HTTP conditional header(s) is not met.\nRequestId:c6d2b4d9-801e-0058-6c2b-c8029d000000\nTime:2020-12-01T21:48:40.2680146Z" + headers: + content-length: + - '252' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - ConditionNotMet + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: The condition specified using HTTP conditional header(s) is not met. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-Unmodified-Since: + - Tue, 01 Dec 2020 22:03:42 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:43 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:40 GMT + etag: + - '"0x8D89642DDA8D0A6"' + last-modified: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:40.3781323Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:43 GMT + x-ms-source-if-modified-since: + - Tue, 01 Dec 2020 22:03:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - CannotVerifyCopySource + x-ms-version: + - '2020-04-08' + status: + code: 304 + message: The condition specified using HTTP conditional header(s) is not met. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:43 GMT + x-ms-source-if-modified-since: + - Tue, 01 Dec 2020 21:33:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:40 GMT + etag: + - '"0x8D89642DDCBEF75"' + last-modified: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:40.6072965Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:43 GMT + x-ms-source-if-unmodified-since: + - Tue, 01 Dec 2020 21:33:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: "\uFEFFCannotVerifyCopySourceThe + condition specified using HTTP conditional header(s) is not met.\nRequestId:c6d2b517-801e-0058-142b-c8029d000000\nTime:2020-12-01T21:48:40.7163341Z" + headers: + content-length: + - '259' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - CannotVerifyCopySource + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: The condition specified using HTTP conditional header(s) is not met. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainere8d9187e/blobe8d9187e?se=2020-12-01T22%3A48%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=gjMGoKOvg70phbI3g3lgEyWN%2BTJ/1dFu7AcwkZwuopE%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:43 GMT + x-ms-source-if-unmodified-since: + - Tue, 01 Dec 2020 22:03:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainere8d9187e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:40 GMT + etag: + - '"0x8D89642DDED1222"' + last-modified: + - Tue, 01 Dec 2020 21:48:40 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:40.8244530Z' + status: + code: 201 + message: Created +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_overwrite_properties.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_overwrite_properties.yaml new file mode 100644 index 000000000000..20b418af21a1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_overwrite_properties.yaml @@ -0,0 +1,238 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:02 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer206719b0?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:59 GMT + etag: + - '"0x8D89642E930F974"' + last-modified: + - Tue, 01 Dec 2020 21:48:59 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: This is test data to be copied over. + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-content-language: + - spanish + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:02 GMT + x-ms-tags: + - tag1=sourcetag&tag2=secondsourcetag + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer206719b0/blob206719b0 + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + date: + - Tue, 01 Dec 2020 21:48:59 GMT + etag: + - '"0x8D89642E9444B4F"' + last-modified: + - Tue, 01 Dec 2020 21:48:59 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:59.8500175Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-content-language: + - english + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer206719b0/blob206719b0?se=2020-12-01T22%3A49%3A02Z&sp=rt&sv=2020-04-08&sr=b&sig=DlRTtYHGoo4gbgHe0Fj3rIytLFlDJhjrbtajplrFE1U%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:02 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-tags: + - tag1=copytag + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer206719b0/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:59 GMT + etag: + - '"0x8D89642E96B1449"' + last-modified: + - Tue, 01 Dec 2020 21:49:00 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:00.1041993Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:03 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer206719b0/blob1copy + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-tag-count,x-ms-version-id,x-ms-is-current-version,Content-Type,Content-Language,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-encryption-key-sha256,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-language: + - english + content-length: + - '36' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:49:00 GMT + etag: + - '"0x8D89642E96B1449"' + last-modified: + - Tue, 01 Dec 2020 21:49:00 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: + - Tue, 01 Dec 2020 21:49:00 GMT + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:49:00 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-tag-count: + - '1' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:00.1041993Z' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_source_and_destination_properties.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_source_and_destination_properties.yaml new file mode 100644 index 000000000000..ef1c3f241923 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_source_and_destination_properties.yaml @@ -0,0 +1,462 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:19 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:49:16 GMT + etag: + - '"0x8D89642F33597BA"' + last-modified: + - Tue, 01 Dec 2020 21:49:16 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: This is test data to be copied over. + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-access-tier: + - Cool + x-ms-blob-content-disposition: + - inline + x-ms-blob-content-language: + - spanish + x-ms-blob-content-type: + - application/octet-stream + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:19 GMT + x-ms-tags: + - tag1=firsttag&tag2=secondtag&tag3=thirdtag + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob8dea1eed + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + date: + - Tue, 01 Dec 2020 21:49:16 GMT + etag: + - '"0x8D89642F34812FB"' + last-modified: + - Tue, 01 Dec 2020 21:49:16 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:16.6520059Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:19 GMT + x-ms-lease-action: + - acquire + x-ms-lease-duration: + - '-1' + x-ms-proposed-lease-id: + - a4435183-631a-48cd-a65e-9fc0e030481e + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob8dea1eed?comp=lease + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:49:16 GMT + etag: + - '"0x8D89642F34812FB"' + last-modified: + - Tue, 01 Dec 2020 21:49:16 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-lease-id: + - a4435183-631a-48cd-a65e-9fc0e030481e + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:19 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob8dea1eed + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-tag-count,x-ms-version-id,x-ms-is-current-version,Content-Type,Content-Language,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-lease-duration,x-ms-blob-type,Content-Disposition,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-change-time,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-disposition: + - inline + content-language: + - spanish + content-length: + - '36' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:49:16 GMT + etag: + - '"0x8D89642F34812FB"' + last-modified: + - Tue, 01 Dec 2020 21:49:16 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Cool + x-ms-access-tier-change-time: + - Tue, 01 Dec 2020 21:49:16 GMT + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Tue, 01 Dec 2020 21:49:16 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:49:16 GMT + x-ms-lease-duration: + - infinite + x-ms-lease-state: + - leased + x-ms-lease-status: + - locked + x-ms-server-encrypted: + - 'true' + x-ms-tag-count: + - '3' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:16.6520059Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer8dea1eed/blob8dea1eed?se=2020-12-01T22%3A49%3A19Z&sp=rt&sv=2020-04-08&sr=b&sig=qVwa/XMl9ekx2x4JhgGC2DEcbHFRzj8q7j4UFntCqyg%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:19 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:49:16 GMT + etag: + - '"0x8D89642F3968F72"' + last-modified: + - Tue, 01 Dec 2020 21:49:17 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:17.1663730Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer8dea1eed/blob8dea1eed?se=2020-12-01T22%3A49%3A19Z&sp=rt&sv=2020-04-08&sr=b&sig=qVwa/XMl9ekx2x4JhgGC2DEcbHFRzj8q7j4UFntCqyg%3D + x-ms-copy-source-blob-properties: + - 'false' + x-ms-date: + - Tue, 01 Dec 2020 21:49:20 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob2copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:49:17 GMT + etag: + - '"0x8D89642F3A9CCD3"' + last-modified: + - Tue, 01 Dec 2020 21:49:17 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:17.2924627Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:20 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob1copy + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Content-Language,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,Content-Disposition,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-disposition: + - inline + content-language: + - spanish + content-length: + - '36' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:49:17 GMT + etag: + - '"0x8D89642F3968F72"' + last-modified: + - Tue, 01 Dec 2020 21:49:17 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: + - Tue, 01 Dec 2020 21:49:17 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:49:17 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:17.1663730Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:20 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer8dea1eed/blob2copy + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: + - '36' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:49:17 GMT + etag: + - '"0x8D89642F3A9CCD3"' + last-modified: + - Tue, 01 Dec 2020 21:49:17 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: + - Tue, 01 Dec 2020 21:49:17 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:49:17 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:17.2924627Z' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_cpk.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_cpk.yaml new file mode 100644 index 000000000000..2569e067e186 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_cpk.yaml @@ -0,0 +1,243 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:50 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7ce1476?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:47 GMT + etag: + - '"0x8D89642E2652DEC"' + last-modified: + - Tue, 01 Dec 2020 21:48:48 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: This is test data to be copied over. + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:51 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7ce1476/blob7ce1476 + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + date: + - Tue, 01 Dec 2020 21:48:47 GMT + etag: + - '"0x8D89642E27569BD"' + last-modified: + - Tue, 01 Dec 2020 21:48:48 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:48.4278717Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer7ce1476/blob7ce1476?se=2020-12-01T22%3A48%3A51Z&sp=rt&sv=2020-04-08&sr=b&sig=nXIlekwMEe2ewJc4AorMQoTvpOqffEO/x7/MKnrqf/w%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:51 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7ce1476/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:48 GMT + etag: + - '"0x8D89642E2AA8D28"' + last-modified: + - Tue, 01 Dec 2020 21:48:48 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:48.7761192Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:51 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7ce1476/blob1copy?comp=snapshot + response: + body: + string: "\uFEFFBlobUsesCustomerSpecifiedEncryptionThe + blob is encrypted with customer specified encryption, but it was not provided + in the request.\nRequestId:ca040dbc-a01e-002d-172b-c869b1000000\nTime:2020-12-01T21:48:48.9078953Z" + headers: + content-length: + - '301' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:48:48 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - BlobUsesCustomerSpecifiedEncryption + x-ms-version: + - '2020-04-08' + status: + code: 409 + message: The blob is encrypted with customer specified encryption, but it was + not provided in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:51 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7ce1476/blob1copy?comp=snapshot + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:48 GMT + etag: + - '"0x8D89642E2AA8D28"' + last-modified: + - Tue, 01 Dec 2020 21:48:48 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: + - 'false' + x-ms-snapshot: + - '2020-12-01T21:48:49.0122881Z' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:49.0132881Z' + status: + code: 201 + message: Created +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_existing_blob.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_existing_blob.yaml new file mode 100644 index 000000000000..19f68d330773 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_existing_blob.yaml @@ -0,0 +1,210 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:09 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerebfb18a1?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:06 GMT + etag: + - '"0x8D89642CA041AC3"' + last-modified: + - Tue, 01 Dec 2020 21:48:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: test data + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '9' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:10 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerebfb18a1/blobebfb18a1 + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - 63M6AMDJ0zbmVpGjerVCkw== + date: + - Tue, 01 Dec 2020 21:48:06 GMT + etag: + - '"0x8D89642CA14B203"' + last-modified: + - Tue, 01 Dec 2020 21:48:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - VaiYnK/zyq4= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:07.5287043Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainerebfb18a1/blobebfb18a1?se=2020-12-01T22%3A48%3A10Z&sp=rt&sv=2020-04-08&sr=b&sig=O8b29QU6I7FktawoOuJv0VHSs9LOBCdGON%2BLUpiXA2s%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:10 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerebfb18a1/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:07 GMT + etag: + - '"0x8D89642CA447D5B"' + last-modified: + - Tue, 01 Dec 2020 21:48:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - VaiYnK/zyq4= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:07.8419291Z' + 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.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:10 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/utcontainerebfb18a1/blob1copy + response: + body: + string: test data + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-blob-content-md5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: + - '9' + content-range: + - bytes 0-8/9 + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:48:07 GMT + etag: + - '"0x8D89642CA447D5B"' + last-modified: + - Tue, 01 Dec 2020 21:48:07 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: + - 63M6AMDJ0zbmVpGjerVCkw== + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Tue, 01 Dec 2020 21:48:07 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:48:07 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:07.8419291Z' + status: + code: 206 + message: Partial Content +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_source_content_md5.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_source_content_md5.yaml new file mode 100644 index 000000000000..37afd811f90b --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_source_content_md5.yaml @@ -0,0 +1,329 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:10 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6d931a88?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:49:07 GMT + etag: + - '"0x8D89642EE39074E"' + last-modified: + - Tue, 01 Dec 2020 21:49:08 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: This is test data to be copied over. + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:11 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6d931a88/blob6d931a88 + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + date: + - Tue, 01 Dec 2020 21:49:07 GMT + etag: + - '"0x8D89642EE4915D8"' + last-modified: + - Tue, 01 Dec 2020 21:49:08 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - OIyBbegbJhU= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:08.2700248Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:11 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer6d931a88/blob6d931a88 + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: + - '36' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:49:07 GMT + etag: + - '"0x8D89642EE4915D8"' + last-modified: + - Tue, 01 Dec 2020 21:49:08 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: + - Tue, 01 Dec 2020 21:49:08 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:49:08 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:08.2700248Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer6d931a88/blob6d931a88?se=2020-12-01T22%3A49%3A11Z&sp=rt&sv=2020-04-08&sr=b&sig=a2AaL%2B8LmbBCyBvRHKG68UhXnavJad%2BHpXueY0Xvb8E%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:11 GMT + x-ms-source-content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6d931a88/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + date: + - Tue, 01 Dec 2020 21:49:07 GMT + etag: + - '"0x8D89642EE722936"' + last-modified: + - Tue, 01 Dec 2020 21:49:08 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:08.5392182Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer6d931a88/blob6d931a88?se=2020-12-01T22%3A49%3A11Z&sp=rt&sv=2020-04-08&sr=b&sig=a2AaL%2B8LmbBCyBvRHKG68UhXnavJad%2BHpXueY0Xvb8E%3D + x-ms-copy-source-blob-properties: + - 'false' + x-ms-date: + - Tue, 01 Dec 2020 21:49:11 GMT + x-ms-source-content-md5: + - a1L764HCdlK9fYh44aQr3w== + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6d931a88/blob1copy + response: + body: + string: "\uFEFFMd5MismatchThe + MD5 value specified in the request did not match with the MD5 value calculated + by the server.\nRequestId:947753d4-401e-001a-312b-c8bb1d000000\nTime:2020-12-01T21:49:08.6771575Za1L764HCdlK9fYh44aQr3w==BmRZdU7mXzYVn1nIbsazYg==" + headers: + content-length: + - '405' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:49:08 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - Md5Mismatch + x-ms-version: + - '2020-04-08' + status: + code: 400 + message: The MD5 value specified in the request did not match with the MD5 value + calculated by the server. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:11 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer6d931a88/blob1copy + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: + - '36' + content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:49:08 GMT + etag: + - '"0x8D89642EE722936"' + last-modified: + - Tue, 01 Dec 2020 21:49:08 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: + - Tue, 01 Dec 2020 21:49:08 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:49:08 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:49:08.5392182Z' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_standard_tier_specified.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_standard_tier_specified.yaml new file mode 100644 index 000000000000..0b5b507a70b8 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_url_with_standard_tier_specified.yaml @@ -0,0 +1,212 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:22 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainerf7f71ca7?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:19 GMT + etag: + - '"0x8D89642D15CA400"' + last-modified: + - Tue, 01 Dec 2020 21:48:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:22 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainerf7f71ca7/blobf7f71ca7 + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - 1B2M2Y8AsgTpgAmY7PhCfg== + date: + - Tue, 01 Dec 2020 21:48:19 GMT + etag: + - '"0x8D89642D16E39A3"' + last-modified: + - Tue, 01 Dec 2020 21:48:19 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:19.8594979Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-access-tier: + - Hot + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/testcontainerf7f71ca7/blobf7f71ca7?se=2020-12-01T22%3A48%3A22Z&sp=rt&sv=2020-04-08&sr=b&sig=47p2j0czX55rLheCH2r%2BHUGLqPHebR%2B6DVbNvgsMnpo%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:22 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainerf7f71ca7/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:19 GMT + etag: + - '"0x8D89642D190E324"' + last-modified: + - Tue, 01 Dec 2020 21:48:20 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:20.0866596Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:23 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/testcontainerf7f71ca7/blob1copy + response: + body: + string: '' + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-change-time,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: + - '0' + content-md5: + - 1B2M2Y8AsgTpgAmY7PhCfg== + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:48:19 GMT + etag: + - '"0x8D89642D190E324"' + last-modified: + - Tue, 01 Dec 2020 21:48:20 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: + - Hot + x-ms-access-tier-change-time: + - Tue, 01 Dec 2020 21:48:20 GMT + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Tue, 01 Dec 2020 21:48:20 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:48:20 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:20.0866596Z' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_and_without_overwrite.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_and_without_overwrite.yaml new file mode 100644 index 000000000000..024cd5f5a648 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_and_without_overwrite.yaml @@ -0,0 +1,307 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:47:57 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd34b185f?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:47:54 GMT + etag: + - '"0x8D89642C29C7D1B"' + last-modified: + - Tue, 01 Dec 2020 21:47:54 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: source blob data + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '16' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:47:57 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd34b185f/blobd34b185f + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - 2aOcYFcVKStc87w7K+aH2w== + date: + - Tue, 01 Dec 2020 21:47:55 GMT + etag: + - '"0x8D89642C2AE2F98"' + last-modified: + - Tue, 01 Dec 2020 21:47:55 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - hZmqWo4qMrE= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:47:55.1128472Z' + status: + code: 201 + message: Created +- request: + body: destination blob data + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '21' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:47:58 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd34b185f/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - Bob6mTNI4zhfrgH2joaZxA== + date: + - Tue, 01 Dec 2020 21:47:55 GMT + etag: + - '"0x8D89642C2BE8644"' + last-modified: + - Tue, 01 Dec 2020 21:47:55 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - 4ixHY25Hhu0= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:47:55.2199236Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainerd34b185f/blobd34b185f?se=2020-12-01T22%3A47%3A58Z&sp=rt&sv=2020-04-08&sr=b&sig=Yvzo7hZgtdKZ2EES4uuCTMTQLMncdTIKV%2BojltdOl5o%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:47:58 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd34b185f/blob1copy + response: + body: + string: "\uFEFFBlobAlreadyExistsThe + specified blob already exists.\nRequestId:c6d28fe7-801e-0058-5b2b-c8029d000000\nTime:2020-12-01T21:47:57.0363139Z" + headers: + content-length: + - '220' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:47:56 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - BlobAlreadyExists + x-ms-version: + - '2020-04-08' + status: + code: 409 + message: The specified blob already exists. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainerd34b185f/blobd34b185f?se=2020-12-01T22%3A47%3A58Z&sp=rt&sv=2020-04-08&sr=b&sig=Yvzo7hZgtdKZ2EES4uuCTMTQLMncdTIKV%2BojltdOl5o%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:47:59 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd34b185f/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:47:57 GMT + etag: + - '"0x8D89642C3E49E66"' + last-modified: + - Tue, 01 Dec 2020 21:47:57 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - hZmqWo4qMrE= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:47:57.1482998Z' + 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.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:00 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/utcontainerd34b185f/blob1copy + response: + body: + string: source blob data + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + access-control-expose-headers: + - x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-blob-content-md5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: + - '16' + content-range: + - bytes 0-15/16 + content-type: + - application/octet-stream + date: + - Tue, 01 Dec 2020 21:47:57 GMT + etag: + - '"0x8D89642C3E49E66"' + last-modified: + - Tue, 01 Dec 2020 21:47:57 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: + - 2aOcYFcVKStc87w7K+aH2w== + x-ms-blob-type: + - BlockBlob + x-ms-creation-time: + - Tue, 01 Dec 2020 21:47:57 GMT + x-ms-is-current-version: + - 'true' + x-ms-last-access-time: + - Tue, 01 Dec 2020 21:47:57 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:47:57.1482998Z' + status: + code: 206 + message: Partial Content +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_destination_lease.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_destination_lease.yaml new file mode 100644 index 000000000000..c492bd8442a9 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_with_destination_lease.yaml @@ -0,0 +1,339 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:32 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:29 GMT + etag: + - '"0x8D89642D77939BC"' + last-modified: + - Tue, 01 Dec 2020 21:48:29 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:32 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e/blob7427167e + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - 1B2M2Y8AsgTpgAmY7PhCfg== + date: + - Tue, 01 Dec 2020 21:48:29 GMT + etag: + - '"0x8D89642D78961EA"' + last-modified: + - Tue, 01 Dec 2020 21:48:30 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:30.1038058Z' + status: + code: 201 + message: Created +- request: + body: test + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '4' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:48:33 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + content-md5: + - CY9rzUYh03PK3k6DJie09g== + date: + - Tue, 01 Dec 2020 21:48:29 GMT + etag: + - '"0x8D89642D799DFB4"' + last-modified: + - Tue, 01 Dec 2020 21:48:30 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - Q7G6/s6+u/k= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:30.2118836Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:48:33 GMT + x-ms-lease-action: + - acquire + x-ms-lease-duration: + - '-1' + x-ms-proposed-lease-id: + - 0f7d775f-5eec-4e5a-81da-4116addb338c + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e/blob1copy?comp=lease + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:29 GMT + etag: + - '"0x8D89642D799DFB4"' + last-modified: + - Tue, 01 Dec 2020 21:48:30 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-lease-id: + - 0f7d775f-5eec-4e5a-81da-4116addb338c + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer7427167e/blob7427167e?se=2020-12-01T22%3A48%3A33Z&sp=rt&sv=2020-04-08&sr=b&sig=f1zE79XEiYEmnCP1ctctrHs8VViFnQeyPCSGH9JoDZw%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:33 GMT + x-ms-lease-id: + - baddde9e-8247-4276-8bfa-c7a8081eba1d + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e/blob1copy + response: + body: + string: "\uFEFFLeaseIdMismatchWithBlobOperationThe + lease ID specified did not match the lease ID for the blob.\nRequestId:a522c1b0-201e-008a-362b-c88173000000\nTime:2020-12-01T21:48:30.7144283Z" + headers: + content-length: + - '264' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:48:29 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMismatchWithBlobOperation + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: The lease ID specified did not match the lease ID for the blob. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer7427167e/blob7427167e?se=2020-12-01T22%3A48%3A33Z&sp=rt&sv=2020-04-08&sr=b&sig=f1zE79XEiYEmnCP1ctctrHs8VViFnQeyPCSGH9JoDZw%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:33 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e/blob1copy + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the blob and no lease ID was specified in the request.\nRequestId:a522c1e7-201e-008a-5c2b-c88173000000\nTime:2020-12-01T21:48:30.8285092Z" + headers: + content-length: + - '267' + content-type: + - application/xml + date: + - Tue, 01 Dec 2020 21:48:29 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the blob and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer7427167e/blob7427167e?se=2020-12-01T22%3A48%3A33Z&sp=rt&sv=2020-04-08&sr=b&sig=f1zE79XEiYEmnCP1ctctrHs8VViFnQeyPCSGH9JoDZw%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:48:33 GMT + x-ms-lease-id: + - 0f7d775f-5eec-4e5a-81da-4116addb338c + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer7427167e/blob1copy + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 01 Dec 2020 21:48:29 GMT + etag: + - '"0x8D89642D809A5C6"' + last-modified: + - Tue, 01 Dec 2020 21:48:30 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2020-04-08' + x-ms-version-id: + - '2020-12-01T21:48:30.9454038Z' + status: + code: 201 + message: Created +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_if_match_condition.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_if_match_condition.yaml new file mode 100644 index 000000000000..e6593fccffd1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_if_match_condition.yaml @@ -0,0 +1,395 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:14 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:11 GMT + etag: '"0x8D896431458D3CA"' + last-modified: Tue, 01 Dec 2020 21:50:12 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb?restype=container +- request: + body: null + headers: + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob866c1afb + response: + body: + string: '' + headers: + content-length: '0' + content-md5: 1B2M2Y8AsgTpgAmY7PhCfg== + date: Tue, 01 Dec 2020 21:50:11 GMT + etag: '"0x8D8964314622297"' + last-modified: Tue, 01 Dec 2020 21:50:12 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:12.1876119Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb +- request: + body: fake data + headers: + Content-Length: + - '9' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + content-md5: DHa+SUlusmH+AAI91Dli4g== + date: Tue, 01 Dec 2020 21:50:12 GMT + etag: '"0x8D89643146B9A34"' + last-modified: Tue, 01 Dec 2020 21:50:12 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: i5c8XC72eYw= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:12.2496564Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-Modified-Since: + - Tue, 01 Dec 2020 22:05:15 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: "\uFEFFConditionNotMetThe + condition specified using HTTP conditional header(s) is not met.\nRequestId:5a7471f9-601e-0040-012b-c8ddfa000000\nTime:2020-12-01T21:50:13.2704266Z" + headers: + content-length: '252' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: ConditionNotMet + x-ms-version: '2020-04-08' + status: + code: 412 + message: The condition specified using HTTP conditional header(s) is not met. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-Modified-Since: + - Tue, 01 Dec 2020 21:35:15 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:13 GMT + etag: '"0x8D896431511BC97"' + last-modified: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:13.3394343Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-Unmodified-Since: + - Tue, 01 Dec 2020 21:35:15 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: "\uFEFFConditionNotMetThe + condition specified using HTTP conditional header(s) is not met.\nRequestId:5a74735c-601e-0040-222b-c8ddfa000000\nTime:2020-12-01T21:50:13.4125273Z" + headers: + content-length: '252' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: ConditionNotMet + x-ms-version: '2020-04-08' + status: + code: 412 + message: The condition specified using HTTP conditional header(s) is not met. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-Unmodified-Since: + - Tue, 01 Dec 2020 22:05:15 GMT + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:13 GMT + etag: '"0x8D896431526A7F8"' + last-modified: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:13.4775329Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-source-if-modified-since: + - Tue, 01 Dec 2020 22:05:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: CannotVerifyCopySource + x-ms-version: '2020-04-08' + status: + code: 304 + message: The condition specified using HTTP conditional header(s) is not met. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-source-if-modified-since: + - Tue, 01 Dec 2020 21:35:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:13 GMT + etag: '"0x8D89643154495AA"' + last-modified: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:13.6726714Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-source-if-unmodified-since: + - Tue, 01 Dec 2020 21:35:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: "\uFEFFCannotVerifyCopySourceThe + condition specified using HTTP conditional header(s) is not met.\nRequestId:5a7473c0-601e-0040-762b-c8ddfa000000\nTime:2020-12-01T21:50:13.7357579Z" + headers: + content-length: '259' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: CannotVerifyCopySource + x-ms-version: '2020-04-08' + status: + code: 412 + message: The condition specified using HTTP conditional header(s) is not met. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob866c1afb?se=2020-12-01T22%3A50%3A15Z&sp=rt&sv=2020-04-08&sr=b&sig=uSOLCJYfhG1SmhRcoE0MCX4DoRBAiNPbxs1Ma1JIY1g%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:16 GMT + x-ms-source-if-unmodified-since: + - Tue, 01 Dec 2020 22:05:15 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer866c1afb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:13 GMT + etag: '"0x8D896431557FA24"' + last-modified: Tue, 01 Dec 2020 21:50:13 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:13.7997620Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer866c1afb/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_overwrite_properties.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_overwrite_properties.yaml new file mode 100644 index 000000000000..4a12acba4493 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_overwrite_properties.yaml @@ -0,0 +1,166 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:33 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerc2e51c2d?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:30 GMT + etag: '"0x8D896431F67999A"' + last-modified: Tue, 01 Dec 2020 21:50:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainerc2e51c2d?restype=container +- request: + body: This is test data to be copied over. + headers: + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-content-language: + - spanish + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:33 GMT + x-ms-tags: + - tag1=sourcetag&tag2=secondsourcetag + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerc2e51c2d/blobc2e51c2d + response: + body: + string: '' + headers: + content-length: '0' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + date: Tue, 01 Dec 2020 21:50:30 GMT + etag: '"0x8D896431F725AFE"' + last-modified: Tue, 01 Dec 2020 21:50:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:30.7488510Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainerc2e51c2d/blobc2e51c2d +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-content-language: + - english + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainerc2e51c2d/blobc2e51c2d?se=2020-12-01T22%3A50%3A33Z&sp=rt&sv=2020-04-08&sr=b&sig=NqfbmbI579tX5PLuDWiWtKQ6ZDbHxtOw6WsmHvN9YNA%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:33 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-tags: + - tag1=copytag + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerc2e51c2d/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:30 GMT + etag: '"0x8D896431F8151D2"' + last-modified: Tue, 01 Dec 2020 21:50:30 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-encryption-key-sha256: 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:30.8469202Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainerc2e51c2d/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:33 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainerc2e51c2d/blob1copy + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-tag-count,x-ms-version-id,x-ms-is-current-version,Content-Type,Content-Language,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-encryption-key-sha256,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-language: english + content-length: '36' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:50:30 GMT + etag: '"0x8D896431F8151D2"' + last-modified: Tue, 01 Dec 2020 21:50: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: Tue, 01 Dec 2020 21:50:30 GMT + x-ms-encryption-key-sha256: 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:50:30 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-tag-count: '1' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:30.8469202Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/utcontainerc2e51c2d/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_source_and_destination_properties.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_source_and_destination_properties.yaml new file mode 100644 index 000000000000..b508b38ec3f3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_source_and_destination_properties.yaml @@ -0,0 +1,308 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:49 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:46 GMT + etag: '"0x8D89643294D6B13"' + last-modified: Tue, 01 Dec 2020 21:50:47 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a?restype=container +- request: + body: This is test data to be copied over. + headers: + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-access-tier: + - Cool + x-ms-blob-content-disposition: + - inline + x-ms-blob-content-language: + - spanish + x-ms-blob-content-type: + - application/octet-stream + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-tags: + - tag1=firsttag&tag2=secondtag&tag3=thirdtag + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob50d0216a + response: + body: + string: '' + headers: + content-length: '0' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + date: Tue, 01 Dec 2020 21:50:46 GMT + etag: '"0x8D896432957714E"' + last-modified: Tue, 01 Dec 2020 21:50:47 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:47.3496910Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob50d0216a +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-lease-action: + - acquire + x-ms-lease-duration: + - '-1' + x-ms-proposed-lease-id: + - 2e23e8b3-0cda-4ea3-bf08-0c3277324d21 + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob50d0216a?comp=lease + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:47 GMT + etag: '"0x8D896432957714E"' + last-modified: Tue, 01 Dec 2020 21:50:47 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-lease-id: 2e23e8b3-0cda-4ea3-bf08-0c3277324d21 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob50d0216a?comp=lease +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob50d0216a + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-tag-count,x-ms-version-id,x-ms-is-current-version,Content-Type,Content-Language,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-lease-duration,x-ms-blob-type,Content-Disposition,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-change-time,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-disposition: inline + content-language: spanish + content-length: '36' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:50:47 GMT + etag: '"0x8D896432957714E"' + last-modified: Tue, 01 Dec 2020 21:50:47 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: Cool + x-ms-access-tier-change-time: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-blob-type: BlockBlob + x-ms-creation-time: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-lease-duration: infinite + x-ms-lease-state: leased + x-ms-lease-status: locked + x-ms-server-encrypted: 'true' + x-ms-tag-count: '3' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:47.3496910Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob50d0216a +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob50d0216a?se=2020-12-01T22%3A50%3A50Z&sp=rt&sv=2020-04-08&sr=b&sig=QxtpAOzp9YLwuHO%2BCnt9VbRr/4lO/RRx8dMsu6SCKYM%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:47 GMT + etag: '"0x8D8964329A1F559"' + last-modified: Tue, 01 Dec 2020 21:50:47 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:47.8380377Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob50d0216a?se=2020-12-01T22%3A50%3A50Z&sp=rt&sv=2020-04-08&sr=b&sig=QxtpAOzp9YLwuHO%2BCnt9VbRr/4lO/RRx8dMsu6SCKYM%3D + x-ms-copy-source-blob-properties: + - 'false' + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob2copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:47 GMT + etag: '"0x8D8964329ACA5AF"' + last-modified: Tue, 01 Dec 2020 21:50:47 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:47.9090884Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob2copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob1copy + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Content-Language,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,Content-Disposition,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-disposition: inline + content-language: spanish + content-length: '36' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:50:47 GMT + etag: '"0x8D8964329A1F559"' + last-modified: Tue, 01 Dec 2020 21:50:47 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: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:47.8380377Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:50 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer50d0216a/blob2copy + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: '36' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:50:47 GMT + etag: '"0x8D8964329ACA5AF"' + last-modified: Tue, 01 Dec 2020 21:50:47 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: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:50:47 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:47.9090884Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/utcontainer50d0216a/blob2copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_cpk.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_cpk.yaml new file mode 100644 index 000000000000..181a7768600d --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_cpk.yaml @@ -0,0 +1,171 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:25 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8c7016f3?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:21 GMT + etag: '"0x8D896431A79909E"' + last-modified: Tue, 01 Dec 2020 21:50:22 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer8c7016f3?restype=container +- request: + body: This is test data to be copied over. + headers: + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:25 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8c7016f3/blob8c7016f3 + response: + body: + string: '' + headers: + content-length: '0' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + date: Tue, 01 Dec 2020 21:50:21 GMT + etag: '"0x8D896431A82CA10"' + last-modified: Tue, 01 Dec 2020 21:50:22 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:22.4679440Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer8c7016f3/blob8c7016f3 +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer8c7016f3/blob8c7016f3?se=2020-12-01T22%3A50%3A25Z&sp=rt&sv=2020-04-08&sr=b&sig=vIubiDsSGCqopVd/3b2Ow2nNkmjlbIsWL1DSYMx%2BEYo%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:25 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8c7016f3/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:21 GMT + etag: '"0x8D896431A99636D"' + last-modified: Tue, 01 Dec 2020 21:50:22 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-encryption-key-sha256: 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:22.6160493Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer8c7016f3/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:25 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8c7016f3/blob1copy?comp=snapshot + response: + body: + string: "\uFEFFBlobUsesCustomerSpecifiedEncryptionThe + blob is encrypted with customer specified encryption, but it was not provided + in the request.\nRequestId:5832e890-701e-0011-202b-c84076000000\nTime:2020-12-01T21:50:22.6776811Z" + headers: + content-length: '301' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:22 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: BlobUsesCustomerSpecifiedEncryption + x-ms-version: '2020-04-08' + status: + code: 409 + message: The blob is encrypted with customer specified encryption, but it was + not provided in the request. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer8c7016f3/blob1copy?comp=snapshot +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:25 GMT + x-ms-encryption-algorithm: + - AES256 + x-ms-encryption-key: + - MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc= + x-ms-encryption-key-sha256: + - 3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE= + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8c7016f3/blob1copy?comp=snapshot + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:22 GMT + etag: '"0x8D896431A99636D"' + last-modified: Tue, 01 Dec 2020 21:50:22 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: 'false' + x-ms-snapshot: '2020-12-01T21:50:22.7391351Z' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:22.7401351Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer8c7016f3/blob1copy?comp=snapshot +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_existing_blob.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_existing_blob.yaml new file mode 100644 index 000000000000..3756bad4db13 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_existing_blob.yaml @@ -0,0 +1,145 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:47 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainer898e1b1e?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:49:44 GMT + etag: '"0x8D896430452B35D"' + last-modified: Tue, 01 Dec 2020 21:49:45 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/testcontainer898e1b1e?restype=container +- request: + body: test data + headers: + Content-Length: + - '9' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:48 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainer898e1b1e/blob898e1b1e + response: + body: + string: '' + headers: + content-length: '0' + content-md5: 63M6AMDJ0zbmVpGjerVCkw== + date: Tue, 01 Dec 2020 21:49:44 GMT + etag: '"0x8D89643045C3DCE"' + last-modified: Tue, 01 Dec 2020 21:49:45 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: VaiYnK/zyq4= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:45.3054414Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/testcontainer898e1b1e/blob898e1b1e +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/testcontainer898e1b1e/blob898e1b1e?se=2020-12-01T22%3A49%3A48Z&sp=rt&sv=2020-04-08&sr=b&sig=JL%2BmwmjfpnGGlNkqTuvQ0fEwnNqQQE2F3JhYTdsSqRY%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:48 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainer898e1b1e/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:49:44 GMT + etag: '"0x8D8964304AE8B7A"' + last-modified: Tue, 01 Dec 2020 21:49:45 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: VaiYnK/zyq4= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:45.8448250Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/testcontainer898e1b1e/blob1copy +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:48 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/testcontainer898e1b1e/blob1copy + response: + body: + string: test data + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-blob-content-md5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: '9' + content-range: bytes 0-8/9 + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:49:45 GMT + etag: '"0x8D8964304AE8B7A"' + last-modified: Tue, 01 Dec 2020 21:49:45 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: 63M6AMDJ0zbmVpGjerVCkw== + x-ms-blob-type: BlockBlob + x-ms-creation-time: Tue, 01 Dec 2020 21:49:45 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:49:45 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:45.8448250Z' + status: + code: 206 + message: Partial Content + url: https://seanmcccanary3.blob.core.windows.net/testcontainer898e1b1e/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_source_content_md5.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_source_content_md5.yaml new file mode 100644 index 000000000000..24848cd5dea9 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_source_content_md5.yaml @@ -0,0 +1,224 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:41 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer17971d05?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:39 GMT + etag: '"0x8D89643246A277F"' + last-modified: Tue, 01 Dec 2020 21:50:39 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05?restype=container +- request: + body: This is test data to be copied over. + headers: + Content-Length: + - '36' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:42 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer17971d05/blob17971d05 + response: + body: + string: '' + headers: + content-length: '0' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + date: Tue, 01 Dec 2020 21:50:39 GMT + etag: '"0x8D8964324737B42"' + last-modified: Tue, 01 Dec 2020 21:50:39 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: OIyBbegbJhU= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:39.1448386Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob17971d05 +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:42 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer17971d05/blob17971d05 + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: '36' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:50:39 GMT + etag: '"0x8D8964324737B42"' + last-modified: Tue, 01 Dec 2020 21:50:39 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: Tue, 01 Dec 2020 21:50:39 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:50:39 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:39.1448386Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob17971d05 +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob17971d05?se=2020-12-01T22%3A50%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=up5263CZVhpGvtTbQ64Jig43Nwzc9SFFHtEGmdTy/IM%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:42 GMT + x-ms-source-content-md5: + - BmRZdU7mXzYVn1nIbsazYg== + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer17971d05/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + date: Tue, 01 Dec 2020 21:50:39 GMT + etag: '"0x8D8964324B01A1C"' + last-modified: Tue, 01 Dec 2020 21:50:39 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:39.5421212Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob17971d05?se=2020-12-01T22%3A50%3A42Z&sp=rt&sv=2020-04-08&sr=b&sig=up5263CZVhpGvtTbQ64Jig43Nwzc9SFFHtEGmdTy/IM%3D + x-ms-copy-source-blob-properties: + - 'false' + x-ms-date: + - Tue, 01 Dec 2020 21:50:42 GMT + x-ms-source-content-md5: + - a1L764HCdlK9fYh44aQr3w== + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer17971d05/blob1copy + response: + body: + string: "\uFEFFMd5MismatchThe + MD5 value specified in the request did not match with the MD5 value calculated + by the server.\nRequestId:7c917b16-701e-0073-492c-c88251000000\nTime:2020-12-01T21:50:39.6145503Za1L764HCdlK9fYh44aQr3w==BmRZdU7mXzYVn1nIbsazYg==" + headers: + content-length: '405' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:39 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: Md5Mismatch + x-ms-version: '2020-04-08' + status: + code: 400 + message: The MD5 value specified in the request did not match with the MD5 value + calculated by the server. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:42 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer17971d05/blob1copy + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: '36' + content-md5: BmRZdU7mXzYVn1nIbsazYg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:50:39 GMT + etag: '"0x8D8964324B01A1C"' + last-modified: Tue, 01 Dec 2020 21:50:39 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: Tue, 01 Dec 2020 21:50:39 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:50:39 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:39.5421212Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/utcontainer17971d05/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_standard_tier_specified.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_standard_tier_specified.yaml new file mode 100644 index 000000000000..3f511764c91c --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_url_with_standard_tier_specified.yaml @@ -0,0 +1,144 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:57 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainerae6c1f24?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:49:54 GMT + etag: '"0x8D8964309DBA91D"' + last-modified: Tue, 01 Dec 2020 21:49:54 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/testcontainerae6c1f24?restype=container +- request: + body: null + headers: + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:57 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainerae6c1f24/blobae6c1f24 + response: + body: + string: '' + headers: + content-length: '0' + content-md5: 1B2M2Y8AsgTpgAmY7PhCfg== + date: Tue, 01 Dec 2020 21:49:54 GMT + etag: '"0x8D8964309E4CF2E"' + last-modified: Tue, 01 Dec 2020 21:49:54 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:54.5890606Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/testcontainerae6c1f24/blobae6c1f24 +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-access-tier: + - Hot + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/testcontainerae6c1f24/blobae6c1f24?se=2020-12-01T22%3A49%3A57Z&sp=rt&sv=2020-04-08&sr=b&sig=eJ41KlhOek1NORNMbHsjdFAi5zCXOjPtxfjfLaljswk%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:57 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/testcontainerae6c1f24/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:49:55 GMT + etag: '"0x8D896430A48AC36"' + last-modified: Tue, 01 Dec 2020 21:49:55 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:55.2435254Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/testcontainerae6c1f24/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:58 GMT + x-ms-version: + - '2020-04-08' + method: HEAD + uri: https://storagename.blob.core.windows.net/testcontainerae6c1f24/blob1copy + response: + body: + string: '' + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-change-time,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: '0' + content-md5: 1B2M2Y8AsgTpgAmY7PhCfg== + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:49:55 GMT + etag: '"0x8D896430A48AC36"' + last-modified: Tue, 01 Dec 2020 21:49:55 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-access-tier: Hot + x-ms-access-tier-change-time: Tue, 01 Dec 2020 21:49:55 GMT + x-ms-blob-type: BlockBlob + x-ms-creation-time: Tue, 01 Dec 2020 21:49:55 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:49:55 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:55.2435254Z' + status: + code: 200 + message: OK + url: https://seanmcccanary3.blob.core.windows.net/testcontainerae6c1f24/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_and_without_overwrite.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_and_without_overwrite.yaml new file mode 100644 index 000000000000..426464928588 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_and_without_overwrite.yaml @@ -0,0 +1,216 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:38 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6e611adc?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:49:35 GMT + etag: '"0x8D89642FEA07746"' + last-modified: Tue, 01 Dec 2020 21:49:35 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc?restype=container +- request: + body: source blob data + headers: + Content-Length: + - '16' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:38 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6e611adc/blob6e611adc + response: + body: + string: '' + headers: + content-length: '0' + content-md5: 2aOcYFcVKStc87w7K+aH2w== + date: Tue, 01 Dec 2020 21:49:35 GMT + etag: '"0x8D89642FEAA71D3"' + last-modified: Tue, 01 Dec 2020 21:49:35 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: hZmqWo4qMrE= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:35.7516243Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob6e611adc +- request: + body: destination blob data + headers: + Content-Length: + - '21' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:49:38 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6e611adc/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + content-md5: Bob6mTNI4zhfrgH2joaZxA== + date: Tue, 01 Dec 2020 21:49:35 GMT + etag: '"0x8D89642FEB3C24E"' + last-modified: Tue, 01 Dec 2020 21:49:35 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: 4ixHY25Hhu0= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:35.8126670Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob6e611adc?se=2020-12-01T22%3A49%3A38Z&sp=rt&sv=2020-04-08&sr=b&sig=/1U/gVCUlUx1zGcFnNh/c6msb/zKx2ZROR61/q%2B62y0%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:38 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6e611adc/blob1copy + response: + body: + string: "\uFEFFBlobAlreadyExistsThe + specified blob already exists.\nRequestId:1427365c-c01e-0092-492b-c85e14000000\nTime:2020-12-01T21:49:36.9551371Z" + headers: + content-length: '220' + content-type: application/xml + date: Tue, 01 Dec 2020 21:49:36 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: BlobAlreadyExists + x-ms-version: '2020-04-08' + status: + code: 409 + message: The specified blob already exists. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob6e611adc?se=2020-12-01T22%3A49%3A38Z&sp=rt&sv=2020-04-08&sr=b&sig=/1U/gVCUlUx1zGcFnNh/c6msb/zKx2ZROR61/q%2B62y0%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:49:39 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer6e611adc/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:49:36 GMT + etag: '"0x8D89642FF6C37A2"' + last-modified: Tue, 01 Dec 2020 21:49:37 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: hZmqWo4qMrE= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:37.0225330Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob1copy +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:49:39 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.blob.core.windows.net/utcontainer6e611adc/blob1copy + response: + body: + string: source blob data + headers: + accept-ranges: bytes + access-control-allow-origin: '*' + access-control-expose-headers: x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-blob-content-md5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,Accept-Ranges,x-ms-last-access-time,Content-Length,Date,Transfer-Encoding + content-length: '16' + content-range: bytes 0-15/16 + content-type: application/octet-stream + date: Tue, 01 Dec 2020 21:49:36 GMT + etag: '"0x8D89642FF6C37A2"' + last-modified: Tue, 01 Dec 2020 21:49:37 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: 2aOcYFcVKStc87w7K+aH2w== + x-ms-blob-type: BlockBlob + x-ms-creation-time: Tue, 01 Dec 2020 21:49:37 GMT + x-ms-is-current-version: 'true' + x-ms-last-access-time: Tue, 01 Dec 2020 21:49:37 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:49:37.0225330Z' + status: + code: 206 + message: Partial Content + url: https://seanmcccanary3.blob.core.windows.net/utcontainer6e611adc/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_destination_lease.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_destination_lease.yaml new file mode 100644 index 000000000000..8061d72cc861 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_with_destination_lease.yaml @@ -0,0 +1,246 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:05 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb?restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:03 GMT + etag: '"0x8D896430F0A5CCB"' + last-modified: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb?restype=container +- request: + body: null + headers: + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:06 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb/blob54918fb + response: + body: + string: '' + headers: + content-length: '0' + content-md5: 1B2M2Y8AsgTpgAmY7PhCfg== + date: Tue, 01 Dec 2020 21:50:03 GMT + etag: '"0x8D896430F140CBB"' + last-modified: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:03.2872635Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob54918fb +- request: + body: test + headers: + Content-Length: + - '4' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Tue, 01 Dec 2020 21:50:06 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + content-md5: CY9rzUYh03PK3k6DJie09g== + date: Tue, 01 Dec 2020 21:50:03 GMT + etag: '"0x8D896430F1DF997"' + last-modified: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: Q7G6/s6+u/k= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:03.3523095Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob1copy +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 01 Dec 2020 21:50:06 GMT + x-ms-lease-action: + - acquire + x-ms-lease-duration: + - '-1' + x-ms-proposed-lease-id: + - 3429b168-6da7-4e7b-9d58-7aaef4fbf97b + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb/blob1copy?comp=lease + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:03 GMT + etag: '"0x8D896430F1DF997"' + last-modified: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-lease-id: 3429b168-6da7-4e7b-9d58-7aaef4fbf97b + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob1copy?comp=lease +- request: + body: null + headers: + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob54918fb?se=2020-12-01T22%3A50%3A06Z&sp=rt&sv=2020-04-08&sr=b&sig=YTLr5XfKTXVSD9n9D5lg0vi4lGzCGsZlAj34LIRSOGI%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:06 GMT + x-ms-lease-id: + - baddde9e-8247-4276-8bfa-c7a8081eba1d + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb/blob1copy + response: + body: + string: "\uFEFFLeaseIdMismatchWithBlobOperationThe + lease ID specified did not match the lease ID for the blob.\nRequestId:d3a8c601-501e-005b-4a2b-c8e3f9000000\nTime:2020-12-01T21:50:03.7791726Z" + headers: + content-length: '264' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: LeaseIdMismatchWithBlobOperation + x-ms-version: '2020-04-08' + status: + code: 412 + message: The lease ID specified did not match the lease ID for the blob. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob54918fb?se=2020-12-01T22%3A50%3A06Z&sp=rt&sv=2020-04-08&sr=b&sig=YTLr5XfKTXVSD9n9D5lg0vi4lGzCGsZlAj34LIRSOGI%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:06 GMT + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb/blob1copy + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the blob and no lease ID was specified in the request.\nRequestId:d3a8c6a3-501e-005b-622b-c8e3f9000000\nTime:2020-12-01T21:50:03.8452196Z" + headers: + content-length: '267' + content-type: application/xml + date: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: LeaseIdMissing + x-ms-version: '2020-04-08' + status: + code: 412 + message: There is currently a lease on the blob and no lease ID was specified + in the request. + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob1copy +- request: + body: null + headers: + Content-Length: + - '0' + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.6.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-copy-source: + - https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob54918fb?se=2020-12-01T22%3A50%3A06Z&sp=rt&sv=2020-04-08&sr=b&sig=YTLr5XfKTXVSD9n9D5lg0vi4lGzCGsZlAj34LIRSOGI%3D + x-ms-copy-source-blob-properties: + - 'true' + x-ms-date: + - Tue, 01 Dec 2020 21:50:06 GMT + x-ms-lease-id: + - 3429b168-6da7-4e7b-9d58-7aaef4fbf97b + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer54918fb/blob1copy + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 01 Dec 2020 21:50:03 GMT + etag: '"0x8D896430F7306E3"' + last-modified: Tue, 01 Dec 2020 21:50:03 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2020-04-08' + x-ms-version-id: '2020-12-01T21:50:03.9117069Z' + status: + code: 201 + message: Created + url: https://seanmcccanary3.blob.core.windows.net/utcontainer54918fb/blob1copy +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_tags.py b/sdk/storage/azure-storage-blob/tests/test_blob_tags.py index 7f84b5c1511e..e166b9cf8103 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_tags.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_tags.py @@ -19,7 +19,7 @@ from _shared.testcase import StorageTestCase, GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from azure.core.exceptions import ( - ResourceExistsError, ResourceModifiedError) + ResourceExistsError, ResourceModifiedError, HttpResponseError) from azure.storage.blob import ( BlobServiceClient, BlobBlock, generate_account_sas, ResourceTypes, AccountSasPermissions, generate_container_sas, @@ -103,6 +103,29 @@ def test_set_blob_tags(self, resource_group, location, storage_account, storage_ # Assert self.assertIsNotNone(resp) + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + def test_set_blob_tags_with_lease(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + blob_client, _ = self._create_block_blob() + lease = blob_client.acquire_lease() + + # Act + blob_tags = {"tag1": "firsttag", "tag2": "secondtag", "tag3": "thirdtag"} + with self.assertRaises(HttpResponseError): + blob_client.set_blob_tags(blob_tags) + blob_client.set_blob_tags(blob_tags, lease=lease) + + blob_client.get_blob_tags() + with self.assertRaises(HttpResponseError): + blob_client.get_blob_tags(lease="'d92e6954-3274-4715-811c-727ca7145303'") + resp = blob_client.get_blob_tags(lease=lease) + + self.assertIsNotNone(resp) + self.assertEqual(len(resp), 3) + + blob_client.delete_blob(lease=lease) + @pytest.mark.playback_test_only @GlobalStorageAccountPreparer() def test_set_blob_tags_for_a_version(self, resource_group, location, storage_account, storage_account_key): @@ -276,8 +299,8 @@ def test_list_blobs_returns_tags(self, resource_group, location, storage_account for key, value in blob.tags.items(): self.assertEqual(tags[key], value) - @GlobalResourceGroupPreparer() - @StorageAccountPreparer(random_name_enabled=True, location="canadacentral", name_prefix='pytagstorage') + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() def test_filter_blobs(self, resource_group, location, storage_account, storage_account_key): self._setup(storage_account, storage_account_key) container_name1 = self._create_container(prefix="container1") @@ -292,7 +315,7 @@ def test_filter_blobs(self, resource_group, location, storage_account, storage_a if self.is_live: sleep(10) - where = "tag1='firsttag'" + where = "tag1='firsttag' and tag2='secondtag'" blob_list = self.bsc.find_blobs_by_tags(filter_expression=where, results_per_page=2).by_page() first_page = next(blob_list) items_on_page1 = list(first_page) @@ -301,6 +324,9 @@ def test_filter_blobs(self, resource_group, location, storage_account, storage_a self.assertEqual(2, len(items_on_page1)) self.assertEqual(2, len(items_on_page2)) + self.assertEqual(len(items_on_page2[0]['tags']), 2) + self.assertEqual(items_on_page2[0]['tags']['tag1'], 'firsttag') + self.assertEqual(items_on_page2[0]['tags']['tag2'], 'secondtag') @pytest.mark.live_test_only @GlobalResourceGroupPreparer() diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_tags_async.py b/sdk/storage/azure-storage-blob/tests/test_blob_tags_async.py index 4d4804c4e41d..755018a18a6c 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_tags_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_tags_async.py @@ -19,7 +19,7 @@ from _shared.testcase import GlobalStorageAccountPreparer, GlobalResourceGroupPreparer from azure.core.exceptions import ( - ResourceExistsError, ResourceModifiedError) + ResourceExistsError, ResourceModifiedError, HttpResponseError) from azure.storage.blob import BlobBlock from azure.storage.blob.aio import BlobServiceClient #------------------------------------------------------------------------------ @@ -93,6 +93,31 @@ async def test_set_blob_tags(self, resource_group, location, storage_account, st # Assert self.assertIsNotNone(resp) + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_set_blob_tags_with_lease(self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + blob_client, _ = await self._create_block_blob() + lease = await blob_client.acquire_lease() + + # Act + blob_tags = {"tag1": "firsttag", "tag2": "secondtag", "tag3": "thirdtag"} + + with self.assertRaises(HttpResponseError): + await blob_client.set_blob_tags(blob_tags) + await blob_client.set_blob_tags(blob_tags, lease=lease) + + await blob_client.get_blob_tags() + with self.assertRaises(HttpResponseError): + await blob_client.get_blob_tags(lease="'d92e6954-3274-4715-811c-727ca7145303'") + resp = await blob_client.get_blob_tags(lease=lease) + + self.assertIsNotNone(resp) + self.assertEqual(len(resp), 3) + + await blob_client.delete_blob(lease=lease) + @pytest.mark.playback_test_only @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test @@ -276,8 +301,8 @@ async def test_list_blobs_returns_tags(self, resource_group, location, storage_a for key, value in blob.tags.items(): self.assertEqual(tags[key], value) - @GlobalResourceGroupPreparer() - @StorageAccountPreparer(random_name_enabled=True, location="canadacentral", name_prefix='pytagstorage') + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test async def test_filter_blobs(self, resource_group, location, storage_account, storage_account_key): await self._setup(storage_account, storage_account_key) @@ -294,7 +319,7 @@ async def test_filter_blobs(self, resource_group, location, storage_account, sto if self.is_live: sleep(10) - where = "tag1='firsttag'" + where = "\"tag1\"='firsttag' and \"tag2\"='secondtag'" blob_list = self.bsc.find_blobs_by_tags(filter_expression=where, results_per_page=2).by_page() first_page = await blob_list.__anext__() items_on_page1 = list() @@ -307,4 +332,7 @@ async def test_filter_blobs(self, resource_group, location, storage_account, sto self.assertEqual(2, len(items_on_page1)) self.assertEqual(2, len(items_on_page2)) + self.assertEqual(len(items_on_page2[0]['tags']), 2) + self.assertEqual(items_on_page2[0]['tags']['tag1'], 'firsttag') + self.assertEqual(items_on_page2[0]['tags']['tag2'], 'secondtag') #------------------------------------------------------------------------------ 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 9424d1e18ce2..778496196ba6 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -7,10 +7,14 @@ # -------------------------------------------------------------------------- import os import unittest +from datetime import datetime, timedelta + import pytest import uuid -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError +from azure.storage.blob._shared.policies import StorageContentValidation + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError, ResourceNotFoundError from azure.storage.blob import ( BlobServiceClient, ContainerClient, @@ -18,7 +22,7 @@ BlobType, ContentSettings, BlobBlock, - StandardBlobTier + StandardBlobTier, generate_blob_sas, BlobSasPermissions, CustomerProvidedEncryptionKey ) from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer @@ -31,7 +35,7 @@ class StorageBlockBlobTest(StorageTestCase): - def _setup(self, storage_account, key): + def _setup(self, storage_account, key, container_name='utcontainer'): # test chunking functionality by reducing the size of each chunk, # otherwise the tests would take too long to execute self.bsc = BlobServiceClient( @@ -41,7 +45,7 @@ def _setup(self, storage_account, key): max_single_put_size=32 * 1024, max_block_size=4 * 1024) self.config = self.bsc._config - self.container_name = self.get_resource_name('utcontainer') + self.container_name = self.get_resource_name(container_name) if self.is_live: self.bsc.create_container(self.container_name) @@ -57,10 +61,10 @@ def _teardown(self, FILE_PATH): def _get_blob_reference(self): return self.get_resource_name(TEST_BLOB_PREFIX) - def _create_blob(self, tags=None): + def _create_blob(self, tags=None, data=b'', **kwargs): blob_name = self._get_blob_reference() blob = self.bsc.get_blob_client(self.container_name, blob_name) - blob.upload_blob(b'', tags=tags) + blob.upload_blob(data, tags=tags, **kwargs) return blob def assertBlobEqual(self, container_name, blob_name, expected_data): @@ -80,6 +84,263 @@ def read(self, count): #--Test cases for block blobs -------------------------------------------- + @GlobalStorageAccountPreparer() + def test_upload_blob_with_and_without_overwrite( + self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + blob = self._create_blob(data=b"source blob data") + # Act + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob.blob_name, sas) + + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob_client.upload_blob(b'destination blob data') + # Assert + with self.assertRaises(ResourceExistsError): + new_blob_client.upload_blob_from_url(source_blob, overwrite=False) + new_blob = new_blob_client.upload_blob_from_url(source_blob, overwrite=True) + self.assertIsNotNone(new_blob) + new_blob_content = new_blob_client.download_blob().readall() + self.assertEqual(new_blob_content, b'source blob data') + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_with_existing_blob( + self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + blob = self._create_blob(data=b"test data") + # Act + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob.blob_name, sas) + + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob = new_blob_client.upload_blob_from_url(source_blob) + # Assert + self.assertIsNotNone(new_blob) + new_blob_content = new_blob_client.download_blob().readall() + self.assertEqual(new_blob_content, b'test data') + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_with_standard_tier_specified( + self, resource_group, location, storage_account, storage_account_key): + # Arrange + self._setup(storage_account, storage_account_key, container_name="testcontainer") + blob = self._create_blob() + self.bsc.get_blob_client(self.container_name, blob.blob_name) + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + # Act + source_blob = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob.blob_name, sas) + + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + blob_tier = StandardBlobTier.Hot + new_blob.upload_blob_from_url(source_blob, standard_blob_tier=blob_tier) + + new_blob_properties = new_blob.get_blob_properties() + + # Assert + self.assertEqual(new_blob_properties.blob_tier, blob_tier) + + @GlobalStorageAccountPreparer() + def test_upload_blob_with_destination_lease( + self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + source_blob = self._create_blob() + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob_client.upload_blob(data="test") + new_blob_lease = new_blob_client.acquire_lease() + with self.assertRaises(HttpResponseError): + new_blob_client.upload_blob_from_url( + source_blob_url, destination_lease="baddde9e-8247-4276-8bfa-c7a8081eba1d", overwrite=True) + with self.assertRaises(HttpResponseError): + new_blob_client.upload_blob_from_url(source_blob_url) + new_blob_client.upload_blob_from_url( + source_blob_url, destination_lease=new_blob_lease) + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_if_match_condition( + self, resource_group, location, storage_account, storage_account_key): + # Act + self._setup(storage_account, storage_account_key) + source_blob = self._create_blob() + early_test_datetime = (datetime.utcnow() - timedelta(minutes=15)) + late_test_datetime = (datetime.utcnow() + timedelta(minutes=15)) + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob_client.upload_blob(data="fake data") + + # Assert + with self.assertRaises(ResourceModifiedError): + new_blob_client.upload_blob_from_url( + source_blob_url, if_modified_since=late_test_datetime, overwrite=True) + new_blob_client.upload_blob_from_url( + source_blob_url, if_modified_since=early_test_datetime, overwrite=True) + with self.assertRaises(ResourceModifiedError): + new_blob_client.upload_blob_from_url( + source_blob_url, if_unmodified_since=early_test_datetime, overwrite=True) + new_blob_client.upload_blob_from_url( + source_blob_url, if_unmodified_since=late_test_datetime, overwrite=True) + with self.assertRaises(ResourceNotFoundError): + new_blob_client.upload_blob_from_url( + source_blob_url, source_if_modified_since=late_test_datetime, overwrite=True) + new_blob_client.upload_blob_from_url( + source_blob_url, source_if_modified_since=early_test_datetime, overwrite=True) + with self.assertRaises(ResourceNotFoundError): + new_blob_client.upload_blob_from_url( + source_blob_url, source_if_unmodified_since=early_test_datetime, overwrite=True) + new_blob_client.upload_blob_from_url( + source_blob_url, source_if_unmodified_since=late_test_datetime, overwrite=True) + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_with_cpk(self, resource_group, location, storage_account, storage_account_key): + # Act + self._setup(storage_account, storage_account_key) + source_blob = self._create_blob(data=b"This is test data to be copied over.") + test_cpk = CustomerProvidedEncryptionKey(key_value="MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc=", + key_hash="3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE=") + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob.upload_blob_from_url( + source_blob_url, include_source_blob_properties=True, cpk=test_cpk) + + # Assert + with self.assertRaises(HttpResponseError): + new_blob.create_snapshot() + new_blob.create_snapshot(cpk=test_cpk) + self.assertIsNotNone(new_blob.create_snapshot) + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_overwrite_properties( + self, resource_group, location, storage_account, storage_account_key): + # Act + self._setup(storage_account, storage_account_key) + source_blob_content_settings = ContentSettings(content_language='spanish') + new_blob_content_settings = ContentSettings(content_language='english') + source_blob_tags = {"tag1": "sourcetag", "tag2": "secondsourcetag"} + new_blob_tags = {"tag1": "copytag"} + new_blob_cpk = CustomerProvidedEncryptionKey(key_value="MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc=", + key_hash="3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE=") + source_blob = self._create_blob( + data=b"This is test data to be copied over.", + tags=source_blob_tags, + content_settings=source_blob_content_settings, + ) + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob.upload_blob_from_url(source_blob_url, + include_source_blob_properties=True, + tags=new_blob_tags, + content_settings=new_blob_content_settings, + cpk=new_blob_cpk) + new_blob_props = new_blob.get_blob_properties(cpk=new_blob_cpk) + + # Assert that source blob properties did not take precedence. + self.assertEqual(new_blob_props.tag_count, 1) + self.assertEqual(new_blob_props.content_settings.content_language, new_blob_content_settings.content_language) + self.assertEqual(new_blob_props.encryption_key_sha256, new_blob_cpk.key_hash) + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_with_source_content_md5( + self, resource_group, location, storage_account, storage_account_key): + # Act + self._setup(storage_account, storage_account_key) + source_blob = self._create_blob(data=b"This is test data to be copied over.") + source_blob_props = source_blob.get_blob_properties() + source_md5 = source_blob_props.content_settings.content_md5 + bad_source_md5 = StorageContentValidation.get_content_md5(b"this is bad data") + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + + # Assert + new_blob.upload_blob_from_url( + source_blob_url, include_source_blob_properties=True, source_content_md5=source_md5) + with self.assertRaises(HttpResponseError): + new_blob.upload_blob_from_url( + source_blob_url, include_source_blob_properties=False, source_content_md5=bad_source_md5) + new_blob_content_md5 = new_blob.get_blob_properties().content_settings.content_md5 + self.assertEqual(new_blob_content_md5, source_md5) + + @GlobalStorageAccountPreparer() + def test_upload_blob_from_url_source_and_destination_properties( + self, resource_group, location, storage_account, storage_account_key): + # Act + self._setup(storage_account, storage_account_key) + content_settings = ContentSettings( + content_type='application/octet-stream', + content_language='spanish', + content_disposition='inline' + ) + source_blob = self._create_blob( + data=b"This is test data to be copied over.", + tags={"tag1": "firsttag", "tag2": "secondtag", "tag3": "thirdtag"}, + content_settings=content_settings, + standard_blob_tier=StandardBlobTier.Cool + ) + source_blob.acquire_lease() + source_blob_props = source_blob.get_blob_properties() + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + + new_blob_copy1 = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob_copy2 = self.bsc.get_blob_client(self.container_name, 'blob2copy') + new_blob_copy1.upload_blob_from_url( + source_blob_url, include_source_blob_properties=True) + new_blob_copy2.upload_blob_from_url( + source_blob_url, include_source_blob_properties=False) + + new_blob_copy1_props = new_blob_copy1.get_blob_properties() + new_blob_copy2_props = new_blob_copy2.get_blob_properties() + + # Assert + self.assertEqual(new_blob_copy1_props.content_settings.content_language, + source_blob_props.content_settings.content_language) + self.assertNotEqual(new_blob_copy2_props.content_settings.content_language, + source_blob_props.content_settings.content_language) + + self.assertEqual(source_blob_props.lease.status, 'locked') + self.assertEqual(new_blob_copy1_props.lease.status, 'unlocked') + self.assertEqual(new_blob_copy2_props.lease.status, 'unlocked') + + self.assertEqual(source_blob_props.blob_tier, 'Cool') + self.assertEqual(new_blob_copy1_props.blob_tier, 'Hot') + self.assertEqual(new_blob_copy2_props.blob_tier, 'Hot') + + self.assertEqual(source_blob_props.tag_count, 3) + self.assertEqual(new_blob_copy1_props.tag_count, None) + self.assertEqual(new_blob_copy2_props.tag_count, None) + @GlobalStorageAccountPreparer() def test_put_block(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 bdfb2e5fc00c..8e39b8122682 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 @@ -12,7 +12,10 @@ import uuid from datetime import datetime, timedelta -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceModifiedError + +from azure.storage.blob._shared.policies import StorageContentValidation + +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 @@ -25,7 +28,7 @@ BlobBlock, StandardBlobTier, generate_blob_sas, - BlobSasPermissions + BlobSasPermissions, CustomerProvidedEncryptionKey ) from azure.storage.blob.aio import ( @@ -52,7 +55,7 @@ async def send(self, request, **config): class StorageBlockBlobTestAsync(AsyncStorageTestCase): #--Helpers----------------------------------------------------------------- - async def _setup(self, storage_account, key): + async def _setup(self, storage_account, key, container_name='utcontainer'): # test chunking functionality by reducing the size of each chunk, # otherwise the tests would take too long to execute self.bsc = BlobServiceClient( @@ -63,7 +66,7 @@ async def _setup(self, storage_account, key): max_block_size=4 * 1024, transport=AiohttpTestTransport()) self.config = self.bsc._config - self.container_name = self.get_resource_name('utcontainer') + self.container_name = self.get_resource_name(container_name) if self.is_live: try: await self.bsc.create_container(self.container_name) @@ -98,10 +101,10 @@ async def _create_source_blob_url_with_special_chars(self, tags=None): ) return BlobClient.from_blob_url(blob.url, credential=sas_token_for_special_chars).url - async def _create_blob(self, tags=None): + async def _create_blob(self, tags=None, data=b'', **kwargs): blob_name = self._get_blob_reference() blob = self.bsc.get_blob_client(self.container_name, blob_name) - await blob.upload_blob(b'', tags=tags) + await blob.upload_blob(data, tags=tags, **kwargs) return blob async def assertBlobEqual(self, container_name, blob_name, expected_data): @@ -122,6 +125,275 @@ def read(self, count): #--Test cases for block blobs -------------------------------------------- + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_with_and_without_overwrite( + self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + blob = await self._create_blob(data=b"source blob data") + # Act + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob.blob_name, sas) + + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + await new_blob_client.upload_blob(b'destination blob data') + # Assert + with self.assertRaises(ResourceExistsError): + await new_blob_client.upload_blob_from_url(source_blob, overwrite=False) + new_blob = await new_blob_client.upload_blob_from_url(source_blob, overwrite=True) + self.assertIsNotNone(new_blob) + new_blob_download = await new_blob_client.download_blob() + new_blob_content = await new_blob_download.readall() + self.assertEqual(new_blob_content, b'source blob data') + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_with_existing_blob( + self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key, container_name="testcontainer") + blob = await self._create_blob(data=b"test data") + # Act + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob.blob_name, sas) + + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob = await new_blob_client.upload_blob_from_url(source_blob) + # Assert + self.assertIsNotNone(new_blob) + downloaded_blob = await new_blob_client.download_blob() + new_blob_content = await downloaded_blob.readall() + self.assertEqual(new_blob_content, b'test data') + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_with_standard_tier_specified( + self, resource_group, location, storage_account, storage_account_key): + # Arrange + await self._setup(storage_account, storage_account_key, container_name="testcontainer") + blob = await self._create_blob() + self.bsc.get_blob_client(self.container_name, blob.blob_name) + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + # Act + source_blob = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, blob.blob_name, sas) + + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + blob_tier = StandardBlobTier.Hot + await new_blob.upload_blob_from_url(source_blob, standard_blob_tier=blob_tier) + + new_blob_properties = await new_blob.get_blob_properties() + + # Assert + self.assertEqual(new_blob_properties.blob_tier, blob_tier) + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_with_destination_lease( + self, resource_group, location, storage_account, storage_account_key): + await self._setup(storage_account, storage_account_key) + source_blob = await self._create_blob() + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + await new_blob_client.upload_blob(data="test") + new_blob_lease = await new_blob_client.acquire_lease() + with self.assertRaises(HttpResponseError): + await new_blob_client.upload_blob_from_url( + source_blob_url, destination_lease="baddde9e-8247-4276-8bfa-c7a8081eba1d", overwrite=True) + with self.assertRaises(HttpResponseError): + await new_blob_client.upload_blob_from_url(source_blob_url) + await new_blob_client.upload_blob_from_url( + source_blob_url, destination_lease=new_blob_lease) + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_if_match_condition( + self, resource_group, location, storage_account, storage_account_key): + # Act + await self._setup(storage_account, storage_account_key) + source_blob = await self._create_blob() + early_test_datetime = (datetime.utcnow() - timedelta(minutes=15)) + late_test_datetime = (datetime.utcnow() + timedelta(minutes=15)) + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob_client = self.bsc.get_blob_client(self.container_name, 'blob1copy') + await new_blob_client.upload_blob(data="fake data") + + # Assert + with self.assertRaises(ResourceModifiedError): + await new_blob_client.upload_blob_from_url( + source_blob_url, if_modified_since=late_test_datetime, overwrite=True) + await new_blob_client.upload_blob_from_url( + source_blob_url, if_modified_since=early_test_datetime, overwrite=True) + with self.assertRaises(ResourceModifiedError): + await new_blob_client.upload_blob_from_url( + source_blob_url, if_unmodified_since=early_test_datetime, overwrite=True) + await new_blob_client.upload_blob_from_url( + source_blob_url, if_unmodified_since=late_test_datetime, overwrite=True) + with self.assertRaises(ResourceNotFoundError): + await new_blob_client.upload_blob_from_url( + source_blob_url, source_if_modified_since=late_test_datetime, overwrite=True) + await new_blob_client.upload_blob_from_url( + source_blob_url, source_if_modified_since=early_test_datetime, overwrite=True) + with self.assertRaises(ResourceNotFoundError): + await new_blob_client.upload_blob_from_url( + source_blob_url, source_if_unmodified_since=early_test_datetime, overwrite=True) + await new_blob_client.upload_blob_from_url( + source_blob_url, source_if_unmodified_since=late_test_datetime, overwrite=True) + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_with_cpk(self, resource_group, location, storage_account, storage_account_key): + # Act + await self._setup(storage_account, storage_account_key) + source_blob = await self._create_blob(data=b"This is test data to be copied over.") + test_cpk = CustomerProvidedEncryptionKey(key_value="MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc=", + key_hash="3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE=") + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + await new_blob.upload_blob_from_url( + source_blob_url, include_source_blob_properties=True, cpk=test_cpk) + + # Assert + with self.assertRaises(HttpResponseError): + await new_blob.create_snapshot() + await new_blob.create_snapshot(cpk=test_cpk) + self.assertIsNotNone(new_blob.create_snapshot) + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_overwrite_properties( + self, resource_group, location, storage_account, storage_account_key): + # Act + await self._setup(storage_account, storage_account_key) + source_blob_content_settings = ContentSettings(content_language='spanish') + new_blob_content_settings = ContentSettings(content_language='english') + source_blob_tags = {"tag1": "sourcetag", "tag2": "secondsourcetag"} + new_blob_tags = {"tag1": "copytag"} + new_blob_cpk = CustomerProvidedEncryptionKey(key_value="MDEyMzQ1NjcwMTIzNDU2NzAxMjM0NTY3MDEyMzQ1Njc=", + key_hash="3QFFFpRA5+XANHqwwbT4yXDmrT/2JaLt/FKHjzhOdoE=") + source_blob = await self._create_blob( + data=b"This is test data to be copied over.", + tags=source_blob_tags, + content_settings=source_blob_content_settings, + ) + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + await new_blob.upload_blob_from_url(source_blob_url, + include_source_blob_properties=True, + tags=new_blob_tags, + content_settings=new_blob_content_settings, + cpk=new_blob_cpk) + new_blob_props = await new_blob.get_blob_properties(cpk=new_blob_cpk) + + # Assert that source blob properties did not take precedence. + self.assertEqual(new_blob_props.tag_count, 1) + self.assertEqual(new_blob_props.content_settings.content_language, new_blob_content_settings.content_language) + self.assertEqual(new_blob_props.encryption_key_sha256, new_blob_cpk.key_hash) + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_with_source_content_md5( + self, resource_group, location, storage_account, storage_account_key): + # Act + await self._setup(storage_account, storage_account_key) + source_blob = await self._create_blob(data=b"This is test data to be copied over.") + source_blob_props = await source_blob.get_blob_properties() + source_md5 = source_blob_props.content_settings.content_md5 + bad_source_md5 = StorageContentValidation.get_content_md5(b"this is bad data") + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + new_blob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + + # Assert + await new_blob.upload_blob_from_url( + source_blob_url, include_source_blob_properties=True, source_content_md5=source_md5) + with self.assertRaises(HttpResponseError): + await new_blob.upload_blob_from_url( + source_blob_url, include_source_blob_properties=False, source_content_md5=bad_source_md5) + new_blob_props = await new_blob.get_blob_properties() + new_blob_content_md5 = new_blob_props.content_settings.content_md5 + self.assertEqual(new_blob_content_md5, source_md5) + + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_upload_blob_from_url_source_and_destination_properties( + self, resource_group, location, storage_account, storage_account_key): + # Act + await self._setup(storage_account, storage_account_key) + content_settings = ContentSettings( + content_type='application/octet-stream', + content_language='spanish', + content_disposition='inline' + ) + source_blob = await self._create_blob( + data=b"This is test data to be copied over.", + tags={"tag1": "firsttag", "tag2": "secondtag", "tag3": "thirdtag"}, + content_settings=content_settings, + standard_blob_tier=StandardBlobTier.Cool + ) + await source_blob.acquire_lease() + source_blob_props = await source_blob.get_blob_properties() + sas = generate_blob_sas(account_name=storage_account.name, account_key=storage_account_key, + container_name=self.container_name, blob_name=source_blob.blob_name, + permission=BlobSasPermissions(read=True), expiry=datetime.utcnow() + timedelta(hours=1)) + source_blob_url = '{0}/{1}/{2}?{3}'.format( + self.account_url(storage_account, "blob"), self.container_name, source_blob.blob_name, sas) + + new_blob_copy1 = self.bsc.get_blob_client(self.container_name, 'blob1copy') + new_blob_copy2 = self.bsc.get_blob_client(self.container_name, 'blob2copy') + await new_blob_copy1.upload_blob_from_url( + source_blob_url, include_source_blob_properties=True) + await new_blob_copy2.upload_blob_from_url( + source_blob_url, include_source_blob_properties=False) + + new_blob_copy1_props = await new_blob_copy1.get_blob_properties() + new_blob_copy2_props = await new_blob_copy2.get_blob_properties() + + # Assert + self.assertEqual(new_blob_copy1_props.content_settings.content_language, + source_blob_props.content_settings.content_language) + self.assertNotEqual(new_blob_copy2_props.content_settings.content_language, + source_blob_props.content_settings.content_language) + + self.assertEqual(source_blob_props.lease.status, 'locked') + self.assertEqual(new_blob_copy1_props.lease.status, 'unlocked') + self.assertEqual(new_blob_copy2_props.lease.status, 'unlocked') + + self.assertEqual(source_blob_props.blob_tier, 'Cool') + self.assertEqual(new_blob_copy1_props.blob_tier, 'Hot') + self.assertEqual(new_blob_copy2_props.blob_tier, 'Hot') + + self.assertEqual(source_blob_props.tag_count, 3) + self.assertEqual(new_blob_copy1_props.tag_count, None) + self.assertEqual(new_blob_copy2_props.tag_count, None) + @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test async def test_put_block(self, resource_group, location, storage_account, storage_account_key): diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/__init__.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/__init__.py index d5a1b769973a..af67e01332f7 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/__init__.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/__init__.py @@ -28,6 +28,7 @@ ShareSmbSettings, SmbMultichannel, ShareProtocolSettings, + ShareProtocols, AccessPolicy, FileSasPermissions, ShareSasPermissions, @@ -37,6 +38,9 @@ HandleItem, ShareAccessTier ) +from ._generated.models import ( + ShareRootSquash +) __version__ = VERSION @@ -63,6 +67,7 @@ 'AccessPolicy', 'FileSasPermissions', 'ShareSasPermissions', + 'ShareProtocols', 'ShareProperties', 'DirectoryProperties', 'FileProperties', @@ -70,6 +75,7 @@ 'Handle', 'NTFSAttributes', 'HandleItem', + 'ShareRootSquash', 'generate_account_sas', 'generate_share_sas', 'generate_file_sas' diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/_azure_file_storage.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/_azure_file_storage.py index 3c52986c52e4..7a681889f122 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/_azure_file_storage.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/_azure_file_storage.py @@ -49,7 +49,7 @@ def __init__(self, version, url, **kwargs): self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-02-10' + self.api_version = '2020-04-08' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/_azure_file_storage_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/_azure_file_storage_async.py index c0fcb43d6368..83264f1daebe 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/_azure_file_storage_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/_azure_file_storage_async.py @@ -50,7 +50,7 @@ def __init__( self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-02-10' + self.api_version = '2020-04-08' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/operations_async/_share_operations_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/operations_async/_share_operations_async.py index 0d95a586306f..8e0bf2e4473c 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/operations_async/_share_operations_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/aio/operations_async/_share_operations_async.py @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config self.restype = "share" - async def create(self, timeout=None, metadata=None, quota=None, access_tier=None, *, cls=None, **kwargs): + async def create(self, timeout=None, metadata=None, quota=None, access_tier=None, enabled_protocols=None, root_squash=None, *, cls=None, **kwargs): """Creates a new share under the specified account. If the share with the same name already exists, the operation fails. @@ -55,6 +55,13 @@ async def create(self, timeout=None, metadata=None, quota=None, access_tier=None values include: 'TransactionOptimized', 'Hot', 'Cool' :type access_tier: str or ~azure.storage.fileshare.models.ShareAccessTier + :param enabled_protocols: Protocols to enable on the share. + :type enabled_protocols: str + :param root_squash: Root squash to set on the share. Only valid for + NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.storage.fileshare.models.ShareRootSquash :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -85,6 +92,10 @@ async def create(self, timeout=None, metadata=None, quota=None, access_tier=None if access_tier is not None: header_parameters['x-ms-access-tier'] = self._serialize.header("access_tier", access_tier, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if enabled_protocols is not None: + header_parameters['x-ms-enabled-protocols'] = self._serialize.header("enabled_protocols", enabled_protocols, 'str') + if root_squash is not None: + header_parameters['x-ms-root-squash'] = self._serialize.header("root_squash", root_squash, 'ShareRootSquash') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -185,6 +196,8 @@ async def get_properties(self, sharesnapshot=None, timeout=None, lease_access_co 'x-ms-access-tier': self._deserialize('str', response.headers.get('x-ms-access-tier')), 'x-ms-access-tier-change-time': self._deserialize('rfc-1123', response.headers.get('x-ms-access-tier-change-time')), 'x-ms-access-tier-transition-state': self._deserialize('str', response.headers.get('x-ms-access-tier-transition-state')), + 'x-ms-enabled-protocols': self._deserialize('str', response.headers.get('x-ms-enabled-protocols')), + 'x-ms-root-squash': self._deserialize(models.ShareRootSquash, response.headers.get('x-ms-root-squash')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -877,7 +890,7 @@ async def get_permission(self, file_permission_key, timeout=None, *, cls=None, * return deserialized get_permission.metadata = {'url': '/{shareName}'} - async def set_properties(self, timeout=None, quota=None, access_tier=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def set_properties(self, timeout=None, quota=None, access_tier=None, root_squash=None, lease_access_conditions=None, *, cls=None, **kwargs): """Sets properties for the specified share. :param timeout: The timeout parameter is expressed in seconds. For @@ -891,6 +904,11 @@ async def set_properties(self, timeout=None, quota=None, access_tier=None, lease values include: 'TransactionOptimized', 'Hot', 'Cool' :type access_tier: str or ~azure.storage.fileshare.models.ShareAccessTier + :param root_squash: Root squash to set on the share. Only valid for + NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.storage.fileshare.models.ShareRootSquash :param lease_access_conditions: Additional parameters for the operation :type lease_access_conditions: @@ -930,6 +948,8 @@ async def set_properties(self, timeout=None, quota=None, access_tier=None, lease header_parameters['x-ms-share-quota'] = self._serialize.header("quota", quota, 'int', minimum=1) if access_tier is not None: header_parameters['x-ms-access-tier'] = self._serialize.header("access_tier", access_tier, 'str') + if root_squash is not None: + header_parameters['x-ms-root-squash'] = self._serialize.header("root_squash", root_squash, 'ShareRootSquash') if lease_id is not None: header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/__init__.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/__init__.py index f431cdd89b51..2919e8ad0418 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/__init__.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/__init__.py @@ -28,9 +28,9 @@ from ._models_py3 import Metrics from ._models_py3 import RetentionPolicy from ._models_py3 import ShareFileRangeList - from ._models_py3 import ShareItem + from ._models_py3 import ShareItemInternal from ._models_py3 import SharePermission - from ._models_py3 import ShareProperties + from ._models_py3 import SharePropertiesInternal from ._models_py3 import ShareProtocolSettings from ._models_py3 import ShareSmbSettings from ._models_py3 import ShareStats @@ -58,9 +58,9 @@ from ._models import Metrics from ._models import RetentionPolicy from ._models import ShareFileRangeList - from ._models import ShareItem + from ._models import ShareItemInternal from ._models import SharePermission - from ._models import ShareProperties + from ._models import SharePropertiesInternal from ._models import ShareProtocolSettings from ._models import ShareSmbSettings from ._models import ShareStats @@ -79,6 +79,7 @@ ListSharesIncludeType, PermissionCopyModeType, ShareAccessTier, + ShareRootSquash, StorageErrorCode, ) @@ -101,9 +102,9 @@ 'Metrics', 'RetentionPolicy', 'ShareFileRangeList', - 'ShareItem', + 'ShareItemInternal', 'SharePermission', - 'ShareProperties', + 'SharePropertiesInternal', 'ShareProtocolSettings', 'ShareSmbSettings', 'ShareStats', @@ -116,6 +117,7 @@ 'LeaseDurationType', 'LeaseStateType', 'LeaseStatusType', + 'ShareRootSquash', 'ShareAccessTier', 'PermissionCopyModeType', 'DeleteSnapshotsOptionType', diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_azure_file_storage_enums.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_azure_file_storage_enums.py index 0835990e4488..fb1c252f022e 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_azure_file_storage_enums.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_azure_file_storage_enums.py @@ -103,6 +103,13 @@ class LeaseStatusType(str, Enum): unlocked = "unlocked" +class ShareRootSquash(str, Enum): + + no_root_squash = "NoRootSquash" + root_squash = "RootSquash" + all_squash = "AllSquash" + + class ShareAccessTier(str, Enum): transaction_optimized = "TransactionOptimized" diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models.py index cc504f8e8de7..08b2bf6c74e4 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models.py @@ -553,7 +553,7 @@ class ListSharesResponse(Model): :param max_results: :type max_results: int :param share_items: - :type share_items: list[~azure.storage.fileshare.models.ShareItem] + :type share_items: list[~azure.storage.fileshare.models.ShareItemInternal] :param next_marker: Required. :type next_marker: str """ @@ -568,7 +568,7 @@ class ListSharesResponse(Model): 'prefix': {'key': 'Prefix', 'type': 'str', 'xml': {'name': 'Prefix'}}, 'marker': {'key': 'Marker', 'type': 'str', 'xml': {'name': 'Marker'}}, 'max_results': {'key': 'MaxResults', 'type': 'int', 'xml': {'name': 'MaxResults'}}, - 'share_items': {'key': 'ShareItems', 'type': '[ShareItem]', 'xml': {'name': 'Shares', 'itemsName': 'Shares', 'wrapped': True}}, + 'share_items': {'key': 'ShareItems', 'type': '[ShareItemInternal]', 'xml': {'name': 'Shares', 'itemsName': 'Shares', 'wrapped': True}}, 'next_marker': {'key': 'NextMarker', 'type': 'str', 'xml': {'name': 'NextMarker'}}, } _xml_map = { @@ -679,7 +679,7 @@ def __init__(self, **kwargs): self.clear_ranges = kwargs.get('clear_ranges', None) -class ShareItem(Model): +class ShareItemInternal(Model): """A listed Azure Storage share item. All required parameters must be populated in order to send to Azure. @@ -693,7 +693,7 @@ class ShareItem(Model): :param version: :type version: str :param properties: Required. - :type properties: ~azure.storage.fileshare.models.ShareProperties + :type properties: ~azure.storage.fileshare.models.SharePropertiesInternal :param metadata: :type metadata: dict[str, str] """ @@ -708,7 +708,7 @@ class ShareItem(Model): 'snapshot': {'key': 'Snapshot', 'type': 'str', 'xml': {'name': 'Snapshot'}}, 'deleted': {'key': 'Deleted', 'type': 'bool', 'xml': {'name': 'Deleted'}}, 'version': {'key': 'Version', 'type': 'str', 'xml': {'name': 'Version'}}, - 'properties': {'key': 'Properties', 'type': 'ShareProperties', 'xml': {'name': 'Properties'}}, + 'properties': {'key': 'Properties', 'type': 'SharePropertiesInternal', 'xml': {'name': 'Properties'}}, 'metadata': {'key': 'Metadata', 'type': '{str}', 'xml': {'name': 'Metadata'}}, } _xml_map = { @@ -716,7 +716,7 @@ class ShareItem(Model): } def __init__(self, **kwargs): - super(ShareItem, self).__init__(**kwargs) + super(ShareItemInternal, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.snapshot = kwargs.get('snapshot', None) self.deleted = kwargs.get('deleted', None) @@ -750,7 +750,7 @@ def __init__(self, **kwargs): self.permission = kwargs.get('permission', None) -class ShareProperties(Model): +class SharePropertiesInternal(Model): """Properties of a share. All required parameters must be populated in order to send to Azure. @@ -787,6 +787,11 @@ class ShareProperties(Model): :param lease_duration: Possible values include: 'infinite', 'fixed' :type lease_duration: str or ~azure.storage.fileshare.models.LeaseDurationType + :param enabled_protocols: + :type enabled_protocols: str + :param root_squash: Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or ~azure.storage.fileshare.models.ShareRootSquash """ _validation = { @@ -811,12 +816,14 @@ class ShareProperties(Model): 'lease_status': {'key': 'LeaseStatus', 'type': 'LeaseStatusType', 'xml': {'name': 'LeaseStatus'}}, 'lease_state': {'key': 'LeaseState', 'type': 'LeaseStateType', 'xml': {'name': 'LeaseState'}}, 'lease_duration': {'key': 'LeaseDuration', 'type': 'LeaseDurationType', 'xml': {'name': 'LeaseDuration'}}, + 'enabled_protocols': {'key': 'EnabledProtocols', 'type': 'str', 'xml': {'name': 'EnabledProtocols'}}, + 'root_squash': {'key': 'RootSquash', 'type': 'ShareRootSquash', 'xml': {'name': 'RootSquash'}}, } _xml_map = { } def __init__(self, **kwargs): - super(ShareProperties, self).__init__(**kwargs) + super(SharePropertiesInternal, self).__init__(**kwargs) self.last_modified = kwargs.get('last_modified', None) self.etag = kwargs.get('etag', None) self.quota = kwargs.get('quota', None) @@ -832,6 +839,8 @@ def __init__(self, **kwargs): self.lease_status = kwargs.get('lease_status', None) self.lease_state = kwargs.get('lease_state', None) self.lease_duration = kwargs.get('lease_duration', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) class ShareProtocolSettings(Model): diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models_py3.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models_py3.py index 6ee27de4a049..52af754c7447 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models_py3.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models_py3.py @@ -553,7 +553,7 @@ class ListSharesResponse(Model): :param max_results: :type max_results: int :param share_items: - :type share_items: list[~azure.storage.fileshare.models.ShareItem] + :type share_items: list[~azure.storage.fileshare.models.ShareItemInternal] :param next_marker: Required. :type next_marker: str """ @@ -568,7 +568,7 @@ class ListSharesResponse(Model): 'prefix': {'key': 'Prefix', 'type': 'str', 'xml': {'name': 'Prefix'}}, 'marker': {'key': 'Marker', 'type': 'str', 'xml': {'name': 'Marker'}}, 'max_results': {'key': 'MaxResults', 'type': 'int', 'xml': {'name': 'MaxResults'}}, - 'share_items': {'key': 'ShareItems', 'type': '[ShareItem]', 'xml': {'name': 'Shares', 'itemsName': 'Shares', 'wrapped': True}}, + 'share_items': {'key': 'ShareItems', 'type': '[ShareItemInternal]', 'xml': {'name': 'Shares', 'itemsName': 'Shares', 'wrapped': True}}, 'next_marker': {'key': 'NextMarker', 'type': 'str', 'xml': {'name': 'NextMarker'}}, } _xml_map = { @@ -679,7 +679,7 @@ def __init__(self, *, ranges=None, clear_ranges=None, **kwargs) -> None: self.clear_ranges = clear_ranges -class ShareItem(Model): +class ShareItemInternal(Model): """A listed Azure Storage share item. All required parameters must be populated in order to send to Azure. @@ -693,7 +693,7 @@ class ShareItem(Model): :param version: :type version: str :param properties: Required. - :type properties: ~azure.storage.fileshare.models.ShareProperties + :type properties: ~azure.storage.fileshare.models.SharePropertiesInternal :param metadata: :type metadata: dict[str, str] """ @@ -708,7 +708,7 @@ class ShareItem(Model): 'snapshot': {'key': 'Snapshot', 'type': 'str', 'xml': {'name': 'Snapshot'}}, 'deleted': {'key': 'Deleted', 'type': 'bool', 'xml': {'name': 'Deleted'}}, 'version': {'key': 'Version', 'type': 'str', 'xml': {'name': 'Version'}}, - 'properties': {'key': 'Properties', 'type': 'ShareProperties', 'xml': {'name': 'Properties'}}, + 'properties': {'key': 'Properties', 'type': 'SharePropertiesInternal', 'xml': {'name': 'Properties'}}, 'metadata': {'key': 'Metadata', 'type': '{str}', 'xml': {'name': 'Metadata'}}, } _xml_map = { @@ -716,7 +716,7 @@ class ShareItem(Model): } def __init__(self, *, name: str, properties, snapshot: str=None, deleted: bool=None, version: str=None, metadata=None, **kwargs) -> None: - super(ShareItem, self).__init__(**kwargs) + super(ShareItemInternal, self).__init__(**kwargs) self.name = name self.snapshot = snapshot self.deleted = deleted @@ -750,7 +750,7 @@ def __init__(self, *, permission: str, **kwargs) -> None: self.permission = permission -class ShareProperties(Model): +class SharePropertiesInternal(Model): """Properties of a share. All required parameters must be populated in order to send to Azure. @@ -787,6 +787,11 @@ class ShareProperties(Model): :param lease_duration: Possible values include: 'infinite', 'fixed' :type lease_duration: str or ~azure.storage.fileshare.models.LeaseDurationType + :param enabled_protocols: + :type enabled_protocols: str + :param root_squash: Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or ~azure.storage.fileshare.models.ShareRootSquash """ _validation = { @@ -811,12 +816,14 @@ class ShareProperties(Model): 'lease_status': {'key': 'LeaseStatus', 'type': 'LeaseStatusType', 'xml': {'name': 'LeaseStatus'}}, 'lease_state': {'key': 'LeaseState', 'type': 'LeaseStateType', 'xml': {'name': 'LeaseState'}}, 'lease_duration': {'key': 'LeaseDuration', 'type': 'LeaseDurationType', 'xml': {'name': 'LeaseDuration'}}, + 'enabled_protocols': {'key': 'EnabledProtocols', 'type': 'str', 'xml': {'name': 'EnabledProtocols'}}, + 'root_squash': {'key': 'RootSquash', 'type': 'ShareRootSquash', 'xml': {'name': 'RootSquash'}}, } _xml_map = { } - def __init__(self, *, last_modified, etag: str, quota: int, provisioned_iops: int=None, provisioned_ingress_mbps: int=None, provisioned_egress_mbps: int=None, next_allowed_quota_downgrade_time=None, deleted_time=None, remaining_retention_days: int=None, access_tier: str=None, access_tier_change_time=None, access_tier_transition_state: str=None, lease_status=None, lease_state=None, lease_duration=None, **kwargs) -> None: - super(ShareProperties, self).__init__(**kwargs) + def __init__(self, *, last_modified, etag: str, quota: int, provisioned_iops: int=None, provisioned_ingress_mbps: int=None, provisioned_egress_mbps: int=None, next_allowed_quota_downgrade_time=None, deleted_time=None, remaining_retention_days: int=None, access_tier: str=None, access_tier_change_time=None, access_tier_transition_state: str=None, lease_status=None, lease_state=None, lease_duration=None, enabled_protocols: str=None, root_squash=None, **kwargs) -> None: + super(SharePropertiesInternal, self).__init__(**kwargs) self.last_modified = last_modified self.etag = etag self.quota = quota @@ -832,6 +839,8 @@ def __init__(self, *, last_modified, etag: str, quota: int, provisioned_iops: in self.lease_status = lease_status self.lease_state = lease_state self.lease_duration = lease_duration + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash class ShareProtocolSettings(Model): diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/operations/_share_operations.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/operations/_share_operations.py index 64cc52ac5761..077dfbe10301 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/operations/_share_operations.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/operations/_share_operations.py @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config self.restype = "share" - def create(self, timeout=None, metadata=None, quota=None, access_tier=None, cls=None, **kwargs): + def create(self, timeout=None, metadata=None, quota=None, access_tier=None, enabled_protocols=None, root_squash=None, cls=None, **kwargs): """Creates a new share under the specified account. If the share with the same name already exists, the operation fails. @@ -55,6 +55,13 @@ def create(self, timeout=None, metadata=None, quota=None, access_tier=None, cls= values include: 'TransactionOptimized', 'Hot', 'Cool' :type access_tier: str or ~azure.storage.fileshare.models.ShareAccessTier + :param enabled_protocols: Protocols to enable on the share. + :type enabled_protocols: str + :param root_squash: Root squash to set on the share. Only valid for + NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.storage.fileshare.models.ShareRootSquash :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -85,6 +92,10 @@ def create(self, timeout=None, metadata=None, quota=None, access_tier=None, cls= if access_tier is not None: header_parameters['x-ms-access-tier'] = self._serialize.header("access_tier", access_tier, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if enabled_protocols is not None: + header_parameters['x-ms-enabled-protocols'] = self._serialize.header("enabled_protocols", enabled_protocols, 'str') + if root_squash is not None: + header_parameters['x-ms-root-squash'] = self._serialize.header("root_squash", root_squash, 'ShareRootSquash') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -185,6 +196,8 @@ def get_properties(self, sharesnapshot=None, timeout=None, lease_access_conditio 'x-ms-access-tier': self._deserialize('str', response.headers.get('x-ms-access-tier')), 'x-ms-access-tier-change-time': self._deserialize('rfc-1123', response.headers.get('x-ms-access-tier-change-time')), 'x-ms-access-tier-transition-state': self._deserialize('str', response.headers.get('x-ms-access-tier-transition-state')), + 'x-ms-enabled-protocols': self._deserialize('str', response.headers.get('x-ms-enabled-protocols')), + 'x-ms-root-squash': self._deserialize(models.ShareRootSquash, response.headers.get('x-ms-root-squash')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -877,7 +890,7 @@ def get_permission(self, file_permission_key, timeout=None, cls=None, **kwargs): return deserialized get_permission.metadata = {'url': '/{shareName}'} - def set_properties(self, timeout=None, quota=None, access_tier=None, lease_access_conditions=None, cls=None, **kwargs): + def set_properties(self, timeout=None, quota=None, access_tier=None, root_squash=None, lease_access_conditions=None, cls=None, **kwargs): """Sets properties for the specified share. :param timeout: The timeout parameter is expressed in seconds. For @@ -891,6 +904,11 @@ def set_properties(self, timeout=None, quota=None, access_tier=None, lease_acces values include: 'TransactionOptimized', 'Hot', 'Cool' :type access_tier: str or ~azure.storage.fileshare.models.ShareAccessTier + :param root_squash: Root squash to set on the share. Only valid for + NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.storage.fileshare.models.ShareRootSquash :param lease_access_conditions: Additional parameters for the operation :type lease_access_conditions: @@ -930,6 +948,8 @@ def set_properties(self, timeout=None, quota=None, access_tier=None, lease_acces header_parameters['x-ms-share-quota'] = self._serialize.header("quota", quota, 'int', minimum=1) if access_tier is not None: header_parameters['x-ms-access-tier'] = self._serialize.header("access_tier", access_tier, 'str') + if root_squash is not None: + header_parameters['x-ms-root-squash'] = self._serialize.header("root_squash", root_squash, 'ShareRootSquash') if lease_id is not None: header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/version.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/version.py index 6ef707dd11c9..61ca5b37e14a 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/version.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2020-02-10" +VERSION = "2020-04-08" diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_models.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_models.py index d7621a6b50d3..e72ffdf3ac74 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_models.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_models.py @@ -6,6 +6,8 @@ # pylint: disable=too-few-public-methods, too-many-instance-attributes # pylint: disable=super-init-not-called, too-many-lines +from enum import Enum + from azure.core.paging import PageIterator from ._parser import _parse_datetime_from_str from ._shared.response_handlers import return_context_and_deserialized, process_storage_error @@ -332,6 +334,10 @@ class ShareProperties(DictMixin): :ivar int remaining_retention_days: To indicate how many remaining days the deleted share will be kept. This is a service returned value, and the value will be set when list shared including deleted ones. + :ivar ~azure.storage.fileshare.models.ShareRootSquash or str root_squash: + Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + :ivar list(str) protocols: + Indicates the protocols enabled on the share. The protocol can be either SMB or NFS. """ def __init__(self, **kwargs): @@ -351,7 +357,9 @@ def __init__(self, **kwargs): self.provisioned_ingress_mbps = kwargs.get('x-ms-share-provisioned-ingress-mbps') self.provisioned_iops = kwargs.get('x-ms-share-provisioned-iops') self.lease = LeaseProperties(**kwargs) - + self.protocols = [protocol.strip() for protocol in kwargs.get('x-ms-enabled-protocols', None).split(',')]\ + if kwargs.get('x-ms-enabled-protocols', None) else None + self.root_squash = kwargs.get('x-ms-root-squash', None) @classmethod def _from_generated(cls, generated): props = cls() @@ -371,6 +379,10 @@ def _from_generated(cls, generated): props.provisioned_ingress_mbps = generated.properties.provisioned_ingress_mbps props.provisioned_iops = generated.properties.provisioned_iops props.lease = LeaseProperties._from_generated(generated) # pylint: disable=protected-access + props.protocols = [protocol.strip() for protocol in generated.properties.enabled_protocols.split(',')]\ + if generated.properties.enabled_protocols else None + props.root_squash = generated.properties.root_squash + return props @@ -706,6 +718,12 @@ def _from_generated(cls, generated): return props +class ShareProtocols(str, Enum): + """Enabled protocols on the share""" + SMB = "SMB" + NFS = "NFS" + + class CopyProperties(DictMixin): """File Copy Properties. diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py index fc02b90481be..d8d7d26f1046 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py @@ -16,6 +16,7 @@ '2019-07-07', '2019-12-12', '2020-02-10', + '2020-04-08' ] diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py index 65dcba747370..9b1a47f829d1 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py @@ -34,6 +34,8 @@ from ._directory_client import ShareDirectoryClient from ._file_client import ShareFileClient from ._lease import ShareLeaseClient +from ._models import ShareProtocols + if TYPE_CHECKING: from ._models import ShareProperties, AccessPolicy @@ -314,6 +316,13 @@ def create_share(self, **kwargs): :keyword int timeout: The timeout parameter is expressed in seconds. + :keyword protocols: + Protocols to enable on the share. Only one protocol can be enabled on the share. + :paramtype protocols: str or ~azure.storage.fileshare.ShareProtocols + :keyword root_squash: + Root squash to set on the share. + Only valid for NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + :paramtype root_squash: str or ~azure.storage.fileshare.ShareRootSquash :returns: Share-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -330,6 +339,12 @@ def create_share(self, **kwargs): quota = kwargs.pop('quota', None) access_tier = kwargs.pop('access_tier', None) timeout = kwargs.pop('timeout', None) + root_squash = kwargs.pop('root_squash', None) + protocols = kwargs.pop('protocols', None) + if protocols and protocols not in ['NFS', 'SMB', ShareProtocols.SMB, ShareProtocols.NFS]: + raise ValueError("The enabled protocol must be set to either SMB or NFS.") + if root_squash and protocols not in ['NFS', ShareProtocols.NFS]: + raise ValueError("The 'root_squash' keyword can only be used on NFS enabled shares.") headers = kwargs.pop('headers', {}) headers.update(add_metadata_headers(metadata)) # type: ignore @@ -339,6 +354,8 @@ def create_share(self, **kwargs): metadata=metadata, quota=quota, access_tier=access_tier, + root_squash=root_squash, + enabled_protocols=protocols, cls=return_response_headers, headers=headers, **kwargs) @@ -509,6 +526,10 @@ def set_share_properties(self, **kwargs): Must be greater than 0, and less than or equal to 5TB. :keyword int timeout: The timeout parameter is expressed in seconds. + :keyword root_squash: + Root squash to set on the share. + Only valid for NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + :paramtype root_squash: str or ~azure.storage.fileshare.ShareRootSquash :returns: Share-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -524,13 +545,15 @@ def set_share_properties(self, **kwargs): timeout = kwargs.pop('timeout', None) access_tier = kwargs.pop('access_tier', None) quota = kwargs.pop('quota', None) - if all(parameter is None for parameter in [access_tier, quota]): + root_squash = kwargs.pop('root_squash', None) + if all(parameter is None for parameter in [access_tier, quota, root_squash]): raise ValueError("set_share_properties should be called with at least one parameter.") try: return self._client.share.set_properties( # type: ignore timeout=timeout, quota=quota, access_tier=access_tier, + root_squash=root_squash, cls=return_response_headers, **kwargs) except StorageErrorException as error: diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py index 966fd55d3533..fd9d92a19e6c 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py @@ -30,7 +30,7 @@ from ._directory_client_async import ShareDirectoryClient from ._file_client_async import ShareFileClient from ..aio._lease_async import ShareLeaseClient - +from .._models import ShareProtocols if TYPE_CHECKING: from .._models import ShareProperties, AccessPolicy @@ -185,6 +185,13 @@ async def create_share(self, **kwargs): :keyword int timeout: The timeout parameter is expressed in seconds. + :keyword protocols: + Protocols to enable on the share. Only one protocol can be enabled on the share. + :paramtype protocols: str or ~azure.storage.fileshare.ShareProtocols + :keyword root_squash: + Root squash to set on the share. + Only valid for NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + :paramtype root_squash: str or ~azure.storage.fileshare.ShareRootSquash :returns: Share-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -201,6 +208,12 @@ async def create_share(self, **kwargs): quota = kwargs.pop('quota', None) access_tier = kwargs.pop('access_tier', None) timeout = kwargs.pop('timeout', None) + root_squash = kwargs.pop('root_squash', None) + protocols = kwargs.pop('protocols', None) + if protocols and protocols not in ['NFS', 'SMB', ShareProtocols.SMB, ShareProtocols.NFS]: + raise ValueError("The enabled protocol must be set to either SMB or NFS.") + if root_squash and protocols not in ['NFS', ShareProtocols.NFS]: + raise ValueError("The 'root_squash' keyword can only be used on NFS enabled shares.") headers = kwargs.pop('headers', {}) headers.update(add_metadata_headers(metadata)) # type: ignore @@ -210,6 +223,8 @@ async def create_share(self, **kwargs): metadata=metadata, quota=quota, access_tier=access_tier, + root_squash=root_squash, + enabled_protocols=protocols, cls=return_response_headers, headers=headers, **kwargs) @@ -378,6 +393,10 @@ async def set_share_properties(self, **kwargs): Must be greater than 0, and less than or equal to 5TB. :keyword int timeout: The timeout parameter is expressed in seconds. + :keyword root_squash: + Root squash to set on the share. + Only valid for NFS shares. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + :paramtype root_squash: str or ~azure.storage.fileshare.ShareRootSquash :returns: Share-updated property dict (Etag and last modified). :rtype: dict(str, Any) @@ -393,13 +412,15 @@ async def set_share_properties(self, **kwargs): timeout = kwargs.pop('timeout', None) access_tier = kwargs.pop('access_tier', None) quota = kwargs.pop('quota', None) - if all(parameter is None for parameter in [access_tier, quota]): + root_squash = kwargs.pop('root_squash', None) + if all(parameter is None for parameter in [access_tier, quota, root_squash]): raise ValueError("set_share_properties should be called with at least one parameter.") try: return await self._client.share.set_properties( # type: ignore timeout=timeout, quota=quota, access_tier=access_tier, + root_squash=root_squash, cls=return_response_headers, **kwargs) except StorageErrorException as error: diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_metadata.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_metadata.yaml index e4ebab379047..41dc19188d41 100644 --- a/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_metadata.yaml +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_metadata.yaml @@ -11,9 +11,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-file-share/12.0.1 Python/3.7.3 (Windows-10-10.0.17763-SP0) + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 15 Jan 2020 23:54:18 GMT + - Fri, 06 Nov 2020 17:30:22 GMT x-ms-meta: - '{''hello'': ''world'', ''number'': ''42''}' x-ms-meta-hello: @@ -21,7 +21,7 @@ interactions: x-ms-meta-number: - '42' x-ms-version: - - '2019-02-02' + - '2020-04-08' method: PUT uri: https://storagename.file.core.windows.net/share70e61121?restype=share response: @@ -31,15 +31,15 @@ interactions: content-length: - '0' date: - - Wed, 15 Jan 2020 23:54:18 GMT + - Fri, 06 Nov 2020 17:30:22 GMT etag: - - '"0x8D79A163C646EB2"' + - '"0x8D88279A3C13C42"' last-modified: - - Wed, 15 Jan 2020 23:54:18 GMT + - Fri, 06 Nov 2020 17:30:22 GMT server: - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2019-02-02' + - '2020-04-08' status: code: 201 message: Created @@ -53,11 +53,11 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-storage-file-share/12.0.1 Python/3.7.3 (Windows-10-10.0.17763-SP0) + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 15 Jan 2020 23:54:18 GMT + - Fri, 06 Nov 2020 17:30:22 GMT x-ms-version: - - '2019-02-02' + - '2020-04-08' method: GET uri: https://storagename.file.core.windows.net/share70e61121?restype=share response: @@ -67,15 +67,19 @@ interactions: content-length: - '0' date: - - Wed, 15 Jan 2020 23:54:18 GMT + - Fri, 06 Nov 2020 17:30:22 GMT etag: - - '"0x8D79A163C646EB2"' + - '"0x8D88279A3C13C42"' last-modified: - - Wed, 15 Jan 2020 23:54:18 GMT + - Fri, 06 Nov 2020 17:30:22 GMT server: - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 vary: - Origin + x-ms-access-tier: + - TransactionOptimized + x-ms-access-tier-change-time: + - Fri, 06 Nov 2020 17:30:22 GMT x-ms-has-immutability-policy: - 'false' x-ms-has-legal-hold: @@ -87,7 +91,7 @@ interactions: x-ms-share-quota: - '5120' x-ms-version: - - '2019-02-02' + - '2020-04-08' status: code: 200 message: OK @@ -101,24 +105,128 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-storage-file-share/12.0.1 Python/3.7.3 (Windows-10-10.0.17763-SP0) + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 15 Jan 2020 23:54:19 GMT + - Fri, 06 Nov 2020 17:30:23 GMT x-ms-version: - - '2019-02-02' + - '2020-04-08' method: GET uri: https://storagename.file.core.windows.net/?include=snapshots&comp=list response: body: string: "\uFEFFshare70e61121Wed, - 15 Jan 2020 23:54:18 GMT\"0x8D79A163C646EB2\"5120share1816f1171Fri, + 11 Sep 2020 00:43:37 GMT\"0x8D855EBB87CFF33\"5120TransactionOptimizedFri, + 11 Sep 2020 00:43:37 GMT$account-encryption-keyfalseshare182b3117dFri, + 11 Sep 2020 00:44:44 GMT\"0x8D855EBE0710239\"5120TransactionOptimizedFri, + 11 Sep 2020 00:44:44 GMT$account-encryption-keyfalseshare336d1532Fri, + 11 Sep 2020 00:02:03 GMT\"0x8D855E5EA1BA89C\"5120TransactionOptimizedFri, + 11 Sep 2020 00:02:03 GMT$account-encryption-keyfalseshare50ad1060Tue, + 29 Sep 2020 22:27:37 GMT\"0x8D864C6DE6E6B78\"5120TransactionOptimizedTue, + 29 Sep 2020 22:27:37 GMT$account-encryption-keyfalseshare602310dcThu, + 10 Sep 2020 23:45:57 GMT\"0x8D855E3AA5BA817\"5120TransactionOptimizedThu, + 10 Sep 2020 23:45:57 GMT$account-encryption-keyfalseshare70e61121Fri, + 06 Nov 2020 17:30:22 GMT\"0x8D88279A3C13C42\"5120TransactionOptimizedFri, + 06 Nov 2020 17:30:22 GMT$account-encryption-keyfalseshare801b1156Thu, + 10 Sep 2020 23:48:33 GMT\"0x8D855E4070545FC\"5120TransactionOptimizedThu, + 10 Sep 2020 23:48:33 GMT$account-encryption-keyfalsesharea7a1477Thu, + 10 Sep 2020 23:48:04 GMT\"0x8D855E3F609C583\"5120TransactionOptimizedThu, + 10 Sep 2020 23:48:04 GMT$account-encryption-keyfalseshareba3e12f12020-09-28T14:03:31.0000000ZMon, + 28 Sep 2020 14:03:31 GMT\"0x8D863B748689793\"5120$account-encryption-keyfalseshareba3e12f1Mon, + 28 Sep 2020 14:03:31 GMT\"0x8D863B748689793\"5120TransactionOptimizedMon, + 28 Sep 2020 14:03:31 GMT$account-encryption-keyfalsesharec80148eFri, + 11 Sep 2020 00:25:51 GMT\"0x8D855E93D722BB0\"5120TransactionOptimizedFri, + 11 Sep 2020 00:03:40 GMT$account-encryption-keyfalsesharecb2f1317Fri, + 11 Sep 2020 00:59:09 GMT\"0x8D855EDE422992F\"5120TransactionOptimizedFri, + 11 Sep 2020 00:59:09 GMT$account-encryption-keyfalsesharee121138eFri, + 11 Sep 2020 00:00:54 GMT\"0x8D855E5C0C0BD1C\"5120TransactionOptimizedFri, + 11 Sep 2020 00:00:53 GMT$account-encryption-keyfalsesharee52d0d77Thu, + 10 Sep 2020 23:47:27 GMT\"0x8D855E3DFBB5CB3\"5120TransactionOptimizedThu, + 10 Sep 2020 23:47:20 GMT$account-encryption-keyfalsesharerestorecb2f1317Thu, + 10 Sep 2020 22:44:32 GMT\"0x8D855DB159313DC\"5120TransactionOptimizedThu, + 10 Sep 2020 22:44:32 GMT$account-encryption-keyfalsesharesamples5Tue, + 15 Sep 2020 19:39:56 GMT\"0x8D859AF1FEB001F\"5120TransactionOptimizedTue, + 15 Sep 2020 19:39:55 GMT$account-encryption-keyfalsesharesamples6Tue, + 15 Sep 2020 19:43:57 GMT\"0x8D859AFAFBA3E88\"5120TransactionOptimizedTue, + 15 Sep 2020 19:43:57 GMT$account-encryption-keyfalsesharesamples7Tue, + 15 Sep 2020 19:44:49 GMT\"0x8D859AFCEB7CC2D\"5120TransactionOptimizedTue, + 15 Sep 2020 19:44:49 GMT$account-encryption-keyfalsetest-share-1200db32-dbe6-47c3-8fdc-badfe55a17f7Wed, + 05 Aug 2020 19:06:51 GMT\"0x8D83972B5D1302D\"5120TransactionOptimizedWed, + 05 Aug 2020 19:06:51 GMT$account-encryption-keyfalsetest-share-1c02c6e2-910b-4118-9cc7-3e906d0f6a31Wed, + 05 Aug 2020 19:06:49 GMT\"0x8D83972B5025718\"5120TransactionOptimizedWed, + 05 Aug 2020 19:06:49 GMT$account-encryption-keyfalsetest-share-22baebbe-ef2b-4735-8a37-d5cfb01e5b3aWed, + 05 Aug 2020 17:24:15 GMT\"0x8D8396460C3E165\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:15 GMT$account-encryption-keyfalsetest-share-26ae488a-f23e-4b65-aa5b-f273d6179074Wed, + 05 Aug 2020 19:06:50 GMT\"0x8D83972B592F011\"5120TransactionOptimizedWed, + 05 Aug 2020 19:06:50 GMT$account-encryption-keyfalsetest-share-49d22d21-4363-478e-8f26-1357ef6bd183Wed, + 05 Aug 2020 17:24:21 GMT\"0x8D8396464063943\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:21 GMT$account-encryption-keyfalsetest-share-56abb3eb-0fe3-47ec-802c-288e9eb1c680Wed, + 05 Aug 2020 17:24:17 GMT\"0x8D8396461D987E1\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:16 GMT$account-encryption-keyfalsetest-share-6ddb1225-7c7a-40c8-9c79-0ade2aedc604Wed, + 05 Aug 2020 17:24:19 GMT\"0x8D83964633A2718\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:19 GMT$account-encryption-keyfalsetest-share-82dc1679-40d4-49f1-adfa-bb6a853a0b52Wed, + 05 Aug 2020 19:06:50 GMT\"0x8D83972B538E3FD\"5120TransactionOptimizedWed, + 05 Aug 2020 19:06:50 GMT$account-encryption-keyfalsetest-share-8903864e-96ec-44f5-8912-837a9f23cbb5Wed, + 05 Aug 2020 00:04:00 GMT\"0x8D838D30E563856\"5120TransactionOptimizedWed, + 05 Aug 2020 00:04:00 GMT$account-encryption-keyfalsetest-share-bc25d6be-e54a-4d6f-9c39-9003c3c9e67aWed, + 05 Aug 2020 17:24:18 GMT\"0x8D8396462815131\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:18 GMT$account-encryption-keyfalsetest-share-d5852df4-944a-48b9-8552-eea5bfd94b6bWed, + 05 Aug 2020 17:24:20 GMT\"0x8D8396463BD465A\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:20 GMT$account-encryption-keyfalsetest-share-fa7d1a1f-d065-4d58-bb12-a59f22106473Wed, + 05 Aug 2020 17:24:18 GMT\"0x8D839646251B45A\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:18 GMT$account-encryption-keyfalsetest-share-fcc35a78-e231-4233-a311-d48ee9bb2df7Wed, + 05 Aug 2020 17:24:16 GMT\"0x8D83964610EBC77\"5120TransactionOptimizedWed, + 05 Aug 2020 17:24:16 GMT$account-encryption-keyfalsetest16185160bFri, + 11 Sep 2020 13:51:30 GMT\"0x8D85659C98711F1\"5120TransactionOptimizedFri, + 11 Sep 2020 13:51:30 GMT$account-encryption-keyfalsetest1bd1a12ddTue, + 29 Sep 2020 22:34:36 GMT\"0x8D864C7D8628CD4\"5120TransactionOptimizedTue, + 29 Sep 2020 22:34:36 GMT$account-encryption-keyfalsetest2bd1a12ddTue, + 29 Sep 2020 22:38:12 GMT\"0x8D864C858E9FC21\"5120TransactionOptimizedTue, + 29 Sep 2020 22:38:12 GMT$account-encryption-keyfalsetest403e0ff4Fri, + 11 Sep 2020 13:48:01 GMT\"0x8D856594D05BB2E\"5120TransactionOptimizedFri, + 11 Sep 2020 13:48:01 GMT$account-encryption-keyfalsetest49161594Fri, + 11 Sep 2020 13:44:29 GMT\"0x8D85658CEB83E6D\"5120TransactionOptimizedFri, + 11 Sep 2020 13:44:29 GMT$account-encryption-keyfalsetest50ad1060Tue, + 29 Sep 2020 22:31:15 GMT\"0x8D864C760543D56\"5120TransactionOptimizedTue, + 29 Sep 2020 22:31:14 GMT$account-encryption-keyfalsetest600515ffFri, + 11 Sep 2020 13:52:29 GMT\"0x8D85659ECC7BFF5\"5120TransactionOptimizedFri, + 11 Sep 2020 13:52:29 GMT$account-encryption-keyfalsetest602310dcFri, + 11 Sep 2020 01:46:55 GMT\"0x8D855F490678FD9\"5120TransactionOptimizedFri, + 11 Sep 2020 01:46:55 GMT$account-encryption-keyfalsetest6185160bFri, + 11 Sep 2020 13:50:04 GMT\"0x8D85659960A4A9F\"5120TransactionOptimizedFri, + 11 Sep 2020 13:50:03 GMT$account-encryption-keyfalsetest801b1156Fri, + 11 Sep 2020 01:43:39 GMT\"0x8D855F41B7485A5\"5120TransactionOptimizedFri, + 11 Sep 2020 01:43:39 GMT$account-encryption-keyfalsetest816f1171Fri, + 11 Sep 2020 01:44:03 GMT\"0x8D855F429A8569E\"5120TransactionOptimizedFri, + 11 Sep 2020 01:44:03 GMT$account-encryption-keyfalsetest82b3117dFri, + 11 Sep 2020 01:44:09 GMT\"0x8D855F42D9DFD7A\"5120TransactionOptimizedFri, + 11 Sep 2020 01:44:09 GMT$account-encryption-keyfalsetest8fc916f4Fri, + 11 Sep 2020 13:48:35 GMT\"0x8D8565961566D0E\"5120TransactionOptimizedFri, + 11 Sep 2020 13:48:35 GMT$account-encryption-keyfalsetesta7a1477Fri, + 11 Sep 2020 01:42:27 GMT\"0x8D855F3F0B3CE4D\"5120TransactionOptimizedFri, + 11 Sep 2020 01:42:27 GMT$account-encryption-keyfalsetestcb2f1317Fri, + 11 Sep 2020 01:35:53 GMT\"0x8D855F305C89D8C\"5120TransactionOptimizedFri, + 11 Sep 2020 01:35:53 GMT$account-encryption-keyfalsetestcf0d1359Fri, + 11 Sep 2020 13:46:53 GMT\"0x8D856592431D1AA\"5120TransactionOptimizedFri, + 11 Sep 2020 13:46:53 GMT$account-encryption-keyfalsetestdfa11382Fri, + 11 Sep 2020 01:43:51 GMT\"0x8D855F422BEA24C\"5120TransactionOptimizedFri, + 11 Sep 2020 01:43:51 GMT$account-encryption-keyfalseteste121138eFri, + 11 Sep 2020 01:43:45 GMT\"0x8D855F41F52C3FB\"5120TransactionOptimizedFri, + 11 Sep 2020 01:43:45 GMT$account-encryption-keyfalseteste52d0d77Fri, + 11 Sep 2020 01:42:19 GMT\"0x8D855F3EC19CB5C\"5120TransactionOptimizedFri, + 11 Sep 2020 01:42:19 GMT$account-encryption-keyfalsetestf3ff13d3Fri, + 11 Sep 2020 13:49:19 GMT\"0x8D856597B1CC145\"5120TransactionOptimizedFri, + 11 Sep 2020 13:49:19 GMT$account-encryption-keyfalsetestf55313eeFri, + 11 Sep 2020 13:53:58 GMT\"0x8D8565A21BA7745\"5120TransactionOptimizedFri, + 11 Sep 2020 13:53:58 GMT$account-encryption-keyfalsetestf69713faFri, + 11 Sep 2020 13:54:36 GMT\"0x8D8565A3813B91A\"5120TransactionOptimizedFri, + 11 Sep 2020 13:54:35 GMT$account-encryption-keyfalse" headers: content-type: - application/xml date: - - Wed, 15 Jan 2020 23:54:19 GMT + - Fri, 06 Nov 2020 17:30:22 GMT server: - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -126,7 +234,7 @@ interactions: vary: - Origin x-ms-version: - - '2019-02-02' + - '2020-04-08' status: code: 200 message: OK @@ -142,13 +250,228 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-file-share/12.0.1 Python/3.7.3 (Windows-10-10.0.17763-SP0) + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 15 Jan 2020 23:54:19 GMT + - Fri, 06 Nov 2020 17:30:23 GMT x-ms-delete-snapshots: - include x-ms-version: - - '2019-02-02' + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share1816f1171?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb59e-401a-0068-1062-b4bc52000000\nTime:2020-11-06T17:30:23.1034670Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:22 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:23 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share182b3117d?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a0-401a-0068-1162-b4bc52000000\nTime:2020-11-06T17:30:23.2835939Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:23 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:23 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share336d1532?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a1-401a-0068-1262-b4bc52000000\nTime:2020-11-06T17:30:23.4627205Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:23 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share50ad1060?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a2-401a-0068-1362-b4bc52000000\nTime:2020-11-06T17:30:23.6098241Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:23 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share602310dc?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a3-401a-0068-1462-b4bc52000000\nTime:2020-11-06T17:30:23.7749408Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:23 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' method: DELETE uri: https://storagename.file.core.windows.net/share70e61121?restype=share response: @@ -158,12 +481,2033 @@ interactions: content-length: - '0' date: - - Wed, 15 Jan 2020 23:54:19 GMT + - Fri, 06 Nov 2020 17:30:23 GMT server: - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2019-02-02' + - '2020-04-08' status: code: 202 message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share801b1156?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a5-401a-0068-1662-b4bc52000000\nTime:2020-11-06T17:30:24.0841590Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:23 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharea7a1477?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a6-401a-0068-1762-b4bc52000000\nTime:2020-11-06T17:30:24.2622855Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:23 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/shareba3e12f1?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a7-401a-0068-1862-b4bc52000000\nTime:2020-11-06T17:30:24.4213981Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:24 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:24 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/shareba3e12f1?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a8-401a-0068-1962-b4bc52000000\nTime:2020-11-06T17:30:24.5955217Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:24 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharec80148e?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5a9-401a-0068-1a62-b4bc52000000\nTime:2020-11-06T17:30:24.7616410Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:24 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharecb2f1317?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ab-401a-0068-1b62-b4bc52000000\nTime:2020-11-06T17:30:24.9327613Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:24 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharee121138e?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ac-401a-0068-1c62-b4bc52000000\nTime:2020-11-06T17:30:25.1148905Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:24 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharee52d0d77?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ad-401a-0068-1d62-b4bc52000000\nTime:2020-11-06T17:30:25.2770042Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharerestorecb2f1317?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ae-401a-0068-1e62-b4bc52000000\nTime:2020-11-06T17:30:25.4521271Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharesamples5?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5af-401a-0068-1f62-b4bc52000000\nTime:2020-11-06T17:30:25.6172438Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:26 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharesamples6?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5b0-401a-0068-2062-b4bc52000000\nTime:2020-11-06T17:30:25.7793580Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:26 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/sharesamples7?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5b1-401a-0068-2162-b4bc52000000\nTime:2020-11-06T17:30:25.9354675Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:26 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-1200db32-dbe6-47c3-8fdc-badfe55a17f7?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5b7-401a-0068-2462-b4bc52000000\nTime:2020-11-06T17:30:26.0975821Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:26 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-1c02c6e2-910b-4118-9cc7-3e906d0f6a31?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5b8-401a-0068-2562-b4bc52000000\nTime:2020-11-06T17:30:26.2526909Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:25 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:26 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-22baebbe-ef2b-4735-8a37-d5cfb01e5b3a?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5b9-401a-0068-2662-b4bc52000000\nTime:2020-11-06T17:30:26.4148055Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:26 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:26 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-26ae488a-f23e-4b65-aa5b-f273d6179074?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ba-401a-0068-2762-b4bc52000000\nTime:2020-11-06T17:30:26.5719162Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:26 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:27 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-49d22d21-4363-478e-8f26-1357ef6bd183?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5bb-401a-0068-2862-b4bc52000000\nTime:2020-11-06T17:30:26.7440370Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:26 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:27 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-56abb3eb-0fe3-47ec-802c-288e9eb1c680?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5bc-401a-0068-2962-b4bc52000000\nTime:2020-11-06T17:30:26.9151579Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:26 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:27 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-6ddb1225-7c7a-40c8-9c79-0ade2aedc604?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5bd-401a-0068-2a62-b4bc52000000\nTime:2020-11-06T17:30:27.1032900Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:26 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:27 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-82dc1679-40d4-49f1-adfa-bb6a853a0b52?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c0-401a-0068-2b62-b4bc52000000\nTime:2020-11-06T17:30:27.2664053Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:26 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:27 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-8903864e-96ec-44f5-8912-837a9f23cbb5?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c2-401a-0068-2c62-b4bc52000000\nTime:2020-11-06T17:30:27.4345233Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:27 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:27 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-bc25d6be-e54a-4d6f-9c39-9003c3c9e67a?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c3-401a-0068-2d62-b4bc52000000\nTime:2020-11-06T17:30:27.5946364Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:27 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:28 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-d5852df4-944a-48b9-8552-eea5bfd94b6b?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c4-401a-0068-2e62-b4bc52000000\nTime:2020-11-06T17:30:27.7507464Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:27 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:28 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-fa7d1a1f-d065-4d58-bb12-a59f22106473?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c5-401a-0068-2f62-b4bc52000000\nTime:2020-11-06T17:30:27.9278711Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:27 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:28 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test-share-fcc35a78-e231-4233-a311-d48ee9bb2df7?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c8-401a-0068-3262-b4bc52000000\nTime:2020-11-06T17:30:28.0689705Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:27 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:28 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test16185160b?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5c9-401a-0068-3362-b4bc52000000\nTime:2020-11-06T17:30:28.2170748Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:27 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:28 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test1bd1a12dd?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ca-401a-0068-3462-b4bc52000000\nTime:2020-11-06T17:30:28.3911974Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:28 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:28 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test2bd1a12dd?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5cb-401a-0068-3562-b4bc52000000\nTime:2020-11-06T17:30:28.5703232Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:28 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:29 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test403e0ff4?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5cc-401a-0068-3662-b4bc52000000\nTime:2020-11-06T17:30:28.7334380Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:28 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:29 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test49161594?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5cd-401a-0068-3762-b4bc52000000\nTime:2020-11-06T17:30:28.8975536Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:28 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:29 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test50ad1060?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5ce-401a-0068-3862-b4bc52000000\nTime:2020-11-06T17:30:29.0936926Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:28 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:29 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test600515ff?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5cf-401a-0068-3962-b4bc52000000\nTime:2020-11-06T17:30:29.2468000Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:28 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:29 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test602310dc?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d0-401a-0068-3a62-b4bc52000000\nTime:2020-11-06T17:30:29.3929025Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:29 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:29 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test6185160b?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d1-401a-0068-3b62-b4bc52000000\nTime:2020-11-06T17:30:29.5930434Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:29 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:30 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test801b1156?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d2-401a-0068-3c62-b4bc52000000\nTime:2020-11-06T17:30:29.7751721Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:29 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:30 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test816f1171?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d4-401a-0068-3d62-b4bc52000000\nTime:2020-11-06T17:30:29.9442912Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:29 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:30 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test82b3117d?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d5-401a-0068-3e62-b4bc52000000\nTime:2020-11-06T17:30:30.0983998Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:29 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:30 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/test8fc916f4?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d6-401a-0068-3f62-b4bc52000000\nTime:2020-11-06T17:30:30.2625149Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:29 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:30 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testa7a1477?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d7-401a-0068-4062-b4bc52000000\nTime:2020-11-06T17:30:30.4376387Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:30 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:30 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testcb2f1317?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d8-401a-0068-4162-b4bc52000000\nTime:2020-11-06T17:30:30.6037557Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:30 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:31 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testcf0d1359?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5d9-401a-0068-4262-b4bc52000000\nTime:2020-11-06T17:30:30.7718741Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:30 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:31 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testdfa11382?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5da-401a-0068-4362-b4bc52000000\nTime:2020-11-06T17:30:30.9580052Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:30 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:31 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/teste121138e?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5db-401a-0068-4462-b4bc52000000\nTime:2020-11-06T17:30:31.1141157Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:30 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:31 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/teste52d0d77?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5dc-401a-0068-4562-b4bc52000000\nTime:2020-11-06T17:30:31.3302701Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:31 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:31 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testf3ff13d3?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5dd-401a-0068-4662-b4bc52000000\nTime:2020-11-06T17:30:31.5784459Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:31 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:32 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testf55313ee?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5de-401a-0068-4762-b4bc52000000\nTime:2020-11-06T17:30:31.7375585Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:31 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 06 Nov 2020 17:30:32 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testf69713fa?restype=share + response: + body: + string: "\uFEFFLeaseIdMissingThere + is currently a lease on the file share and no lease ID was specified in the + request.\nRequestId:db5fb5df-401a-0068-4862-b4bc52000000\nTime:2020-11-06T17:30:31.8996741Z" + headers: + content-length: + - '273' + content-type: + - application/xml + date: + - Fri, 06 Nov 2020 17:30:31 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + x-ms-error-code: + - LeaseIdMissing + x-ms-version: + - '2020-04-08' + status: + code: 412 + message: There is currently a lease on the file share and no lease ID was specified + in the request. version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_protocol.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_protocol.yaml new file mode 100644 index 000000000000..ff99364f86b9 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_create_share_with_protocol.yaml @@ -0,0 +1,190 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:44 GMT + x-ms-enabled-protocols: + - NFS + x-ms-root-squash: + - RootSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/testshare271cd1152?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:44 GMT + etag: + - '"0x8D888221607DB9F"' + last-modified: + - Fri, 13 Nov 2020 22:18:45 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:44 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/testshare271cd1152?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:44 GMT + etag: + - '"0x8D888221607DB9F"' + last-modified: + - Fri, 13 Nov 2020 22:18:45 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-access-tier: + - Premium + x-ms-enabled-protocols: + - NFS + x-ms-has-immutability-policy: + - 'false' + x-ms-has-legal-hold: + - 'false' + x-ms-root-squash: + - RootSquash + x-ms-share-next-allowed-quota-downgrade-time: + - Fri, 13 Nov 2020 22:18:45 GMT + x-ms-share-provisioned-egress-mbps: + - '66' + x-ms-share-provisioned-ingress-mbps: + - '44' + x-ms-share-provisioned-iops: + - '500' + x-ms-share-quota: + - '100' + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:44 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/testshare271cd1152?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:44 GMT + etag: + - '"0x8D888221607DB9F"' + last-modified: + - Fri, 13 Nov 2020 22:18:45 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-access-tier: + - Premium + x-ms-enabled-protocols: + - NFS + x-ms-has-immutability-policy: + - 'false' + x-ms-has-legal-hold: + - 'false' + x-ms-root-squash: + - RootSquash + x-ms-share-next-allowed-quota-downgrade-time: + - Fri, 13 Nov 2020 22:18:45 GMT + x-ms-share-provisioned-egress-mbps: + - '66' + x-ms-share-provisioned-ingress-mbps: + - '44' + x-ms-share-provisioned-iops: + - '500' + x-ms-share-quota: + - '100' + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:44 GMT + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testshare271cd1152?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:44 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 202 + message: Accepted +version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_list_shares_with_root_squash_and_protocols.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_list_shares_with_root_squash_and_protocols.yaml new file mode 100644 index 000000000000..19ffed122290 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_list_shares_with_root_squash_and_protocols.yaml @@ -0,0 +1,236 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:21:06 GMT + x-ms-enabled-protocols: + - NFS + x-ms-root-squash: + - AllSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/testshare1c4ad1829?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:21:07 GMT + etag: + - '"0x8D888226AFCADD2"' + last-modified: + - Fri, 13 Nov 2020 22:21:07 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:21:07 GMT + x-ms-enabled-protocols: + - SMB + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/testshare2c4ad1829?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:21:07 GMT + etag: + - '"0x8D888226B1C22A1"' + last-modified: + - Fri, 13 Nov 2020 22:21:08 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:21:07 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/?include=&comp=list + response: + body: + string: "\uFEFFtestshare1c4ad1829Fri, + 13 Nov 2020 22:21:07 GMT\"0x8D888226AFCADD2\"100NFSAllSquashPremium5004466Fri, + 13 Nov 2020 22:21:07 GMT$account-encryption-keyfalsetestshare2c4ad1829Fri, + 13 Nov 2020 22:21:08 GMT\"0x8D888226B1C22A1\"100SMBPremium5004466Fri, + 13 Nov 2020 22:21:08 GMT$account-encryption-keyfalse" + headers: + content-type: + - application/xml + date: + - Fri, 13 Nov 2020 22:21:07 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:21:07 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/?include=snapshots&comp=list + response: + body: + string: "\uFEFFtestshare1c4ad1829Fri, + 13 Nov 2020 22:21:07 GMT\"0x8D888226AFCADD2\"100NFSAllSquashPremium5004466Fri, + 13 Nov 2020 22:21:07 GMT$account-encryption-keyfalsetestshare2c4ad1829Fri, + 13 Nov 2020 22:21:08 GMT\"0x8D888226B1C22A1\"100SMBPremium5004466Fri, + 13 Nov 2020 22:21:08 GMT$account-encryption-keyfalse" + headers: + content-type: + - application/xml + date: + - Fri, 13 Nov 2020 22:21:07 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:21:07 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testshare1c4ad1829?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:21:07 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:21:07 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testshare2c4ad1829?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:21:07 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 202 + message: Accepted +version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_set_share_properties_with_root_squash.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_set_share_properties_with_root_squash.yaml new file mode 100644 index 000000000000..27acf4b30c10 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share.test_set_share_properties_with_root_squash.yaml @@ -0,0 +1,274 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:53 GMT + x-ms-enabled-protocols: + - NFS + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share1503d161c?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:54 GMT + etag: + - '"0x8D888221BA28AAD"' + last-modified: + - Fri, 13 Nov 2020 22:18:54 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:53 GMT + x-ms-enabled-protocols: + - NFS + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share2503d161c?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:54 GMT + etag: + - '"0x8D888221BC2C301"' + last-modified: + - Fri, 13 Nov 2020 22:18:54 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:54 GMT + x-ms-root-squash: + - NoRootSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share1503d161c?restype=share&comp=properties + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:54 GMT + etag: + - '"0x8D888221BD7F4AB"' + last-modified: + - Fri, 13 Nov 2020 22:18:55 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:54 GMT + x-ms-root-squash: + - RootSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share2503d161c?restype=share&comp=properties + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:54 GMT + etag: + - '"0x8D888221BEA2084"' + last-modified: + - Fri, 13 Nov 2020 22:18:55 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:54 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/share1503d161c?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:54 GMT + etag: + - '"0x8D888221BD7F4AB"' + last-modified: + - Fri, 13 Nov 2020 22:18:55 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-access-tier: + - Premium + x-ms-enabled-protocols: + - NFS + x-ms-has-immutability-policy: + - 'false' + x-ms-has-legal-hold: + - 'false' + x-ms-root-squash: + - NoRootSquash + x-ms-share-next-allowed-quota-downgrade-time: + - Fri, 13 Nov 2020 22:18:54 GMT + x-ms-share-provisioned-egress-mbps: + - '66' + x-ms-share-provisioned-ingress-mbps: + - '44' + x-ms-share-provisioned-iops: + - '500' + x-ms-share-quota: + - '100' + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:54 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/share2503d161c?restype=share + response: + body: + string: '' + headers: + date: + - Fri, 13 Nov 2020 22:18:55 GMT + etag: + - '"0x8D888221BEA2084"' + last-modified: + - Fri, 13 Nov 2020 22:18:55 GMT + server: + - Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-access-tier: + - Premium + x-ms-enabled-protocols: + - NFS + x-ms-has-immutability-policy: + - 'false' + x-ms-has-legal-hold: + - 'false' + x-ms-root-squash: + - RootSquash + x-ms-share-next-allowed-quota-downgrade-time: + - Fri, 13 Nov 2020 22:18:54 GMT + x-ms-share-provisioned-egress-mbps: + - '66' + x-ms-share-provisioned-ingress-mbps: + - '44' + x-ms-share-provisioned-iops: + - '500' + x-ms-share-quota: + - '100' + x-ms-version: + - '2020-04-08' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_create_share_with_protocol.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_create_share_with_protocol.yaml new file mode 100644 index 000000000000..cad0ee53dc3a --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_create_share_with_protocol.yaml @@ -0,0 +1,89 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:04 GMT + x-ms-enabled-protocols: + - NFS + x-ms-root-squash: + - RootSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/testshare2e33413cf?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:05 GMT + etag: '"0x8D88821FE5E635D"' + last-modified: Fri, 13 Nov 2020 22:18:05 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seancanarypremiumfile2.file.core.windows.net/testshare2e33413cf?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:04 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/testshare2e33413cf?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:05 GMT + etag: '"0x8D88821FE5E635D"' + last-modified: Fri, 13 Nov 2020 22:18:05 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-access-tier: Premium + x-ms-enabled-protocols: NFS + x-ms-has-immutability-policy: 'false' + x-ms-has-legal-hold: 'false' + x-ms-root-squash: RootSquash + x-ms-share-next-allowed-quota-downgrade-time: Fri, 13 Nov 2020 22:18:05 GMT + x-ms-share-provisioned-egress-mbps: '66' + x-ms-share-provisioned-ingress-mbps: '44' + x-ms-share-provisioned-iops: '500' + x-ms-share-quota: '100' + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/testshare2e33413cf?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:04 GMT + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testshare2e33413cf?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:05 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 202 + message: Accepted + url: https://seancanarypremiumfile2.file.core.windows.net/testshare2e33413cf?restype=share +version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_list_shares_with_root_squash_and_protocols.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_list_shares_with_root_squash_and_protocols.yaml new file mode 100644 index 000000000000..7f3424c56b7e --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_list_shares_with_root_squash_and_protocols.yaml @@ -0,0 +1,172 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:32 GMT + x-ms-enabled-protocols: + - NFS + x-ms-root-squash: + - AllSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/testshare15df31aa6?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:33 GMT + etag: '"0x8D888220F26CF6C"' + last-modified: Fri, 13 Nov 2020 22:18:33 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seancanarypremiumfile2.file.core.windows.net/testshare15df31aa6?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:32 GMT + x-ms-enabled-protocols: + - SMB + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/testshare25df31aa6?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:33 GMT + etag: '"0x8D888220F38FB50"' + last-modified: Fri, 13 Nov 2020 22:18:33 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seancanarypremiumfile2.file.core.windows.net/testshare25df31aa6?restype=share +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:33 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/?include=&comp=list + response: + body: + string: "\uFEFFtestshare15df31aa6Fri, + 13 Nov 2020 22:18:33 GMT\"0x8D888220F26CF6C\"100NFSAllSquashPremium5004466Fri, + 13 Nov 2020 22:18:33 GMT$account-encryption-keyfalsetestshare25df31aa6Fri, + 13 Nov 2020 22:18:33 GMT\"0x8D888220F38FB50\"100SMBPremium5004466Fri, + 13 Nov 2020 22:18:33 GMT$account-encryption-keyfalse" + headers: + content-type: application/xml + date: Fri, 13 Nov 2020 22:18:33 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/?include=&comp=list +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:33 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/?include=snapshots&comp=list + response: + body: + string: "\uFEFFtestshare15df31aa6Fri, + 13 Nov 2020 22:18:33 GMT\"0x8D888220F26CF6C\"100NFSAllSquashPremium5004466Fri, + 13 Nov 2020 22:18:33 GMT$account-encryption-keyfalsetestshare25df31aa6Fri, + 13 Nov 2020 22:18:33 GMT\"0x8D888220F38FB50\"100SMBPremium5004466Fri, + 13 Nov 2020 22:18:33 GMT$account-encryption-keyfalse" + headers: + content-type: application/xml + date: Fri, 13 Nov 2020 22:18:33 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/?include=snapshots&comp=list +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:33 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testshare15df31aa6?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:33 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 202 + message: Accepted + url: https://seancanarypremiumfile2.file.core.windows.net/testshare15df31aa6?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:33 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/testshare25df31aa6?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:33 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 202 + message: Accepted + url: https://seancanarypremiumfile2.file.core.windows.net/testshare25df31aa6?restype=share +version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_set_share_properties_with_root_squash.yaml b/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_set_share_properties_with_root_squash.yaml new file mode 100644 index 000000000000..6a40cbd9b32a --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tests/recordings/test_share_async.test_set_share_properties_with_root_squash.yaml @@ -0,0 +1,262 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:24 GMT + x-ms-enabled-protocols: + - NFS + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share1dd031899?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + etag: '"0x8D888220A7DB04D"' + last-modified: Fri, 13 Nov 2020 22:18:25 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seancanarypremiumfile2.file.core.windows.net/share1dd031899?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-enabled-protocols: + - NFS + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share2dd031899?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + etag: '"0x8D888220A88AED7"' + last-modified: Fri, 13 Nov 2020 22:18:25 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 201 + message: Created + url: https://seancanarypremiumfile2.file.core.windows.net/share2dd031899?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-root-squash: + - NoRootSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share1dd031899?restype=share&comp=properties + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + etag: '"0x8D888220A94325A"' + last-modified: Fri, 13 Nov 2020 22:18:26 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/share1dd031899?restype=share&comp=properties +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-root-squash: + - RootSquash + x-ms-version: + - '2020-04-08' + method: PUT + uri: https://storagename.file.core.windows.net/share2dd031899?restype=share&comp=properties + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + etag: '"0x8D888220A9DD11B"' + last-modified: Fri, 13 Nov 2020 22:18:26 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/share2dd031899?restype=share&comp=properties +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/share1dd031899?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + etag: '"0x8D888220A94325A"' + last-modified: Fri, 13 Nov 2020 22:18:26 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-access-tier: Premium + x-ms-enabled-protocols: NFS + x-ms-has-immutability-policy: 'false' + x-ms-has-legal-hold: 'false' + x-ms-root-squash: NoRootSquash + x-ms-share-next-allowed-quota-downgrade-time: Fri, 13 Nov 2020 22:18:25 GMT + x-ms-share-provisioned-egress-mbps: '66' + x-ms-share-provisioned-ingress-mbps: '44' + x-ms-share-provisioned-iops: '500' + x-ms-share-quota: '100' + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/share1dd031899?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/share2dd031899?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + etag: '"0x8D888220A9DD11B"' + last-modified: Fri, 13 Nov 2020 22:18:26 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-access-tier: Premium + x-ms-enabled-protocols: NFS + x-ms-has-immutability-policy: 'false' + x-ms-has-legal-hold: 'false' + x-ms-root-squash: RootSquash + x-ms-share-next-allowed-quota-downgrade-time: Fri, 13 Nov 2020 22:18:25 GMT + x-ms-share-provisioned-egress-mbps: '66' + x-ms-share-provisioned-ingress-mbps: '44' + x-ms-share-provisioned-iops: '500' + x-ms-share-quota: '100' + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/share2dd031899?restype=share +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-version: + - '2020-04-08' + method: GET + uri: https://storagename.file.core.windows.net/?include=snapshots&comp=list + response: + body: + string: "\uFEFFshare1dd031899Fri, + 13 Nov 2020 22:18:26 GMT\"0x8D888220A94325A\"100NFSNoRootSquashPremium5004466Fri, + 13 Nov 2020 22:18:25 GMT$account-encryption-keyfalseshare2dd031899Fri, + 13 Nov 2020 22:18:26 GMT\"0x8D888220A9DD11B\"100NFSRootSquashPremium5004466Fri, + 13 Nov 2020 22:18:25 GMT$account-encryption-keyfalse" + headers: + content-type: application/xml + date: Fri, 13 Nov 2020 22:18:25 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 200 + message: OK + url: https://seancanarypremiumfile2.file.core.windows.net/?include=snapshots&comp=list +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share1dd031899?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 202 + message: Accepted + url: https://seancanarypremiumfile2.file.core.windows.net/share1dd031899?restype=share +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-file-share/12.3.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Fri, 13 Nov 2020 22:18:25 GMT + x-ms-delete-snapshots: + - include + x-ms-version: + - '2020-04-08' + method: DELETE + uri: https://storagename.file.core.windows.net/share2dd031899?restype=share + response: + body: + string: '' + headers: + date: Fri, 13 Nov 2020 22:18:25 GMT + server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2020-04-08' + status: + code: 202 + message: Accepted + url: https://seancanarypremiumfile2.file.core.windows.net/share2dd031899?restype=share +version: 1 diff --git a/sdk/storage/azure-storage-file-share/tests/test_share.py b/sdk/storage/azure-storage-file-share/tests/test_share.py index 0e408a125e82..2587ff91b893 100644 --- a/sdk/storage/azure-storage-file-share/tests/test_share.py +++ b/sdk/storage/azure-storage-file-share/tests/test_share.py @@ -25,7 +25,8 @@ ShareDirectoryClient, ShareFileClient, ShareClient, - generate_share_sas) + generate_share_sas, + ShareRootSquash, ShareProtocols) from azure.storage.fileshare._generated.models import DeleteSnapshotsOptionType, ListSharesIncludeType from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer @@ -62,10 +63,10 @@ def _get_share_reference(self, prefix=TEST_SHARE_PREFIX): self.test_shares.append(share_name) return share - def _create_share(self, prefix=TEST_SHARE_PREFIX): + def _create_share(self, prefix=TEST_SHARE_PREFIX, **kwargs): share_client = self._get_share_reference(prefix) try: - share_client.create_share() + share_client.create_share(**kwargs) except: pass return share_client @@ -828,6 +829,65 @@ def test_set_share_properties(self, resource_group, location, storage_account, s self.assertEqual(share2_tier, "Cool") self._delete_shares() + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + def test_create_share_with_protocol(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + + # Act + share_client = self._get_share_reference("testshare2") + with self.assertRaises(ValueError): + share_client.create_share(protocols="SMB", root_squash=ShareRootSquash.all_squash) + share_client.create_share(protocols="NFS", root_squash=ShareRootSquash.root_squash) + share_enabled_protocol = share_client.get_share_properties().protocols + share_root_squash = share_client.get_share_properties().root_squash + + # Assert + self.assertEqual(share_enabled_protocol, ["NFS"]) + self.assertEqual(share_root_squash, ShareRootSquash.root_squash) + share_client.delete_share() + + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + def test_set_share_properties_with_root_squash(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + share1 = self._create_share("share1", protocols=ShareProtocols.NFS) + share2 = self._create_share("share2", protocols=ShareProtocols.NFS) + + share1.set_share_properties(root_squash="NoRootSquash") + share2.set_share_properties(root_squash=ShareRootSquash.root_squash) + + # Act + share1_props = share1.get_share_properties() + share2_props = share2.get_share_properties() + + # # Assert + self.assertEqual(share1_props.root_squash, ShareRootSquash.no_root_squash) + self.assertEqual(share1_props.protocols, ['NFS']) + self.assertEqual(share2_props.root_squash, ShareRootSquash.root_squash) + self.assertEqual(share2_props.protocols, ['NFS']) + + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + def test_list_shares_with_root_squash_and_protocols( + self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + self._create_share(prefix="testshare1", protocols="NFS", root_squash=ShareRootSquash.all_squash) + self._create_share(prefix="testshare2", protocols=ShareProtocols.SMB) + # Act + shares = list(self.fsc.list_shares()) + share1_props = shares[0] + share2_props = shares[1] + + # Assert + self.assertIsNotNone(shares) + self.assertGreaterEqual(len(shares), 2) + self.assertEqual(share1_props.root_squash, ShareRootSquash.all_squash) + self.assertEqual(share1_props.protocols, ["NFS"]) + self.assertEqual(share2_props.root_squash, None) + self.assertEqual(share2_props.protocols, ["SMB"]) + self._delete_shares() + @GlobalResourceGroupPreparer() @StorageAccountPreparer(random_name_enabled=True, sku='premium_LRS', name_prefix='pyacrstorage', kind='FileStorage') def test_get_share_properties_for_premium_account(self, resource_group, location, storage_account, storage_account_key): diff --git a/sdk/storage/azure-storage-file-share/tests/test_share_async.py b/sdk/storage/azure-storage-file-share/tests/test_share_async.py index 8765cee58fca..d9ff6b973d7d 100644 --- a/sdk/storage/azure-storage-file-share/tests/test_share_async.py +++ b/sdk/storage/azure-storage-file-share/tests/test_share_async.py @@ -24,12 +24,13 @@ ShareSasPermissions, ShareAccessTier, generate_share_sas, + ShareRootSquash, ShareProtocols ) from azure.storage.fileshare.aio import ( ShareServiceClient, ShareDirectoryClient, ShareFileClient, - ShareClient + ShareClient, ) from azure.storage.fileshare._generated.models import DeleteSnapshotsOptionType, ListSharesIncludeType from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer @@ -85,10 +86,10 @@ def _get_share_reference(self, prefix=TEST_SHARE_PREFIX): self.test_shares.append(share) return share - async def _create_share(self, prefix=TEST_SHARE_PREFIX): + async def _create_share(self, prefix=TEST_SHARE_PREFIX, **kwargs): share_client = self._get_share_reference(prefix) try: - await share_client.create_share() + await share_client.create_share(**kwargs) except: pass return share_client @@ -907,6 +908,73 @@ async def test_set_share_properties_async(self, resource_group, location, storag self.assertEqual(share2_tier, "Cool") await self._delete_shares() + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_create_share_with_protocol(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + + # Act + share_client = self._get_share_reference("testshare2") + with self.assertRaises(ValueError): + await share_client.create_share(protocols="SMB", root_squash=ShareRootSquash.all_squash) + await share_client.create_share(protocols="NFS", root_squash=ShareRootSquash.root_squash) + props = await share_client.get_share_properties() + share_enabled_protocol = props.protocols + share_root_squash = props.root_squash + + # Assert + self.assertEqual(share_enabled_protocol, ["NFS"]) + self.assertEqual(share_root_squash, ShareRootSquash.root_squash) + await share_client.delete_share() + + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_set_share_properties_with_root_squash(self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + share1 = await self._create_share("share1", protocols=ShareProtocols.NFS) + share2 = await self._create_share("share2", protocols=ShareProtocols.NFS) + + await share1.set_share_properties(root_squash="NoRootSquash") + + await share2.set_share_properties(root_squash=ShareRootSquash.root_squash) + + # Act + props1 = await share1.get_share_properties() + share1_root_squash = props1.root_squash + props2 = await share2.get_share_properties() + share2_root_squash = props2.root_squash + + # Assert + self.assertEqual(share1_root_squash, ShareRootSquash.no_root_squash) + self.assertEqual(share2_root_squash, ShareRootSquash.root_squash) + await self._delete_shares() + + @pytest.mark.playback_test_only + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_list_shares_with_root_squash_and_protocols( + self, resource_group, location, storage_account, storage_account_key): + self._setup(storage_account, storage_account_key) + await self._create_share(prefix="testshare1", protocols="NFS", root_squash=ShareRootSquash.all_squash) + await self._create_share(prefix="testshare2", protocols=ShareProtocols.SMB) + # Act + shares = [] + async for s in self.fsc.list_shares(): + shares.append(s) + share1_props = shares[0] + share2_props = shares[1] + + # Assert + self.assertIsNotNone(shares) + self.assertGreaterEqual(len(shares), 2) + self.assertEqual(share1_props.root_squash, ShareRootSquash.all_squash) + self.assertEqual(share1_props.protocols, ["NFS"]) + self.assertEqual(share2_props.root_squash, None) + self.assertEqual(share2_props.protocols, ["SMB"]) + await self._delete_shares() + @GlobalResourceGroupPreparer() @StorageAccountPreparer(random_name_enabled=True, sku='premium_LRS', name_prefix='pyacrstorage', kind='FileStorage') @AsyncStorageTestCase.await_prepared_test