Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage][Blob]Fix live test and if tags bug #13054

Merged
merged 6 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


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

## 12.4.0 (2020-08-12)
**New features**
- Added support for Object Replication Service on `list_blobs` and `get_blob_properties`.
- Added more support for blob tags. Added `if_tags_match_condition` that allow a user to specify a SQL statement for the blob's tags to satisfy.
- Added support for setting and getting the `default_index_document_path` of `StaticWebsite` property on the service client.
- Added `rehydrate_priority` to BlobProperties.
- Added support to seal an append blob. Added `test_seal_append_blob`. Added ability to specify `seal_destination_blob` on `start_copy_from_url`. `is_append_blob_sealed` property returned on get_blob_properties/download_blob/list_blobs.
- Added support to set tier on a snapshot or version.

**Fixes**
- Fixed the bug when parsing blob url with '/' in blob name.
- Support batch delete empty blob list.
- Fixed `blob_samples_query` bug.

## 12.4.0b1 (2020-07-07)
**New features**
- Added `query_blob` API to enable users to select/project on block blob or block blob snapshot data by providing simple query expressions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ def _generate_delete_blobs_options(self,
delete_snapshots = kwargs.pop('delete_snapshots', None)
if_modified_since = kwargs.pop('if_modified_since', None)
if_unmodified_since = kwargs.pop('if_unmodified_since', None)
if_tags = kwargs.pop('if_tags_match_condition', None)
if_tags_match_condition = kwargs.pop('if_tags_match_condition', None)
kwargs.update({'raise_on_any_failure': raise_on_any_failure,
'sas': self._query_str.replace('?', '&'),
'timeout': '&timeout=' + str(timeout) if timeout else ""
Expand All @@ -1080,7 +1080,7 @@ def _generate_delete_blobs_options(self,
if_modified_since=if_modified_since or blob.get('if_modified_since'),
if_unmodified_since=if_unmodified_since or blob.get('if_unmodified_since'),
etag=blob.get('etag'),
if_tags=if_tags or blob.get('if_tags_match_condition'),
if_tags_match_condition=if_tags_match_condition or blob.get('if_tags_match_condition'),
match_condition=blob.get('match_condition') or MatchConditions.IfNotModified if blob.get('etag')
else None,
timeout=blob.get('timeout'),
Expand All @@ -1090,7 +1090,7 @@ def _generate_delete_blobs_options(self,
delete_snapshots=delete_snapshots,
if_modified_since=if_modified_since,
if_unmodified_since=if_unmodified_since,
if_tags=if_tags
if_tags_match_condition=if_tags_match_condition
)

query_parameters, header_parameters = self._generate_delete_blobs_subrequest_options(**options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,9 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, ti
source_if_none_match = None
if source_modified_access_conditions is not None:
source_if_none_match = source_modified_access_conditions.source_if_none_match
source_if_tags = None
if source_modified_access_conditions is not None:
source_if_tags = source_modified_access_conditions.source_if_tags
if_modified_since = None
if modified_access_conditions is not None:
if_modified_since = modified_access_conditions.if_modified_since
Expand Down Expand Up @@ -2215,6 +2218,8 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, ti
header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str')
if source_if_none_match is not None:
header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str')
if source_if_tags is not None:
header_parameters['x-ms-source-if-tags'] = self._serialize.header("source_if_tags", source_if_tags, 'str')
if if_modified_since is not None:
header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123')
if if_unmodified_since is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1723,13 +1723,17 @@ class SourceModifiedAccessConditions(Model):
:param source_if_none_match: Specify an ETag value to operate only on
blobs without a matching value.
:type source_if_none_match: str
:param source_if_tags: Specify a SQL where clause on blob tags to operate
only on blobs with a matching value.
:type source_if_tags: str
"""

_attribute_map = {
'source_if_modified_since': {'key': '', 'type': 'rfc-1123', 'xml': {'name': 'source_if_modified_since'}},
'source_if_unmodified_since': {'key': '', 'type': 'rfc-1123', 'xml': {'name': 'source_if_unmodified_since'}},
'source_if_match': {'key': '', 'type': 'str', 'xml': {'name': 'source_if_match'}},
'source_if_none_match': {'key': '', 'type': 'str', 'xml': {'name': 'source_if_none_match'}},
'source_if_tags': {'key': '', 'type': 'str', 'xml': {'name': 'source_if_tags'}},
}
_xml_map = {
}
Expand All @@ -1740,6 +1744,7 @@ def __init__(self, **kwargs):
self.source_if_unmodified_since = kwargs.get('source_if_unmodified_since', None)
self.source_if_match = kwargs.get('source_if_match', None)
self.source_if_none_match = kwargs.get('source_if_none_match', None)
self.source_if_tags = kwargs.get('source_if_tags', None)


class StaticWebsite(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1723,23 +1723,28 @@ class SourceModifiedAccessConditions(Model):
:param source_if_none_match: Specify an ETag value to operate only on
blobs without a matching value.
:type source_if_none_match: str
:param source_if_tags: Specify a SQL where clause on blob tags to operate
only on blobs with a matching value.
:type source_if_tags: str
"""

_attribute_map = {
'source_if_modified_since': {'key': '', 'type': 'rfc-1123', 'xml': {'name': 'source_if_modified_since'}},
'source_if_unmodified_since': {'key': '', 'type': 'rfc-1123', 'xml': {'name': 'source_if_unmodified_since'}},
'source_if_match': {'key': '', 'type': 'str', 'xml': {'name': 'source_if_match'}},
'source_if_none_match': {'key': '', 'type': 'str', 'xml': {'name': 'source_if_none_match'}},
'source_if_tags': {'key': '', 'type': 'str', 'xml': {'name': 'source_if_tags'}},
}
_xml_map = {
}

def __init__(self, *, source_if_modified_since=None, source_if_unmodified_since=None, source_if_match: str=None, source_if_none_match: str=None, **kwargs) -> None:
def __init__(self, *, source_if_modified_since=None, source_if_unmodified_since=None, source_if_match: str=None, source_if_none_match: str=None, source_if_tags: str=None, **kwargs) -> None:
super(SourceModifiedAccessConditions, self).__init__(**kwargs)
self.source_if_modified_since = source_if_modified_since
self.source_if_unmodified_since = source_if_unmodified_since
self.source_if_match = source_if_match
self.source_if_none_match = source_if_none_match
self.source_if_tags = source_if_tags


class StaticWebsite(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2159,6 +2159,9 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, tier=Non
source_if_none_match = None
if source_modified_access_conditions is not None:
source_if_none_match = source_modified_access_conditions.source_if_none_match
source_if_tags = None
if source_modified_access_conditions is not None:
source_if_tags = source_modified_access_conditions.source_if_tags
if_modified_since = None
if modified_access_conditions is not None:
if_modified_since = modified_access_conditions.if_modified_since
Expand Down Expand Up @@ -2214,6 +2217,8 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, tier=Non
header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str')
if source_if_none_match is not None:
header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str')
if source_if_tags is not None:
header_parameters['x-ms-source-if-tags'] = self._serialize.header("source_if_tags", source_if_tags, 'str')
if if_modified_since is not None:
header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123')
if if_unmodified_since is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "12.4.0b1"
VERSION = "12.4.0"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainercab0131c?restype=container
uri: https://storagenamestorname.blob.core.windows.net/utcontainercab0131c?restype=container
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerAlreadyExists</Code><Message>The
Expand Down Expand Up @@ -56,7 +56,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainersourcecab0131c?restype=container
uri: https://storagenamestorname.blob.core.windows.net/utcontainersourcecab0131c?restype=container
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerAlreadyExists</Code><Message>The
Expand Down Expand Up @@ -99,7 +99,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainercab0131c/blobcab0131c
uri: https://storagenamestorname.blob.core.windows.net/utcontainercab0131c/blobcab0131c
response:
body:
string: ''
Expand Down Expand Up @@ -146,7 +146,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainercab0131c/blobcab0131c?comp=appendblock
uri: https://storagenamestorname.blob.core.windows.net/utcontainercab0131c/blobcab0131c?comp=appendblock
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
Expand Down Expand Up @@ -190,7 +190,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainercab0131c/blobcab0131c?comp=appendblock
uri: https://storagenamestorname.blob.core.windows.net/utcontainercab0131c/blobcab0131c?comp=appendblock
response:
body:
string: ''
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainer47fb1599?restype=container
uri: https://storagenamestorname.blob.core.windows.net/utcontainer47fb1599?restype=container
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerAlreadyExists</Code><Message>The
Expand Down Expand Up @@ -41,7 +41,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainer47fb1599/blob47fb1599
uri: https://storagenamestorname.blob.core.windows.net/utcontainer47fb1599/blob47fb1599
response:
body:
string: ''
Expand Down Expand Up @@ -75,7 +75,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainer47fb1599/blob47fb1599?comp=appendblock
uri: https://storagenamestorname.blob.core.windows.net/utcontainer47fb1599/blob47fb1599?comp=appendblock
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
Expand Down Expand Up @@ -108,7 +108,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainer47fb1599/blob47fb1599?comp=appendblock
uri: https://storagenamestorname.blob.core.windows.net/utcontainer47fb1599/blob47fb1599?comp=appendblock
response:
body:
string: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainera4381254?restype=container
uri: https://storagenamestorname.blob.core.windows.net/utcontainera4381254?restype=container
response:
body:
string: ''
Expand Down Expand Up @@ -63,7 +63,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainera4381254/bloba4381254
uri: https://storagenamestorname.blob.core.windows.net/utcontainera4381254/bloba4381254
response:
body:
string: ''
Expand Down Expand Up @@ -109,7 +109,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: GET
uri: https://storagename.blob.core.windows.net/utcontainera4381254/bloba4381254?blocklisttype=all&comp=blocklist
uri: https://storagenamestorname.blob.core.windows.net/utcontainera4381254/bloba4381254?blocklisttype=all&comp=blocklist
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
Expand Down Expand Up @@ -148,7 +148,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: GET
uri: https://storagename.blob.core.windows.net/utcontainera4381254/bloba4381254?blocklisttype=all&comp=blocklist
uri: https://storagenamestorname.blob.core.windows.net/utcontainera4381254/bloba4381254?blocklisttype=all&comp=blocklist
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><BlockList><CommittedBlocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainer1c7814d1?restype=container
uri: https://storagenamestorname.blob.core.windows.net/utcontainer1c7814d1?restype=container
response:
body:
string: ''
Expand Down Expand Up @@ -44,7 +44,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: PUT
uri: https://storagename.blob.core.windows.net/utcontainer1c7814d1/blob1c7814d1
uri: https://storagenamestorname.blob.core.windows.net/utcontainer1c7814d1/blob1c7814d1
response:
body:
string: ''
Expand Down Expand Up @@ -77,7 +77,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: GET
uri: https://storagename.blob.core.windows.net/utcontainer1c7814d1/blob1c7814d1?blocklisttype=all&comp=blocklist
uri: https://storagenamestorname.blob.core.windows.net/utcontainer1c7814d1/blob1c7814d1?blocklisttype=all&comp=blocklist
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
Expand Down Expand Up @@ -107,7 +107,7 @@ interactions:
x-ms-version:
- '2019-12-12'
method: GET
uri: https://storagename.blob.core.windows.net/utcontainer1c7814d1/blob1c7814d1?blocklisttype=all&comp=blocklist
uri: https://storagenamestorname.blob.core.windows.net/utcontainer1c7814d1/blob1c7814d1?blocklisttype=all&comp=blocklist
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><BlockList><CommittedBlocks
Expand Down
Loading