Skip to content

Commit

Permalink
[Storage]API Review Comments (#14019)
Browse files Browse the repository at this point in the history
* [Storage]API Review Comments

* move new_name for undelete_container to kwargs
  • Loading branch information
xiafu-msft authored Sep 24, 2020
1 parent 8a567ed commit adfee50
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 78 deletions.
51 changes: 26 additions & 25 deletions sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def upload_blob( # pylint: disable=too-many-locals
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -636,7 +636,7 @@ def download_blob(self, offset=None, length=None, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -729,7 +729,7 @@ def query_blob(self, query_expression, **kwargs):
:param str query_expression:
Required. a query statement.
:keyword Callable[Exception] on_error:
:keyword Callable[~azure.storage.blob.BlobQueryError] on_error:
A function to be called on any processing errors returned by the service.
:keyword blob_format:
Optional. Defines the serialization of the data currently stored in the blob. The default is to
Expand All @@ -740,7 +740,8 @@ def query_blob(self, query_expression, **kwargs):
Optional. Defines the output serialization for the data stream. By default the data will be returned
as it is represented in the blob. By providing an output format, the blob data will be reformatted
according to that profile. This value can be a DelimitedTextDialect or a DelimitedJsonDialect.
:paramtype output_format: ~azure.storage.blob.DelimitedTextDialect or ~azure.storage.blob.DelimitedJsonDialect
:paramtype output_format: ~azure.storage.blob.DelimitedTextDialect, ~azure.storage.blob.DelimitedJsonDialect
or list[~azure.storage.blob.ArrowDialect]
:keyword lease:
Required if the blob has an active lease. Value can be a BlobLeaseClient object
or the lease ID as a string.
Expand All @@ -762,7 +763,7 @@ def query_blob(self, query_expression, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -879,7 +880,7 @@ def delete_blob(self, delete_snapshots=False, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -989,7 +990,7 @@ def get_blob_properties(self, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -1095,7 +1096,7 @@ def set_http_headers(self, content_settings=None, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -1169,7 +1170,7 @@ def set_blob_metadata(self, metadata=None, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -1516,7 +1517,7 @@ def create_snapshot(self, metadata=None, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on destination blob with a matching value.
.. versionadded:: 12.4.0
Expand Down Expand Up @@ -1834,7 +1835,7 @@ def acquire_lease(self, lease_duration=-1, lease_id=None, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -1882,7 +1883,7 @@ def set_standard_blob_tier(self, standard_blob_tier, **kwargs):
.. versionadded:: 12.4.0
This keyword argument was introduced in API version '2019-12-12'.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -2141,7 +2142,7 @@ def get_block_list(self, block_list_type="committed", **kwargs):
Required if the blob has an active lease. Value can be a BlobLeaseClient object
or the lease ID as a string.
:paramtype lease: ~azure.storage.blob.BlobLeaseClient or str
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on destination blob with a matching value.
.. versionadded:: 12.4.0
Expand Down Expand Up @@ -2287,7 +2288,7 @@ def commit_block_list( # type: ignore
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on destination blob with a matching value.
.. versionadded:: 12.4.0
Expand Down Expand Up @@ -2333,7 +2334,7 @@ def set_premium_page_blob_tier(self, premium_page_blob_tier, **kwargs):
blob and number of allowed IOPS. This is only applicable to page blobs on
premium storage accounts.
:type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -2402,7 +2403,7 @@ def set_blob_tags(self, tags=None, **kwargs):
bitflips on the wire if using http instead of https, as https (the default),
will already validate. Note that this MD5 hash is not stored with the
blob.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on destination blob with a matching value.
:keyword int timeout:
The timeout parameter is expressed in seconds.
Expand Down Expand Up @@ -2438,7 +2439,7 @@ def get_blob_tags(self, **kwargs):
:keyword str version_id:
The version id parameter is an opaque DateTime
value that, when present, specifies the version of the blob to add tags to.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on destination blob with a matching value.
:keyword int timeout:
The timeout parameter is expressed in seconds.
Expand Down Expand Up @@ -2535,7 +2536,7 @@ def get_page_ranges( # type: ignore
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -2684,7 +2685,7 @@ def set_sequence_number(self, sequence_number_action, sequence_number=None, **kw
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -2758,7 +2759,7 @@ def resize_blob(self, size, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -2888,7 +2889,7 @@ def upload_page( # type: ignore
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -3060,7 +3061,7 @@ def upload_pages_from_url(self, source_url, # type: str
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The destination match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -3177,7 +3178,7 @@ def clear_page(self, offset, length, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -3307,7 +3308,7 @@ def append_block( # type: ignore
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -3454,7 +3455,7 @@ def append_block_from_url(self, copy_source_url, # type: str
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The destination match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def delete_container(
**kwargs)

@distributed_trace
def undelete_container(self, deleted_container_name, deleted_container_version, new_name=None, **kwargs):
def undelete_container(self, deleted_container_name, deleted_container_version, **kwargs):
# type: (str, str, str, **Any) -> ContainerClient
"""Restores soft-deleted container.
Expand All @@ -578,12 +578,14 @@ def undelete_container(self, deleted_container_name, deleted_container_version,
Specifies the name of the deleted container to restore.
:param str deleted_container_version:
Specifies the version of the deleted container to restore.
:param str new_name:
:keyword str new_name:
The new name for the deleted container to be restored to.
If not specified deleted_container_name will be used as the restored container name.
:keyword int timeout:
The timeout parameter is expressed in seconds.
:rtype: ~azure.storage.blob.ContainerClient
"""
new_name = kwargs.pop('new_name', None)
container = self.get_container_client(new_name or deleted_container_name)
try:
container._client.container.restore(deleted_container_name=deleted_container_name, # pylint: disable = protected-access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def upload_blob(
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -898,7 +898,7 @@ def delete_blob(
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -963,7 +963,7 @@ def download_blob(self, blob, offset=None, length=None, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -1163,7 +1163,7 @@ def delete_blobs(self, *blobs, **kwargs):
If a date is passed in without timezone info, it is assumed to be UTC.
Specify this header to perform the operation only if
the resource has not been modified since the specified date/time.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -1332,7 +1332,7 @@ def set_standard_blob_tier_blobs(
:type blobs: list[str], list[dict], or list[~azure.storage.blob.BlobProperties]
:keyword ~azure.storage.blob.RehydratePriority rehydrate_priority:
Indicates the priority with which to rehydrate an archived blob
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down
10 changes: 5 additions & 5 deletions sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def acquire(self, lease_duration=-1, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -149,7 +149,7 @@ def renew(self, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -199,7 +199,7 @@ def release(self, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -248,7 +248,7 @@ def change(self, proposed_lease_id, **kwargs):
and act according to the condition specified by the `match_condition` parameter.
:keyword ~azure.core.MatchConditions match_condition:
The match condition to use upon the etag.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down Expand Up @@ -307,7 +307,7 @@ def break_lease(self, lease_break_period=None, **kwargs):
If a date is passed in without timezone info, it is assumed to be UTC.
Specify this header to perform the operation only if
the resource has not been modified since the specified date/time.
:keyword str if_tags_match_condition
:keyword str if_tags_match_condition:
Specify a SQL where clause on blob tags to operate only on blob with a matching value.
eg. "\"tagname\"='my tag'"
Expand Down
Loading

0 comments on commit adfee50

Please sign in to comment.