From c393110b351f1662d86908d2ad145b5287b68e69 Mon Sep 17 00:00:00 2001 From: xiafu Date: Fri, 13 Sep 2019 14:00:18 -0700 Subject: [PATCH 1/4] [BlockBlob][Tier]Add BlobTier Support For CopyBlob/PutBlob/PutBlockList --- .../azure/storage/blob/_upload_helpers.py | 3 + .../azure/storage/blob/aio/_upload_helpers.py | 3 + .../storage/blob/aio/blob_client_async.py | 9 ++ .../blob/aio/container_client_async.py | 8 ++ .../azure/storage/blob/blob_client.py | 23 ++++- .../azure/storage/blob/container_client.py | 8 ++ .../tests/test_block_blob.py | 77 +++++++++++++++ .../tests/test_block_blob_async.py | 98 +++++++++++++++++++ .../tests/test_common_blob.py | 21 +++- .../tests/test_common_blob_async.py | 26 ++++- 10 files changed, 270 insertions(+), 6 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py index d5d430ac200d..2fbaddbf995c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_upload_helpers.py @@ -79,6 +79,7 @@ def upload_block_blob( # pylint: disable=too-many-locals if (encryption_options.get('key') is not None) and (adjusted_count is not None): adjusted_count += (16 - (length % 16)) blob_headers = kwargs.pop('blob_headers', None) + tier = kwargs.pop('standard_blob_tier', None) # Do single put if the size is smaller than config.max_single_put_size if adjusted_count is not None and (adjusted_count < blob_settings.max_single_put_size): @@ -100,6 +101,7 @@ def upload_block_blob( # pylint: disable=too-many-locals validate_content=validate_content, data_stream_total=adjusted_count, upload_stream_current=0, + tier=tier.value if tier else None, **kwargs) use_original_upload_path = blob_settings.use_byte_buffer or \ @@ -145,6 +147,7 @@ def upload_block_blob( # pylint: disable=too-many-locals cls=return_response_headers, validate_content=validate_content, headers=headers, + tier=tier.value if tier else None, **kwargs) except StorageErrorException as error: try: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py index 33a237b112e7..82401aebc213 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_upload_helpers.py @@ -53,6 +53,7 @@ async def upload_block_blob( # pylint: disable=too-many-locals if (encryption_options.get('key') is not None) and (adjusted_count is not None): adjusted_count += (16 - (length % 16)) blob_headers = kwargs.pop('blob_headers', None) + tier = kwargs.pop('standard_blob_tier', None) # Do single put if the size is smaller than config.max_single_put_size if adjusted_count is not None and (adjusted_count < blob_settings.max_single_put_size): @@ -74,6 +75,7 @@ async def upload_block_blob( # pylint: disable=too-many-locals validate_content=validate_content, data_stream_total=adjusted_count, upload_stream_current=0, + tier=tier.value if tier else None, **kwargs) use_original_upload_path = blob_settings.use_byte_buffer or \ @@ -119,6 +121,7 @@ async def upload_block_blob( # pylint: disable=too-many-locals cls=return_response_headers, validate_content=validate_content, headers=headers, + tier=tier.value if tier else None, **kwargs) except StorageErrorException as error: try: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_client_async.py index 4469e2ba7561..7e1ee6cce7e5 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 @@ -203,6 +203,9 @@ async def upload_blob( A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob @@ -910,6 +913,9 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param bool requires_sync: Enforces that the service will not return a response until the copy is complete. :returns: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). @@ -1238,6 +1244,9 @@ async def commit_block_list( # type: ignore the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param ~azure.storage.blob.models.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py index 06829e09f94b..d52366bcd97c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py @@ -656,6 +656,9 @@ async def upload_blob( A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob @@ -665,6 +668,11 @@ async def upload_blob( :param int max_connections: Maximum number of parallel connections to use when the blob size exceeds 64MB. + :param ~azure.storage.blob.models.CustomerProvidedEncryptionKey cpk: + Encrypts the data on the service-side with the given key. + Use of customer-provided keys must be done over HTTPS. + As the encryption key itself is provided in the request, + a secure connection must be established to transfer the key. :param str encoding: Defaults to UTF-8. :returns: A BlobClient to interact with the newly uploaded blob. 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 0033f93adf0e..87c96729bfe1 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 @@ -507,6 +507,9 @@ def upload_blob( # pylint: disable=too-many-locals A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob @@ -1341,9 +1344,9 @@ def _start_copy_from_url_options(self, source_url, metadata=None, incremental_co headers['x-ms-source-lease-id'] = source_lease.id # type: str except AttributeError: headers['x-ms-source-lease-id'] = source_lease - if kwargs.get('premium_page_blob_tier'): - premium_page_blob_tier = kwargs.pop('premium_page_blob_tier') - headers['x-ms-access-tier'] = premium_page_blob_tier.value + + tier = kwargs.pop('premium_page_blob_tier', None) or kwargs.pop('standard_blob_tier', None) + if kwargs.get('requires_sync'): headers['x-ms-requires-sync'] = str(kwargs.pop('requires_sync')) @@ -1358,6 +1361,7 @@ def _start_copy_from_url_options(self, source_url, metadata=None, incremental_co 'timeout': timeout, 'modified_access_conditions': dest_mod_conditions, 'headers': headers, + 'tier': tier.value if tier else None, 'cls': return_response_headers, } if not incremental_copy: @@ -1499,6 +1503,9 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param bool requires_sync: Enforces that the service will not return a response until the copy is complete. :returns: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). @@ -1930,6 +1937,9 @@ def _commit_block_list_options( # type: ignore 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) + + tier = kwargs.pop('standard_blob_tier', None) + options = { 'blocks': block_lookup, 'blob_http_headers': blob_headers, @@ -1938,7 +1948,9 @@ def _commit_block_list_options( # type: ignore 'modified_access_conditions': mod_conditions, 'cls': return_response_headers, 'validate_content': validate_content, - 'cpk_info': cpk_info} + 'cpk_info': cpk_info, + 'tier': tier.value if tier else None + } options.update(kwargs) return options @@ -1993,6 +2005,9 @@ def commit_block_list( # type: ignore the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param ~azure.storage.blob.models.CustomerProvidedEncryptionKey cpk: Encrypts the data on the service-side with the given key. Use of customer-provided keys must be done over HTTPS. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py index bab89ba6802e..c518a18731b4 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py @@ -832,6 +832,9 @@ def upload_blob( A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. + :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: + A standard blob tier value to set the blob to. For this version of the library, + this is only applicable to block blobs on standard storage accounts. :param int maxsize_condition: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob @@ -841,6 +844,11 @@ def upload_blob( :param int max_connections: Maximum number of parallel connections to use when the blob size exceeds 64MB. + :param ~azure.storage.blob.models.CustomerProvidedEncryptionKey cpk: + Encrypts the data on the service-side with the given key. + Use of customer-provided keys must be done over HTTPS. + As the encryption key itself is provided in the request, + a secure connection must be established to transfer the key. :param str encoding: Defaults to UTF-8. :returns: A BlobClient to interact with the newly uploaded blob. 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 902da9bf2ab9..87a562f988df 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -180,6 +180,26 @@ def test_put_block_list_with_md5(self): # Assert + @record + def test_put_block_list_with_blob_tier_specified(self): + + # Arrange + blob_name = self._get_blob_reference() + blob_client = self.bsc.get_blob_client(self.container_name, blob_name) + blob_client.stage_block('1', b'AAA') + blob_client.stage_block('2', b'BBB') + blob_client.stage_block('3', b'CCC') + blob_tier = StandardBlobTier.Cool + + # Act + block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] + blob_client.commit_block_list(block_list, + standard_blob_tier=blob_tier) + + # Assert + blob_properties = blob_client.get_blob_properties() + self.assertEqual(blob_properties.blob_tier, blob_tier) + @record def test_get_block_list_no_blocks(self): # Arrange @@ -544,6 +564,21 @@ def test_create_blob_from_bytes_non_parallel(self): # Assert self.assertBlobEqual(self.container_name, blob.blob_name, data) + @record + def test_create_blob_from_bytes_with_blob_tier_specified(self): + # Arrange + blob_name = self._get_blob_reference() + blob_client = self.bsc.get_blob_client(self.container_name, blob_name) + data = b'hello world' + blob_tier = StandardBlobTier.Cool + + # Act + blob_client.upload_blob(data, standard_blob_tier=blob_tier) + blob_properties = blob_client.get_blob_properties() + + # Assert + self.assertEqual(blob_properties.blob_tier, blob_tier) + def test_create_blob_from_path(self): # parallel tests introduce random order of requests, can only run live if TestMode.need_recording_file(self.test_mode): @@ -585,6 +620,23 @@ def test_create_blob_from_path_non_parallel(self): self.assertEqual(props.etag, create_resp.get('etag')) self.assertEqual(props.last_modified, create_resp.get('last_modified')) + @record + def test_upload_blob_from_path_non_parallel_with_standard_blob_tier(self): + # Arrange + blob_name = self._get_blob_reference() + blob = self.bsc.get_blob_client(self.container_name, blob_name) + data = self.get_random_bytes(100) + with open(FILE_PATH, 'wb') as stream: + stream.write(data) + blob_tier = StandardBlobTier.Cool + # Act + with open(FILE_PATH, 'rb') as stream: + blob.upload_blob(stream, length=100, max_connections=1, standard_blob_tier=blob_tier) + props = blob.get_blob_properties() + + # Assert + self.assertEqual(props.blob_tier, blob_tier) + def test_create_blob_from_path_with_progress(self): # parallel tests introduce random order of requests, can only run live if TestMode.need_recording_file(self.test_mode): @@ -798,6 +850,31 @@ def test_create_blob_from_stream_chunked_upload_with_properties(self): self.assertEqual(properties.content_settings.content_type, content_settings.content_type) self.assertEqual(properties.content_settings.content_language, content_settings.content_language) + def test_create_blob_from_stream_chunked_upload_with_properties(self): + # parallel tests introduce random order of requests, can only run live + if TestMode.need_recording_file(self.test_mode): + return + + # Arrange + blob_name = self._get_blob_reference() + blob = self.bsc.get_blob_client(self.container_name, blob_name) + data = self.get_random_bytes(LARGE_BLOB_SIZE) + with open(FILE_PATH, 'wb') as stream: + stream.write(data) + blob_tier = StandardBlobTier.Cool + + # Act + content_settings = ContentSettings( + content_type='image/png', + content_language='spanish') + with open(FILE_PATH, 'rb') as stream: + blob.upload_blob(stream, content_settings=content_settings, max_connections=2, standard_blob_tier=blob_tier) + + properties = blob.get_blob_properties() + + # Assert + self.assertEqual(properties.blob_tier, blob_tier) + @record def test_create_blob_from_text(self): # Arrange 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 df025566308e..bf1376121f0b 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 @@ -235,6 +235,30 @@ def test_put_block_list_with_md5(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_put_block_list_with_md5()) + async def _test_put_block_list_with_blob_tier_specified(self): + # Arrange + await self._setup() + blob_name = self._get_blob_reference() + blob_client = self.bsc.get_blob_client(self.container_name, blob_name) + await blob_client.stage_block('1', b'AAA') + await blob_client.stage_block('2', b'BBB') + await blob_client.stage_block('3', b'CCC') + blob_tier = StandardBlobTier.Cool + + # Act + block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] + await blob_client.commit_block_list(block_list, + standard_blob_tier=blob_tier) + + # Assert + blob_properties = await blob_client.get_blob_properties() + self.assertEqual(blob_properties.blob_tier, blob_tier) + + @record + def test_put_block_list_with_blob_tier_specified_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_put_block_list_with_blob_tier_specified()) + async def _test_get_block_list_no_blocks(self): # Arrange await self._setup() @@ -685,6 +709,26 @@ def test_create_blob_from_bytes_non_parallel(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_create_blob_from_bytes_non_parallel()) + async def _test_create_blob_from_bytes_with_blob_tier_specified(self): + # Arrange + await self._setup() + blob_name = self._get_blob_reference() + blob_client = self.bsc.get_blob_client(self.container_name, blob_name) + data = b'hello world' + blob_tier = StandardBlobTier.Cool + + # Act + await blob_client.upload_blob(data, standard_blob_tier=blob_tier) + blob_properties = await blob_client.get_blob_properties() + + # Assert + self.assertEqual(blob_properties.blob_tier, blob_tier) + + @record + def test_create_blob_from_bytes_with_blob_tier_specified_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_create_blob_from_bytes_with_blob_tier_specified()) + async def _test_create_blob_from_path(self): # parallel tests introduce random order of requests, can only run live await self._setup() @@ -737,6 +781,28 @@ def test_create_blob_from_path_non_parallel(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_create_blob_from_path_non_parallel()) + async def _test_upload_blob_from_path_non_parallel_with_standard_blob_tier(self): + # Arrange + await self._setup() + blob_name = self._get_blob_reference() + blob = self.bsc.get_blob_client(self.container_name, blob_name) + data = self.get_random_bytes(100) + with open(FILE_PATH, 'wb') as stream: + stream.write(data) + blob_tier = StandardBlobTier.Cool + # Act + with open(FILE_PATH, 'rb') as stream: + await blob.upload_blob(stream, length=100, max_connections=1, standard_blob_tier=blob_tier) + props = await blob.get_blob_properties() + + # Assert + self.assertEqual(props.blob_tier, blob_tier) + + @record + def test_upload_blob_from_path_non_parallel_with_standard_blob_tier_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_upload_blob_from_path_non_parallel_with_standard_blob_tier()) + async def _test_create_blob_from_path_with_progress(self): # parallel tests introduce random order of requests, can only run live await self._setup() @@ -1004,6 +1070,38 @@ def test_create_blob_from_stream_chunked_upload_with_properties(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_create_blob_from_stream_chunked_upload_with_properties()) + async def _test_create_blob_from_stream_chunked_upload_with_properties(self): + # parallel tests introduce random order of requests, can only run live + if TestMode.need_recording_file(self.test_mode): + return + + # Arrange + await self._setup() + blob_name = self._get_blob_reference() + blob = self.bsc.get_blob_client(self.container_name, blob_name) + data = self.get_random_bytes(LARGE_BLOB_SIZE) + with open(FILE_PATH, 'wb') as stream: + stream.write(data) + blob_tier = StandardBlobTier.Cool + + # Act + content_settings = ContentSettings( + content_type='image/png', + content_language='spanish') + with open(FILE_PATH, 'rb') as stream: + await blob.upload_blob(stream, content_settings=content_settings, max_connections=2, + standard_blob_tier=blob_tier) + + properties = await blob.get_blob_properties() + + # Assert + self.assertEqual(properties.blob_tier, blob_tier) + + @record + def test_create_blob_from_stream_chunked_upload_with_properties_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_create_blob_from_stream_chunked_upload_with_properties()) + async def _test_create_blob_from_text(self): # Arrange await self._setup() diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index a2439b14fc48..eee65757b70a 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -33,7 +33,7 @@ AccessPolicy, ResourceTypes, AccountPermissions, -) + StandardBlobTier) from testcase import ( StorageTestCase, TestMode, @@ -863,6 +863,25 @@ def test_copy_blob_with_existing_blob(self): copy_content = copyblob.download_blob().content_as_bytes() self.assertEqual(copy_content, self.byte_data) + @record + def test_copy_blob_with_blob_tier_specified(self): + # Arrange + blob_name = self._create_block_blob() + self.bsc.get_blob_client(self.container_name, blob_name) + + # Act + sourceblob = '{0}/{1}/{2}'.format( + self._get_account_url(), self.container_name, blob_name) + + copyblob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + blob_tier = StandardBlobTier.Cool + copyblob.start_copy_from_url(sourceblob, standard_blob_tier=blob_tier) + + copy_blob_properties = copyblob.get_blob_properties() + + # Assert + self.assertEqual(copy_blob_properties.blob_tier, blob_tier) + # TODO: external copy was supported since 2019-02-02 # @record # def test_copy_blob_with_external_blob_fails(self): diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 66253ba67dc9..0d4912d76741 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -41,7 +41,7 @@ AccessPolicy, ResourceTypes, AccountPermissions, -) + StandardBlobTier) from testcase import ( StorageTestCase, @@ -1146,6 +1146,30 @@ def test_copy_blob_with_existing_blob(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_copy_blob_with_existing_blob()) + async def _test_copy_blob_with_blob_tier_specified(self): + # Arrange + await self._setup() + blob_name = await self._create_block_blob() + self.bsc.get_blob_client(self.container_name, blob_name) + + # Act + sourceblob = '{0}/{1}/{2}'.format( + self._get_account_url(), self.container_name, blob_name) + + copyblob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + blob_tier = StandardBlobTier.Cool + await copyblob.start_copy_from_url(sourceblob, standard_blob_tier=blob_tier) + + copy_blob_properties = await copyblob.get_blob_properties() + + # Assert + self.assertEqual(copy_blob_properties.blob_tier, blob_tier) + + @record + def test_copy_blob_with_blob_tier_specified_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_copy_blob_with_blob_tier_specified()) + # TODO: external copy was supported since 2019-02-02 # async def _test_copy_blob_with_external_blob_fails(self): # # Arrange From 11b0957b5e4987f865efc11736ec95ef3994bc5f Mon Sep 17 00:00:00 2001 From: xiafu Date: Fri, 13 Sep 2019 14:01:03 -0700 Subject: [PATCH 2/4] [BlockBlob][Tier]Add Recordings for Standard BlobTier Support --- ...b_from_bytes_with_blob_tier_specified.yaml | 126 +++++++ ...t_block_list_with_blob_tier_specified.yaml | 258 +++++++++++++++ ..._non_parallel_with_standard_blob_tier.yaml | 128 ++++++++ ..._bytes_with_blob_tier_specified_async.yaml | 178 ++++++++++ ...k_list_with_blob_tier_specified_async.yaml | 308 ++++++++++++++++++ ...arallel_with_standard_blob_tier_async.yaml | 180 ++++++++++ ...st_copy_blob_with_blob_tier_specified.yaml | 206 ++++++++++++ ...y_blob_with_blob_tier_specified_async.yaml | 253 ++++++++++++++ 8 files changed, 1637 insertions(+) create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_create_blob_from_bytes_with_blob_tier_specified.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_list_with_blob_tier_specified.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_path_non_parallel_with_standard_blob_tier.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_create_blob_from_bytes_with_blob_tier_specified_async.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_list_with_blob_tier_specified_async.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_path_non_parallel_with_standard_blob_tier_async.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_blob_tier_specified.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_blob_tier_specified_async.yaml diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_create_blob_from_bytes_with_blob_tier_specified.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_create_blob_from_bytes_with_blob_tier_specified.yaml new file mode 100644 index 000000000000..706989beaa84 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_create_blob_from_bytes_with_blob_tier_specified.yaml @@ -0,0 +1,126 @@ +interactions: +- request: + body: hello world + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '11' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-access-tier: + - Cool + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 92c43748-d665-11e9-ba8c-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:15 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerba921bb8/blobba921bb8 + response: + body: + string: '' + headers: + Content-Length: + - '0' + Content-MD5: + - XrY7u+Ae7tCTyyK7j1rNww== + Date: + - Fri, 13 Sep 2019 20:32:14 GMT + ETag: + - '"0x8D7388977362D4F"' + Last-Modified: + - Fri, 13 Sep 2019 20:32:15 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 92c43748-d665-11e9-ba8c-001a7dda7113 + x-ms-content-crc64: + - vo7q9sPVKY0= + x-ms-request-id: + - c1f51ad1-c01e-0009-3f72-6ad7e8000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 93086410-d665-11e9-b0be-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:15 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainerba921bb8/blobba921bb8 + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '11' + Content-MD5: + - XrY7u+Ae7tCTyyK7j1rNww== + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 20:32:15 GMT + ETag: + - '"0x8D7388977362D4F"' + Last-Modified: + - Fri, 13 Sep 2019 20:32:15 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Cool + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 20:32:15 GMT + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 93086410-d665-11e9-b0be-001a7dda7113 + x-ms-creation-time: + - Fri, 13 Sep 2019 20:32:15 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - c1f51ae6-c01e-0009-4c72-6ad7e8000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_list_with_blob_tier_specified.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_list_with_blob_tier_specified.yaml new file mode 100644 index 000000000000..9db02c0e7c29 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_put_block_list_with_blob_tier_specified.yaml @@ -0,0 +1,258 @@ +interactions: +- request: + body: AAA + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-client-request-id: + - 9ae43824-d665-11e9-aa27-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerecab188b/blobecab188b?blockid=MQ%3D%3D&comp=block + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 20:32:28 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9ae43824-d665-11e9-aa27-001a7dda7113 + x-ms-content-crc64: + - Cc/2Kr4DuKg= + x-ms-request-id: + - 9890575f-101e-0025-2772-6a3b47000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: BBB + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-client-request-id: + - 9b2b0c62-d665-11e9-8581-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerecab188b/blobecab188b?blockid=Mg%3D%3D&comp=block + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 20:32:28 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9b2b0c62-d665-11e9-8581-001a7dda7113 + x-ms-content-crc64: + - +3yuPEA7IqE= + x-ms-request-id: + - 9890576d-101e-0025-3372-6a3b47000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: CCC + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-client-request-id: + - 9b400adc-d665-11e9-bd62-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerecab188b/blobecab188b?blockid=Mw%3D%3D&comp=block + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 20:32:29 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9b400adc-d665-11e9-bd62-001a7dda7113 + x-ms-content-crc64: + - VRJmMeosVKY= + x-ms-request-id: + - 98905777-101e-0025-3d72-6a3b47000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: ' + + MQ==Mg==Mw==' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '125' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-access-tier: + - Cool + x-ms-client-request-id: + - 9b541b74-d665-11e9-8cf2-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerecab188b/blobecab188b?comp=blocklist + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 20:32:29 GMT + ETag: + - '"0x8D738897F96AD11"' + Last-Modified: + - Fri, 13 Sep 2019 20:32:29 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9b541b74-d665-11e9-8cf2-001a7dda7113 + x-ms-content-crc64: + - dAoQ5rLgKr0= + x-ms-request-id: + - 9890578a-101e-0025-4f72-6a3b47000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 9b6a9128-d665-11e9-8c56-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainerecab188b/blobecab188b + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '9' + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 20:32:29 GMT + ETag: + - '"0x8D738897F96AD11"' + Last-Modified: + - Fri, 13 Sep 2019 20:32:29 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Cool + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 9b6a9128-d665-11e9-8c56-001a7dda7113 + x-ms-creation-time: + - Fri, 13 Sep 2019 20:32:29 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - 9890579f-101e-0025-6172-6a3b47000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_path_non_parallel_with_standard_blob_tier.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_path_non_parallel_with_standard_blob_tier.yaml new file mode 100644 index 000000000000..598ff91b6758 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob.test_upload_blob_from_path_non_parallel_with_standard_blob_tier.yaml @@ -0,0 +1,128 @@ +interactions: +- request: + body: !!binary | + DYaP2ifMvCiMahwiidbMkteBRm19pBcc6GC1+NCr9CRRMLoa+4ML3HonWKy8jJfebTVsXjQGzhC0 + uR1O17uEMb2RPYPe2PSSJT9bPU2xD4HU3MdVS7X2GzaNYhutl+wcWmQrog== + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '100' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-access-tier: + - Cool + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 2fdeee08-d669-11e9-855e-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:58:07 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer90f204a/blob90f204a + response: + body: + string: '' + headers: + Content-Length: + - '0' + Content-MD5: + - 49p4h0NrH0ntJtDoOHR0JA== + Date: + - Fri, 13 Sep 2019 20:58:07 GMT + ETag: + - '"0x8D7388D1450F5CD"' + Last-Modified: + - Fri, 13 Sep 2019 20:58:07 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 2fdeee08-d669-11e9-855e-001a7dda7113 + x-ms-content-crc64: + - QUYIGwNxSgc= + x-ms-request-id: + - 282a8703-301e-0040-5275-6a9503000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 3037ee0c-d669-11e9-87bf-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:58:08 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer90f204a/blob90f204a + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '100' + Content-MD5: + - 49p4h0NrH0ntJtDoOHR0JA== + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 20:58:07 GMT + ETag: + - '"0x8D7388D1450F5CD"' + Last-Modified: + - Fri, 13 Sep 2019 20:58:07 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Cool + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 20:58:07 GMT + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 3037ee0c-d669-11e9-87bf-001a7dda7113 + x-ms-creation-time: + - Fri, 13 Sep 2019 20:58:07 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - 282a8710-301e-0040-5a75-6a9503000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_create_blob_from_bytes_with_blob_tier_specified_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_create_blob_from_bytes_with_blob_tier_specified_async.yaml new file mode 100644 index 000000000000..0e2090342ab6 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_create_blob_from_bytes_with_blob_tier_specified_async.yaml @@ -0,0 +1,178 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 77c4b56e-d665-11e9-9fde-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:31:30 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer29ef20b2?restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:31:30 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738895C30F34C"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:31:30 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 77c4b56e-d665-11e9-9fde-001a7dda7113 + x-ms-request-id: dfeed713-601e-003f-0372-6a5a98000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer29ef20b2 + - restype=container + - '' +- request: + body: hello world + headers: + Content-Length: + - '11' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-access-tier: + - Cool + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 7805329c-d665-11e9-be1c-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:31:30 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer29ef20b2/blob29ef20b2 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : XrY7u+Ae7tCTyyK7j1rNww== + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:31:30 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738895C40D99E"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:31:30 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 7805329c-d665-11e9-be1c-001a7dda7113 + x-ms-content-crc64: vo7q9sPVKY0= + x-ms-request-id: dfeed717-601e-003f-0572-6a5a98000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer29ef20b2/blob29ef20b2 + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 78147f26-d665-11e9-be97-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:31:30 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer29ef20b2/blob29ef20b2 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '11' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : XrY7u+Ae7tCTyyK7j1rNww== + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:31:30 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738895C40D99E"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:31:30 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Cool + x-ms-access-tier-change-time: Fri, 13 Sep 2019 20:31:30 GMT + x-ms-blob-type: BlockBlob + x-ms-client-request-id: 78147f26-d665-11e9-be97-001a7dda7113 + x-ms-creation-time: Fri, 13 Sep 2019 20:31:30 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: dfeed718-601e-003f-0672-6a5a98000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer29ef20b2/blob29ef20b2 + - '' + - '' +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_list_with_blob_tier_specified_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_list_with_blob_tier_specified_async.yaml new file mode 100644 index 000000000000..ccb76ead1457 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_put_block_list_with_blob_tier_specified_async.yaml @@ -0,0 +1,308 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 9fb6f012-d668-11e9-89b5-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:54:05 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer35121d85?restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388C842E33ED"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 9fb6f012-d668-11e9-89b5-001a7dda7113 + x-ms-request-id: 96e1f534-f01e-0002-7b75-6a2c83000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer35121d85 + - restype=container + - '' +- request: + body: AAA + headers: + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-client-request-id: + - a00a0224-d668-11e9-bda0-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:54:06 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer35121d85/blob35121d85?blockid=MQ%3D%3D&comp=block + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a00a0224-d668-11e9-bda0-001a7dda7113 + x-ms-content-crc64: Cc/2Kr4DuKg= + x-ms-request-id: 96e1f53e-f01e-0002-0275-6a2c83000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer35121d85/blob35121d85 + - blockid=MQ%3D%3D&comp=block + - '' +- request: + body: BBB + headers: + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-client-request-id: + - a018cf5c-d668-11e9-97d2-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:54:06 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer35121d85/blob35121d85?blockid=Mg%3D%3D&comp=block + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a018cf5c-d668-11e9-97d2-001a7dda7113 + x-ms-content-crc64: +3yuPEA7IqE= + x-ms-request-id: 96e1f540-f01e-0002-0475-6a2c83000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer35121d85/blob35121d85 + - blockid=Mg%3D%3D&comp=block + - '' +- request: + body: CCC + headers: + Content-Length: + - '3' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-client-request-id: + - a031f6f0-d668-11e9-b092-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:54:06 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer35121d85/blob35121d85?blockid=Mw%3D%3D&comp=block + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a031f6f0-d668-11e9-b092-001a7dda7113 + x-ms-content-crc64: VRJmMeosVKY= + x-ms-request-id: 96e1f545-f01e-0002-0875-6a2c83000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer35121d85/blob35121d85 + - blockid=Mw%3D%3D&comp=block + - '' +- request: + body: ' + + MQ==Mg==Mw==' + headers: + Content-Length: + - '125' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-access-tier: + - Cool + x-ms-client-request-id: + - a0414428-d668-11e9-9c14-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:54:06 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer35121d85/blob35121d85?comp=blocklist + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388C847E39CA"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a0414428-d668-11e9-9c14-001a7dda7113 + x-ms-content-crc64: dAoQ5rLgKr0= + x-ms-request-id: 96e1f54b-f01e-0002-0c75-6a2c83000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer35121d85/blob35121d85 + - comp=blocklist + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - a052eb7a-d668-11e9-bcbe-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:54:06 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer35121d85/blob35121d85 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '9' + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388C847E39CA"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:54:06 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Cool + x-ms-access-tier-change-time: Fri, 13 Sep 2019 20:54:06 GMT + x-ms-blob-type: BlockBlob + x-ms-client-request-id: a052eb7a-d668-11e9-bcbe-001a7dda7113 + x-ms-creation-time: Fri, 13 Sep 2019 20:54:06 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: 96e1f553-f01e-0002-1475-6a2c83000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer35121d85/blob35121d85 + - '' + - '' +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_path_non_parallel_with_standard_blob_tier_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_path_non_parallel_with_standard_blob_tier_async.yaml new file mode 100644 index 000000000000..0845a3a6fb5a --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_block_blob_async.test_upload_blob_from_path_non_parallel_with_standard_blob_tier_async.yaml @@ -0,0 +1,180 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 7c21334a-d665-11e9-b555-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:31:37 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraf282544?restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:31:37 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738896082638A"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:31:37 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 7c21334a-d665-11e9-b555-001a7dda7113 + x-ms-request-id: 085bd4e2-301e-0032-7072-6a924c000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraf282544 + - restype=container + - '' +- request: + body: !!binary | + T8fYfaJcNdryLnfiHtx5A5kUd89FCNERu0auBXyNO4SVsVhwNNprPbzKaaH3El7WbYMbLCyc+NEh + jsajJ0OoqAuLL8R6FWOvGSndWrKBYCIcAFz9U/YRssTVJnq5AhObTf3DiA== + headers: + Content-Length: + - '100' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-access-tier: + - Cool + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 7c5b5490-d665-11e9-b779-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:31:37 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraf282544/blobaf282544 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : 1AlBRdreRFpSm6GWqTuSjg== + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:31:37 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D73889609716AC"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:31:37 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 7c5b5490-d665-11e9-b779-001a7dda7113 + x-ms-content-crc64: npmbmZBSiuw= + x-ms-request-id: 085bd4ea-301e-0032-7672-6a924c000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraf282544/blobaf282544 + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 7c6aa6e4-d665-11e9-86bf-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:31:37 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontaineraf282544/blobaf282544 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '100' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : 1AlBRdreRFpSm6GWqTuSjg== + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:31:37 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D73889609716AC"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:31:37 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Cool + x-ms-access-tier-change-time: Fri, 13 Sep 2019 20:31:37 GMT + x-ms-blob-type: BlockBlob + x-ms-client-request-id: 7c6aa6e4-d665-11e9-86bf-001a7dda7113 + x-ms-creation-time: Fri, 13 Sep 2019 20:31:37 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: 085bd4f2-301e-0032-7e72-6a924c000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraf282544/blobaf282544 + - '' + - '' +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_blob_tier_specified.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_blob_tier_specified.yaml new file mode 100644 index 000000000000..11d0afb905f0 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_blob_tier_specified.yaml @@ -0,0 +1,206 @@ +interactions: +- request: + body: !!binary | + cwSdisDtP7jHLqH8soLg1SxifrwbVWcn5ubEQQE7cXyb6W5yoIK7ZSsxaZVEXMIXRle2iQK9/Gmd + mspaMWgI8h50UfVvWjAQf68ekQR4VhxiLejKnEu8tU+OPc0vnUsRTb/DZZpAbsls3cT9FdMofwIw + eMvCXwNhVQx6CgyBz0WgvA795ATRLCIIUHQlg4kVfT2r4QVvFz0DXjkmRBYh1DvqdSqlBr/cDhfz + UBqJTh5+KfQOq0Q4ILJFNOEfg+9dRfdYcco24aNbLcDR/SjbCiqSNxMf5JVLOmcb/SltKo7W8qKM + UDpZd74q7nWKI+IcwhHhipkjzqzkB7xsxUHV482xVBm8b+BfxsMXXU/8SosU8ghurAByUqDyxFJy + XuxJ++fqa7WD3KyYu75MYeOAypjeEoJXsDAB4ypKFjlUiPiAuOCu+qRkTcYR3fWo7dNp9ck4XMC8 + gYPyIemmTQxNSn8vTkXZz32/w2kYxLn4YT0Ge1CZeD4Im67TQfDOzdkAq54GO6GXbUZ+MF53dtsE + zct7MTpgSIuqRK8B592g52OO1uGQ5Aln/uM743YWpw2H2PaJ0UXc11DS8qT7yOtxZd3ruBFfb7SE + wB6IfY6lMAAk9rmNBOZl19dodOdNjaxYIp0VW3RW1XjQpAcyQ2fQIjYS6GDLbqyojJ2bsveS6mqp + dVUDvmj6a/5FtnEq4KJrqWcTYASHZlbZ2guX4z0fn7adrjXU40gieSGYyxEvd86GCTamDhZ9j8F9 + c8WjOMnv/Q+Nr6KuXhAmB9P2unoBD/HSqUGzuteqJo0IQVANzG0QGiT2LplWTZ6MsDcWt/AEa91W + zouw8RlVIuxQoEFSWafKPclup048YkkFxbDaJAYa0b6/KDHlQKnJyEo9R1t8UzFEY48B+nqYYJ22 + 5Ya9fQkXmpmSnDayc2Jj7TOhdY5Ar544fEyPRQ431abWyOH06P4KW051Qw1Dwnvgy+Ddt6zaYrEz + EMlcaAJjYh3N9uYGlQxRB+ni8Zi+OCjN0wavy0CgpEzBvJ9kf+YzgDOqRZqEXuTSGKJ3dXwOxiUu + 9gSQcq4tSfaEp2Rzg04Z5JZQCsU72hMBZr/p2E+JvT/ypAsupFwWPcDJzjuzsGxFKXFfNYkKguHk + n0emyfqlwMqQ11DX0tGzpBEaGjtJT+c8CwIfrR54xHtACPPHWPXHAkqKZeOX17MF4QgliXWWVrEs + h88cMPy2lywspJg+ufpzctFeTAy5E6683cNjPEzl1+QNCn91YGWWR+xg0fvU2GBSp71BBJL138Uq + mbNhTwiVHJqe29QonXQD4fNwopVIF9jxu5I+9LDrah4uIMJxeow7cBNS08hSRxB4AZUft9X1aw== + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - d21435c6-d665-11e9-b9d1-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:34:01 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8e6d16e4/blob8e6d16e4 + response: + body: + string: '' + headers: + Content-Length: + - '0' + Content-MD5: + - cgjC0l1+rwBehCFjcg1H2A== + Date: + - Fri, 13 Sep 2019 20:34:01 GMT + ETag: + - '"0x8D73889B68A8DFD"' + Last-Modified: + - Fri, 13 Sep 2019 20:34:02 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - d21435c6-d665-11e9-b9d1-001a7dda7113 + x-ms-content-crc64: + - 4bB1b9Tg10g= + x-ms-request-id: + - 6724de85-201e-0011-3972-6a088f000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + 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.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Cool + x-ms-client-request-id: + - d2631a4c-d665-11e9-8f9e-001a7dda7113 + x-ms-copy-source: + - https://emilystageaccount.blob.core.windows.net/utcontainer8e6d16e4/blob8e6d16e4 + x-ms-date: + - Fri, 13 Sep 2019 20:34:02 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer8e6d16e4/blob1copy + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 20:34:01 GMT + ETag: + - '"0x8D73889B6A6533D"' + Last-Modified: + - Fri, 13 Sep 2019 20:34:02 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - d2631a4c-d665-11e9-8f9e-001a7dda7113 + x-ms-copy-id: + - 5e08f2a0-7a9e-4598-83e6-e90a170dbf89 + x-ms-copy-status: + - success + x-ms-request-id: + - 6724de91-201e-0011-4372-6a088f000000 + x-ms-version: + - '2019-02-02' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - d2799a64-d665-11e9-9f73-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:34:02 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer8e6d16e4/blob1copy + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '1024' + Content-MD5: + - cgjC0l1+rwBehCFjcg1H2A== + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 20:34:01 GMT + ETag: + - '"0x8D73889B6A6533D"' + Last-Modified: + - Fri, 13 Sep 2019 20:34:02 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Cool + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 20:34:02 GMT + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - d2799a64-d665-11e9-9f73-001a7dda7113 + x-ms-copy-completion-time: + - Fri, 13 Sep 2019 20:34:02 GMT + x-ms-copy-id: + - 5e08f2a0-7a9e-4598-83e6-e90a170dbf89 + x-ms-copy-progress: + - 1024/1024 + x-ms-copy-source: + - https://storagename.blob.core.windows.net/utcontainer8e6d16e4/blob8e6d16e4 + x-ms-copy-status: + - success + x-ms-creation-time: + - Fri, 13 Sep 2019 20:34:02 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - 6724de9b-201e-0011-4c72-6a088f000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_blob_tier_specified_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_blob_tier_specified_async.yaml new file mode 100644 index 000000000000..aa1d2db35e20 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_blob_tier_specified_async.yaml @@ -0,0 +1,253 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 52523d92-d665-11e9-b698-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:30:27 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerc35e1bde?timeout=5&restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:30:26 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388936B786C7"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:30:27 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 52523d92-d665-11e9-b698-001a7dda7113 + x-ms-request-id: ddb3bf00-001e-0006-0472-6aa184000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainerc35e1bde + - timeout=5&restype=container + - '' +- request: + body: !!binary | + 7kpL/FB2U1380SMN72o3R2y+lz2J+DfA5EFwRI/vtSmBLiy9TzDEq0bbfb+IZAiHjiRVaOIlvp9E + tTsDM5iPhSJOaAygxaUvrJWDJxHgc/l55ZUJ3ZefBPhM0+7UGkcbx7d1DrStWNaxbeqVLr6T0z2D + 4G/wWMSJpf6Nn5myMsrg5CKu6k5oQZ7aRmzd9t4bA4HpUmid9SABjZVDd6y0JaG8fJzyAi0ycjb2 + ZC2Cm8xojPVSYYxN59MMEoK0DrZpaCihPS4PNI9gIziPScoS3q0VRQTZM4z+WTu0aSB4JRpMPI0A + ousHU8zFdO+S6ix2I/jEai/squeCO6bLgpSwSIL4Df7WhHoFoLoHG57pr6SqLx3fyw+rt4+Ji/Am + +p6dQNmbWv606wpiOxeTx2stSNEENDzHbgUkLGaXqNHYgspSYxo8fMLVuQJWrnEOYt4fRhnW8GME + Zv0d2HRUtxjxj961DkrsjF4HEKgnKArRdOfswYk5h8Ws03N/+O+DTceG1cEh1YO6UhXyGACA2Vik + xzITeDeioDWJgPS05JoSnAxXM5KmPju5wjhFb0XxhTNVBqnmtSnkkTF9PVWQN14p1FuUrb7Ye4+6 + lR9ltnsuico4LrFXQA+5yP36GWbeSHM1Znn4MiOg42YHwX6onRvbGUkTHL8fLXme1UV2z+WOoKiH + jDBkVl/MVonj0PZzfjWOQzpxQa4utEaGX4LpcEOf4Tx/mC0uClip4oHn6E2RKaKK5KXEOssXKZB+ + ud03WrHjsGHtUd9OHdaBY7TZxyL9cOMHBDEhuBPKu9tsH3MRmzFj73MLJjaIxueKpn72vit2PpcM + f7ofQbMnyk/tTf2QZhem9XGUzPQ/VQmdUV47Y5spNpzHIYRILfctTki/Uo8vClInYrgv2k+Jd7W9 + hvFLQzGCod1EfGaPd66hQ8HI98XyNd4uC8BtdZ7x5oGtUMCeGqQedRnPHehlHIUb5gR0UiPZLauN + ZJDEttK+yBO8XbKLk++Bp5tJBCadLkenZq2UKUd1AF2S832wzvEIRPf9fWd3kGeY14V+5WYLVCqr + kuNhsHEDucU/KGEuHYqYrnemYEiE4frucLBXHMrhxOS9qV8Ca/0cAMlScMIUE21ZIRoS/moUVcDe + r0Ilj26feC/kDnNgltTcBSKu3PKGhxGd7WWSl/xLVm4fwtc1G7Pp3bvvJ36znDNzMXkHcuUWQ81B + uIhpEMPN1IK28BgGMBx/OGlzrXZS0VsiENxcsOho8DhkkoSAx/aJ4sS+W8N3p4MQOZBtrQRYQ61s + a8MqfLDtcXREDGH0K0A6NSoKDx8JI7RyZ/bsSVaPfqbM8GuQCZkMTtVYyoYVv8zowb3YMMlnaw== + headers: + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 528f66a6-d665-11e9-ba57-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:30:27 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerc35e1bde/blobc35e1bde + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : ifyzxoXEj8rj/c6GvbxbRQ== + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:30:26 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388936C9A837"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:30:27 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 528f66a6-d665-11e9-ba57-001a7dda7113 + x-ms-content-crc64: YRdEw5iFHtQ= + x-ms-request-id: ddb3bf08-001e-0006-0a72-6aa184000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainerc35e1bde/blobc35e1bde + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Cool + x-ms-client-request-id: + - 52a36f24-d665-11e9-bf78-001a7dda7113 + x-ms-copy-source: + - https://emilystageaccount.blob.core.windows.net/utcontainerc35e1bde/blobc35e1bde + x-ms-date: + - Fri, 13 Sep 2019 20:30:27 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerc35e1bde/blob1copy + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:30:26 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388936DFC89E"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:30:27 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 52a36f24-d665-11e9-bf78-001a7dda7113 + x-ms-copy-id: 44e9813a-2313-479f-92d5-f4ca5cb3b293 + x-ms-copy-status: success + x-ms-request-id: ddb3bf0e-001e-0006-1072-6aa184000000 + x-ms-version: '2019-02-02' + status: + code: 202 + message: Accepted + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainerc35e1bde/blob1copy + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 52b2c582-d665-11e9-96e3-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 20:30:27 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainerc35e1bde/blob1copy + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '1024' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : ifyzxoXEj8rj/c6GvbxbRQ== + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 20:30:27 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7388936DFC89E"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 20:30:27 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Cool + x-ms-access-tier-change-time: Fri, 13 Sep 2019 20:30:27 GMT + x-ms-blob-type: BlockBlob + x-ms-client-request-id: 52b2c582-d665-11e9-96e3-001a7dda7113 + x-ms-copy-completion-time: Fri, 13 Sep 2019 20:30:27 GMT + x-ms-copy-id: 44e9813a-2313-479f-92d5-f4ca5cb3b293 + x-ms-copy-progress: 1024/1024 + x-ms-copy-source: https://storagename.blob.core.windows.net/utcontainerc35e1bde/blobc35e1bde + x-ms-copy-status: success + x-ms-creation-time: Fri, 13 Sep 2019 20:30:27 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: ddb3bf12-001e-0006-1472-6aa184000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainerc35e1bde/blob1copy + - '' + - '' +version: 1 From aa7761838bdf5725a75801963b984f612462594b Mon Sep 17 00:00:00 2001 From: xiafu Date: Fri, 13 Sep 2019 16:26:01 -0700 Subject: [PATCH 3/4] [BlockBlob][Rehydrate]Enable Rehydrate Priority for Copy/SetTier --- .../storage/blob/aio/blob_client_async.py | 4 +++ .../azure/storage/blob/blob_client.py | 4 +++ .../tests/test_blob_storage_account.py | 18 +++++++++++ .../tests/test_blob_storage_account_async.py | 23 ++++++++++++++ .../tests/test_common_blob.py | 26 ++++++++++++++++ .../tests/test_common_blob_async.py | 31 +++++++++++++++++++ 6 files changed, 106 insertions(+) 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 7e1ee6cce7e5..90c6edd7f012 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 @@ -916,6 +916,8 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. + :param :class:`~azure.storage.blob.models.RehydratePriority` rehydrate_priority: + Indicates the priority with which to rehydrate an archived blob :param bool requires_sync: Enforces that the service will not return a response until the copy is complete. :returns: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). @@ -1040,6 +1042,8 @@ async def set_standard_blob_tier(self, standard_blob_tier, **kwargs): tier is optimized for storing data that is rarely accessed and stored for at least six months with flexible latency requirements. :type standard_blob_tier: str or ~azure.storage.blob.models.StandardBlobTier + :param :class:`~azure.storage.blob.models.RehydratePriority` rehydrate_priority: + Indicates the priority with which to rehydrate an archived blob :param int timeout: The timeout parameter is expressed in seconds. :param lease: 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 87c96729bfe1..77fecebc39f1 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 @@ -1506,6 +1506,8 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, :param ~azure.storage.blob.models.StandardBlobTier standard_blob_tier: A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts. + :param :class:`~azure.storage.blob.models.RehydratePriority` rehydrate_priority: + Indicates the priority with which to rehydrate an archived blob :param bool requires_sync: Enforces that the service will not return a response until the copy is complete. :returns: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). @@ -1647,6 +1649,8 @@ def set_standard_blob_tier(self, standard_blob_tier, **kwargs): tier is optimized for storing data that is rarely accessed and stored for at least six months with flexible latency requirements. :type standard_blob_tier: str or ~azure.storage.blob.models.StandardBlobTier + :param :class:`~azure.storage.blob._generated.models.RehydratePriority` rehydrate_priority: + Indicates the priority with which to rehydrate an archived blob :param int timeout: The timeout parameter is expressed in seconds. :param lease: diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py index 94537ed113f7..ab64af8fb06d 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account.py @@ -15,6 +15,7 @@ BlobClient, StandardBlobTier ) +from azure.storage.blob._generated.models import RehydratePriority from testcase import ( StorageTestCase, record, @@ -109,6 +110,23 @@ def test_standard_blob_tier_set_tier_api(self): blob.delete_blob() + @record + def test_set_standard_blob_tier_with_rehydrate_priority(self): + # Arrange + blob_client = self._create_blob() + blob_tier = StandardBlobTier.Archive + rehydrate_tier = StandardBlobTier.Cool + rehydrate_priority = RehydratePriority.standard + + # Act + blob_client.set_standard_blob_tier(blob_tier, + rehydrate_priority=rehydrate_priority) + blob_client.set_standard_blob_tier(rehydrate_tier) + blob_props = blob_client.get_blob_properties() + + # Assert + self.assertEquals('rehydrate-pending-to-cool', blob_props.archive_status) + @record def test_rehydration_status(self): blob_name = 'rehydration_test_blob_1' diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py index 0e0adacf4c49..e6343afafd2b 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_storage_account_async.py @@ -12,6 +12,7 @@ from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy +from azure.storage.blob._generated.models import RehydratePriority from azure.storage.blob.aio import ( BlobServiceClient, ContainerClient, @@ -147,6 +148,28 @@ def test_standard_blob_tier_set_tier_api(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_standard_blob_tier_set_tier_api()) + async def _test_set_standard_blob_tier_with_rehydrate_priority(self): + # Arrange + await self._setup() + blob_client = await self._create_blob() + blob_tier = StandardBlobTier.Archive + rehydrate_tier = StandardBlobTier.Cool + rehydrate_priority = RehydratePriority.standard + + # Act + await blob_client.set_standard_blob_tier(blob_tier, + rehydrate_priority=rehydrate_priority) + await blob_client.set_standard_blob_tier(rehydrate_tier) + blob_props = await blob_client.get_blob_properties() + + # Assert + self.assertEquals('rehydrate-pending-to-cool', blob_props.archive_status) + + @record + def test_set_standard_blob_tier_with_rehydrate_priority_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_set_standard_blob_tier_with_rehydrate_priority()) + async def _test_rehydration_status(self): await self._setup() blob_name = 'rehydration_test_blob_1' diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index eee65757b70a..5248240e5dd2 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -34,6 +34,7 @@ ResourceTypes, AccountPermissions, StandardBlobTier) +from azure.storage.blob._generated.models import RehydratePriority from testcase import ( StorageTestCase, TestMode, @@ -882,6 +883,31 @@ def test_copy_blob_with_blob_tier_specified(self): # Assert self.assertEqual(copy_blob_properties.blob_tier, blob_tier) + @record + def test_copy_blob_with_rehydrate_priority(self): + # Arrange + blob_name = self._create_block_blob() + + # Act + sourceblob = '{0}/{1}/{2}'.format( + self._get_account_url(), self.container_name, blob_name) + + blob_tier = StandardBlobTier.Archive + rehydrate_priority = RehydratePriority.high + copyblob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + copy = copyblob.start_copy_from_url(sourceblob, + standard_blob_tier=blob_tier, + rehydrate_priority=rehydrate_priority) + copy_blob_properties = copyblob.get_blob_properties() + copyblob.set_standard_blob_tier(StandardBlobTier.Hot) + second_resp = copyblob.get_blob_properties() + + # Assert + self.assertIsNotNone(copy) + self.assertIsNotNone(copy.get('copy_id')) + self.assertEqual(copy_blob_properties.blob_tier, blob_tier) + self.assertEqual(second_resp.archive_status, 'rehydrate-pending-to-hot') + # TODO: external copy was supported since 2019-02-02 # @record # def test_copy_blob_with_external_blob_fails(self): diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 0d4912d76741..d8b9d6e19fde 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -22,6 +22,7 @@ from azure.core.pipeline.transport import AioHttpTransport from multidict import CIMultiDict, CIMultiDictProxy +from azure.storage.blob._generated.models import RehydratePriority from azure.storage.blob.aio import ( BlobServiceClient, ContainerClient, @@ -1170,6 +1171,36 @@ def test_copy_blob_with_blob_tier_specified_async(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_copy_blob_with_blob_tier_specified()) + async def _test_copy_blob_with_rehydrate_priority(self): + # Arrange + await self._setup() + blob_name = await self._create_block_blob() + + # Act + sourceblob = '{0}/{1}/{2}'.format( + self._get_account_url(), self.container_name, blob_name) + + blob_tier = StandardBlobTier.Archive + rehydrate_priority = RehydratePriority.high + copyblob = self.bsc.get_blob_client(self.container_name, 'blob1copy') + copy = await copyblob.start_copy_from_url(sourceblob, + standard_blob_tier=blob_tier, + rehydrate_priority=rehydrate_priority) + copy_blob_properties = await copyblob.get_blob_properties() + await copyblob.set_standard_blob_tier(StandardBlobTier.Hot) + second_resp = await copyblob.get_blob_properties() + + # Assert + self.assertIsNotNone(copy) + self.assertIsNotNone(copy.get('copy_id')) + self.assertEqual(copy_blob_properties.blob_tier, blob_tier) + self.assertEqual(second_resp.archive_status, 'rehydrate-pending-to-hot') + + @record + def test_copy_blob_with_rehydrate_priority_async(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_copy_blob_with_rehydrate_priority()) + # TODO: external copy was supported since 2019-02-02 # async def _test_copy_blob_with_external_blob_fails(self): # # Arrange From 03d4678d84e487cc9f3d4a6041950135fbe2454d Mon Sep 17 00:00:00 2001 From: xiafu Date: Fri, 13 Sep 2019 16:26:22 -0700 Subject: [PATCH 4/4] [BlockBlob][Rehydrate]Recordings for Rehydrate Priority for Copy/SetTier --- ...ard_blob_tier_with_rehydrate_priority.yaml | 216 ++++++++++ ...ob_tier_with_rehydrate_priority_async.yaml | 267 +++++++++++++ ...est_copy_blob_with_rehydrate_priority.yaml | 330 ++++++++++++++++ ...py_blob_with_rehydrate_priority_async.yaml | 372 ++++++++++++++++++ 4 files changed, 1185 insertions(+) create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account.test_set_standard_blob_tier_with_rehydrate_priority.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account_async.test_set_standard_blob_tier_with_rehydrate_priority_async.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_rehydrate_priority.yaml create mode 100644 sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_rehydrate_priority_async.yaml diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account.test_set_standard_blob_tier_with_rehydrate_priority.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account.test_set_standard_blob_tier_with_rehydrate_priority.yaml new file mode 100644 index 000000000000..b354071f0004 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account.test_set_standard_blob_tier_with_rehydrate_priority.yaml @@ -0,0 +1,216 @@ +interactions: +- 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.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 9f4dec9e-d67d-11e9-887c-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:24 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd3161fdc/blobd3161fdc + response: + body: + string: '' + headers: + Content-Length: + - '0' + Content-MD5: + - 1B2M2Y8AsgTpgAmY7PhCfg== + Date: + - Fri, 13 Sep 2019 23:24:24 GMT + ETag: + - '"0x8D738A183C74AD3"' + Last-Modified: + - Fri, 13 Sep 2019 23:24:24 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9f4dec9e-d67d-11e9-887c-001a7dda7113 + x-ms-content-crc64: + - AAAAAAAAAAA= + x-ms-request-id: + - 4438742a-401e-0017-6c8a-6a3b30000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + 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.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Archive + x-ms-client-request-id: + - 9fa57586-d67d-11e9-8ef0-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:24 GMT + x-ms-rehydrate-priority: + - Standard + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd3161fdc/blobd3161fdc?comp=tier + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 23:24:24 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9fa57586-d67d-11e9-8ef0-001a7dda7113 + x-ms-request-id: + - 44387431-401e-0017-728a-6a3b30000000 + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Cool + x-ms-client-request-id: + - 9fb8e8c0-d67d-11e9-bbdd-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:25 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainerd3161fdc/blobd3161fdc?comp=tier + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 23:24:24 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 9fb8e8c0-d67d-11e9-bbdd-001a7dda7113 + x-ms-request-id: + - 44387440-401e-0017-7f8a-6a3b30000000 + x-ms-version: + - '2019-02-02' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 9fd11ce8-d67d-11e9-9e2d-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:25 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainerd3161fdc/blobd3161fdc + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '0' + Content-MD5: + - 1B2M2Y8AsgTpgAmY7PhCfg== + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 23:24:25 GMT + ETag: + - '"0x8D738A183C74AD3"' + Last-Modified: + - Fri, 13 Sep 2019 23:24:24 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Archive + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 23:24:25 GMT + x-ms-archive-status: + - rehydrate-pending-to-cool + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - 9fd11ce8-d67d-11e9-9e2d-001a7dda7113 + x-ms-creation-time: + - Fri, 13 Sep 2019 23:24:24 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - 4438744a-401e-0017-098a-6a3b30000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account_async.test_set_standard_blob_tier_with_rehydrate_priority_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account_async.test_set_standard_blob_tier_with_rehydrate_priority_async.yaml new file mode 100644 index 000000000000..9e557af1cb08 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_blob_storage_account_async.test_set_standard_blob_tier_with_rehydrate_priority_async.yaml @@ -0,0 +1,267 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - ab87c3ba-d67d-11e9-81c2-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:44 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer721224d6?restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:44 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18FED4CD7"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:45 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: ab87c3ba-d67d-11e9-81c2-001a7dda7113 + x-ms-request-id: 7606d323-a01e-0042-1c8a-6a2bbb000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer721224d6 + - restype=container + - '' +- request: + body: null + headers: + Content-Length: + - '0' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - abc521c6-d67d-11e9-840f-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:45 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer721224d6/blob721224d6 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : 1B2M2Y8AsgTpgAmY7PhCfg== + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:44 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18FFCCAEB"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:45 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: abc521c6-d67d-11e9-840f-001a7dda7113 + x-ms-content-crc64: AAAAAAAAAAA= + x-ms-request-id: 7606d332-a01e-0042-248a-6a2bbb000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer721224d6/blob721224d6 + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Archive + x-ms-client-request-id: + - abd206f8-d67d-11e9-b56f-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:45 GMT + x-ms-rehydrate-priority: + - Standard + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer721224d6/blob721224d6?comp=tier + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:44 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: abd206f8-d67d-11e9-b56f-001a7dda7113 + x-ms-request-id: 7606d33d-a01e-0042-2c8a-6a2bbb000000 + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer721224d6/blob721224d6 + - comp=tier + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Cool + x-ms-client-request-id: + - abe1539e-d67d-11e9-b1dc-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:45 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer721224d6/blob721224d6?comp=tier + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:44 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: abe1539e-d67d-11e9-b1dc-001a7dda7113 + x-ms-request-id: 7606d341-a01e-0042-2f8a-6a2bbb000000 + x-ms-version: '2019-02-02' + status: + code: 202 + message: Accepted + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer721224d6/blob721224d6 + - comp=tier + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - abed469e-d67d-11e9-858d-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:45 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer721224d6/blob721224d6 + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : 1B2M2Y8AsgTpgAmY7PhCfg== + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:44 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18FFCCAEB"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:45 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Archive + x-ms-access-tier-change-time: Fri, 13 Sep 2019 23:24:45 GMT + x-ms-archive-status: rehydrate-pending-to-cool + x-ms-blob-type: BlockBlob + x-ms-client-request-id: abed469e-d67d-11e9-858d-001a7dda7113 + x-ms-creation-time: Fri, 13 Sep 2019 23:24:45 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: 7606d345-a01e-0042-338a-6a2bbb000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontainer721224d6/blob721224d6 + - '' + - '' +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_rehydrate_priority.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_rehydrate_priority.yaml new file mode 100644 index 000000000000..998ab3342634 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob.test_copy_blob_with_rehydrate_priority.yaml @@ -0,0 +1,330 @@ +interactions: +- request: + body: !!binary | + 7jD4T7GTBqoLSlMaiq4VKCo1GvmlCqU0dz2vaz6V7Adigje+fHJJNjtIHqvWAKdlALg1hIWf+npm + Sn5oP0SkhjvvOlCDKUtkNpmDB13bLddUAx355ve2wVBmhVEs7WSXgaFsS8CTc2NKJDNEfrUSzPh/ + 5omxUnkPVZlVREMccwVwA6n3R8L4I9WieIzFoSyvb2ECHvtsaz3WLKhuF8g3uAhthy8cFCqrU0vi + CIpvbQeb2XbWwLj6EOu5M1xh9NgQ/G0tpMG0wHtV3PLU6TOqAbYRmzTtHHHBXBfN/BTVe6ekmVbH + NNho2MkDNNT3JkpNZDX6VXkeg8xx9LuzevzVenb50R/dtMKzH0S/CZWLrIBniCE28Zqo37AK0+AJ + rTTAJHAyv4KhcNypyoFDLEpY5erfoTs0tV5rYIbweEdNgC37D2Xv3pPG+q9fhRNa0wJraMxxCFZ/ + o6UeZfx9gPofmMI0qdXjzNGk8YsXN8mhazQOaRDp6OliP6jh8Q5NhC/fnRo2nk2YbtypYzA4u+p+ + nx52cDIaBdh3ybuRJ36hjKPJcngCfwniekSQZG2ZBVvb40KAhhvCbrItk1fXt8Kyhyb7E9d9Dz9X + MJdC3a5Jxrq/yEvVF2BVhwq5dD9R62KrsL/EMgMMsImvd8nnIx0fuUhpzBKjZymFp5j20pe+zWtE + gR43jAHc6or5Ebw9yR/c386VCpzkMtg6UgLognWxLmbj3A3XhkmQcFQk5OnmAsH25SLpcCCWMcRO + 0/sSuXKDNM2J5gQdCvxymhkR/RE7x6ax86nuQGN7RyDSfQHP6rGSkLvekJUc1zkgik6BQYsYjv1C + 14CHJdUrefxwN7e4DyiTZBsKWkGfgVhQ2da/Fu9aXUPzBUXDfqY+wee+RsN8GtCb5PO/R6fXyeSW + 2q83eDA9di330kKKaiNLEIuXl5/j7z/mrXKeLJWjJj7511be/s12nrKRI3ExTB1iAFwjAkL3SqAj + WsZX0D6z2MrlJ42f8VwD/nOFVJKy1ELvaZ4PZdWP0jvFc0nJcWrqPRQ6um6zrJy3CVMlME8GAbb1 + Zd4hM1w9yWOrYucbgaoKjJn0rpS6NM6WeEdBzx+0keQMvjwwrnEJ6Hskk7PH6PEgadzIulV3pqF2 + d48Gw6uVxD2xtPBfqcH+nuT1Tyk5ZM/jLej5Lq42bSgt5757dZ3tSV3dWu+UAboy/BaMhrAynoP8 + Jij0lDH3FKPeiBty51hvOIA28c4vKRO3R/br6Ve0CYCZw4gWdzfGmtgSQidhG6RvgHTeN26Lf5zc + ZZbpuj19FE9GfzNEscORnY6Wnei2Fei6Nea84hOwTINb70OSHOiK+WUdnwpJecU8I+JS9x3k9w== + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - a2dc601c-d67d-11e9-9abd-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob79ab16d0 + response: + body: + string: '' + headers: + Content-Length: + - '0' + Content-MD5: + - plkxPH9S8qpIjJWislFakQ== + Date: + - Fri, 13 Sep 2019 23:24:30 GMT + ETag: + - '"0x8D738A18746D7AA"' + Last-Modified: + - Fri, 13 Sep 2019 23:24:30 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - a2dc601c-d67d-11e9-9abd-001a7dda7113 + x-ms-content-crc64: + - 3MqQYTPeZoA= + x-ms-request-id: + - c8ec2e6f-c01e-0026-098a-6ada23000000 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + 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.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Archive + x-ms-client-request-id: + - a31e4c1e-d67d-11e9-91fa-001a7dda7113 + x-ms-copy-source: + - https://emilystageaccount.blob.core.windows.net/utcontainer79ab16d0/blob79ab16d0 + x-ms-date: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-rehydrate-priority: + - High + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob1copy + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 23:24:30 GMT + ETag: + - '"0x8D738A1875D93E4"' + Last-Modified: + - Fri, 13 Sep 2019 23:24:30 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - a31e4c1e-d67d-11e9-91fa-001a7dda7113 + x-ms-copy-id: + - e4038849-a2f2-4c1b-92e9-5965efd90f4d + x-ms-copy-status: + - success + x-ms-request-id: + - c8ec2e75-c01e-0026-0e8a-6ada23000000 + x-ms-version: + - '2019-02-02' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - a335bea8-d67d-11e9-b8b2-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob1copy + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '1024' + Content-MD5: + - plkxPH9S8qpIjJWislFakQ== + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 23:24:30 GMT + ETag: + - '"0x8D738A1875D93E4"' + Last-Modified: + - Fri, 13 Sep 2019 23:24:30 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Archive + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - a335bea8-d67d-11e9-b8b2-001a7dda7113 + x-ms-copy-completion-time: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-copy-id: + - e4038849-a2f2-4c1b-92e9-5965efd90f4d + x-ms-copy-progress: + - 1024/1024 + x-ms-copy-source: + - https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob79ab16d0 + x-ms-copy-status: + - success + x-ms-creation-time: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - c8ec2e7c-c01e-0026-148a-6ada23000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Hot + x-ms-client-request-id: + - a348fbc2-d67d-11e9-aa7b-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:31 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob1copy?comp=tier + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Fri, 13 Sep 2019 23:24:30 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - a348fbc2-d67d-11e9-aa7b-001a7dda7113 + x-ms-request-id: + - c8ec2e7e-c01e-0026-168a-6ada23000000 + x-ms-version: + - '2019-02-02' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - a35c0f24-d67d-11e9-93e0-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:31 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob1copy + response: + body: + string: '' + headers: + Accept-Ranges: + - bytes + Content-Length: + - '1024' + Content-MD5: + - plkxPH9S8qpIjJWislFakQ== + Content-Type: + - application/octet-stream + Date: + - Fri, 13 Sep 2019 23:24:30 GMT + ETag: + - '"0x8D738A1875D93E4"' + Last-Modified: + - Fri, 13 Sep 2019 23:24:30 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Vary: + - Origin + x-ms-access-tier: + - Archive + x-ms-access-tier-change-time: + - Fri, 13 Sep 2019 23:24:31 GMT + x-ms-archive-status: + - rehydrate-pending-to-hot + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - a35c0f24-d67d-11e9-93e0-001a7dda7113 + x-ms-copy-completion-time: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-copy-id: + - e4038849-a2f2-4c1b-92e9-5965efd90f4d + x-ms-copy-progress: + - 1024/1024 + x-ms-copy-source: + - https://storagename.blob.core.windows.net/utcontainer79ab16d0/blob79ab16d0 + x-ms-copy-status: + - success + x-ms-creation-time: + - Fri, 13 Sep 2019 23:24:30 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-request-id: + - c8ec2e82-c01e-0026-1a8a-6ada23000000 + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_rehydrate_priority_async.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_rehydrate_priority_async.yaml new file mode 100644 index 000000000000..ac3c8bced2e0 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_copy_blob_with_rehydrate_priority_async.yaml @@ -0,0 +1,372 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - a7acb43a-d67d-11e9-a67d-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:38 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraba71bca?timeout=5&restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:37 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18C0B5D6C"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a7acb43a-d67d-11e9-a67d-001a7dda7113 + x-ms-request-id: 9a9ae2b7-d01e-0015-2e8a-6a8588000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraba71bca + - timeout=5&restype=container + - '' +- request: + body: !!binary | + vq3OTlb3ZEp1IGKNrcOjPsD7PO75aApL4WVSk8HoI05GptZE74Y3RUMA6QjBlhpMX4KR1r3cwA1O + 3SgUEr9FrlQc6REuflqVc7AY1faAzylRw+7huhjpodpnIE48aeQBUxgvqt0lcdgCLoo7s6JKIp2L + 5ZXlLxU6AXStM/w9dX5Y67NIgyKPghy3DDXsDjUpBQ8xSpw0hWQ5NEvIHRr7BBtZNxNKOJqv6PYA + wPGZw5ggk99poNMKX+GEqA3IKNkKO0h7/MkWQMmug5k9eFP+ZTIikHUalSYNZprKKkLtTeSuXELd + X8DeTEeCiTO12KnQE59XI4MXkr2iG40fHvrIuGpYnRB3EYPLYQH8I4XIcyiuPQ4Rl9c6U6JI6pni + 8U3Zsef7O/fCal+P7Fgz3af2Fo7SDeKqAFRTu72UBNCfva2RNM+G2EZkg8fEghKvqorNGF5P7qOL + WFoTpPNgpFexYBQtjFnOK+JylDT+PDH4VvBhxbDyWYSOmCBwbYF2R0ZZae+S/aIEmcOwvA8T+iV7 + /sQjzDwZrPBhhwdxNNBXLdy4m75yvj1Wv3cVHwZhAjIeAZ9B/TUJuIyzEw4IQQ0rcCx6eMnNXDmf + UHOtqXA6UfqXGi65fSxno4fgvidH6nn2p2iZSI2Ol9Aj7QFXSY9ksIif8z0IxpS3BXHIqCe4cowO + 0+v+qYOjXM+Ht7DHUoJRyj8SltHJzEz9morDAsbKSOnFwtbycaYeROhOulZHv2sydW5XGzDhK9bZ + LoEstcRbYw4OB8t8h8YXHjVw1S4ZKSdLMd32wHoFhyb0X/zBJB2kK0BFn7v1dObdeCc02FYuL1do + /lFjrGhDC2D1kNg69LDI0CmQH8VR21TReOTeXo3+OFx4YVaQXNXmQNxpYHZoHATn7yzQXa2mbAIe + uioIkufgTYhMGeIWe+ONrJ0QsRIJ2GttOblUSjmDrneri2svbIm1+yIFki0cvbR4lruzPqHfPH1R + bhFdTo9LD7uXlfTr1rk1meICiquGiSvOjUJWKkmmQPLLqs8YhX7RHF9+HJ2ft1q/41XoIs2NRIP7 + WkyXqbnJZ9TQ+G7WLjyThKXYrKPOxix7hhPeUBqlKB23zUUAaGwSFlQTOk7bVYJwQ6e8rL7Xv76g + HvLM5LXTgXF5sUd5k7jcnfnDyQHZkx8i9RCSHVZ4Omx/tFnwNVueoK53AVSb7y7OW/qUgNSZB1Fz + BwS35OjVziKfjqvzwZL3T96YNsr2v3NHx9tqThuY5BNVyfQCtuZzUpFRxUVUXYIs3rlN3oJ4/rJH + Rv1ml0v23VXuBrLFpdkL9rBwiLPvsyer5/KgmXLlXkulVa3A+LLXqSlhybOiHUBc9Q0BWnbhZA== + headers: + Content-Length: + - '1024' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-client-request-id: + - a7e4fc90-d67d-11e9-b514-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:38 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraba71bca/blobaba71bca + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : ZWF0eFQPprsR1KlKlh0zcg== + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:37 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18C1C0AAA"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a7e4fc90-d67d-11e9-b514-001a7dda7113 + x-ms-content-crc64: ONyLf1JvQPw= + x-ms-request-id: 9a9ae2b9-d01e-0015-2f8a-6a8588000000 + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraba71bca/blobaba71bca + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Archive + x-ms-client-request-id: + - a7f34b14-d67d-11e9-b0a1-001a7dda7113 + x-ms-copy-source: + - https://emilystageaccount.blob.core.windows.net/utcontaineraba71bca/blobaba71bca + x-ms-date: + - Fri, 13 Sep 2019 23:24:38 GMT + x-ms-rehydrate-priority: + - High + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraba71bca/blob1copy + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18C302F05"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a7f34b14-d67d-11e9-b0a1-001a7dda7113 + x-ms-copy-id: 1b480c9e-8b63-439b-a60a-3dbabf4bbe0d + x-ms-copy-status: success + x-ms-request-id: 9a9ae2bd-d01e-0015-328a-6a8588000000 + x-ms-version: '2019-02-02' + status: + code: 202 + message: Accepted + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraba71bca/blob1copy + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - a808051c-d67d-11e9-8b44-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:38 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontaineraba71bca/blob1copy + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '1024' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : ZWF0eFQPprsR1KlKlh0zcg== + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18C302F05"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Archive + x-ms-access-tier-change-time: Fri, 13 Sep 2019 23:24:38 GMT + x-ms-blob-type: BlockBlob + x-ms-client-request-id: a808051c-d67d-11e9-8b44-001a7dda7113 + x-ms-copy-completion-time: Fri, 13 Sep 2019 23:24:38 GMT + x-ms-copy-id: 1b480c9e-8b63-439b-a60a-3dbabf4bbe0d + x-ms-copy-progress: 1024/1024 + x-ms-copy-source: https://storagename.blob.core.windows.net/utcontaineraba71bca/blobaba71bca + x-ms-copy-status: success + x-ms-creation-time: Fri, 13 Sep 2019 23:24:38 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: 9a9ae2c1-d01e-0015-368a-6a8588000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraba71bca/blob1copy + - '' + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-access-tier: + - Hot + x-ms-client-request-id: + - a814817a-d67d-11e9-85b7-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:39 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontaineraba71bca/blob1copy?comp=tier + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:39 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: a814817a-d67d-11e9-85b7-001a7dda7113 + x-ms-request-id: dff518aa-601e-003f-2e8a-6a5a98000000 + x-ms-version: '2019-02-02' + status: + code: 202 + message: Accepted + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraba71bca/blob1copy + - comp=tier + - '' +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b3 Python/3.7.3 (Windows-10-10.0.18362-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - a845bb46-d67d-11e9-90d3-001a7dda7113 + x-ms-date: + - Fri, 13 Sep 2019 23:24:39 GMT + x-ms-version: + - '2019-02-02' + method: HEAD + uri: https://storagename.blob.core.windows.net/utcontaineraba71bca/blob1copy + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Accept-Ranges + : bytes + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '1024' + ? !!python/object/new:multidict._istr.istr + - Content-Md5 + : ZWF0eFQPprsR1KlKlh0zcg== + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/octet-stream + ? !!python/object/new:multidict._istr.istr + - Date + : Fri, 13 Sep 2019 23:24:39 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D738A18C302F05"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Fri, 13 Sep 2019 23:24:38 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-access-tier: Archive + x-ms-access-tier-change-time: Fri, 13 Sep 2019 23:24:39 GMT + x-ms-archive-status: rehydrate-pending-to-hot + x-ms-blob-type: BlockBlob + x-ms-client-request-id: a845bb46-d67d-11e9-90d3-001a7dda7113 + x-ms-copy-completion-time: Fri, 13 Sep 2019 23:24:38 GMT + x-ms-copy-id: 1b480c9e-8b63-439b-a60a-3dbabf4bbe0d + x-ms-copy-progress: 1024/1024 + x-ms-copy-source: https://storagename.blob.core.windows.net/utcontaineraba71bca/blobaba71bca + x-ms-copy-status: success + x-ms-creation-time: Fri, 13 Sep 2019 23:24:38 GMT + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-request-id: dff518af-601e-003f-318a-6a5a98000000 + x-ms-server-encrypted: 'true' + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - emilystageaccount.blob.core.windows.net + - /utcontaineraba71bca/blob1copy + - '' + - '' +version: 1