azure-storage-blob 12.21.0b1__py3-none-any.whl → 12.23.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- azure/storage/blob/__init__.py +19 -18
- azure/storage/blob/_blob_client.py +470 -1555
- azure/storage/blob/_blob_client_helpers.py +1242 -0
- azure/storage/blob/_blob_service_client.py +93 -112
- azure/storage/blob/_blob_service_client_helpers.py +27 -0
- azure/storage/blob/_container_client.py +176 -377
- azure/storage/blob/_container_client_helpers.py +266 -0
- azure/storage/blob/_deserialize.py +68 -44
- azure/storage/blob/_download.py +375 -241
- azure/storage/blob/_encryption.py +14 -7
- azure/storage/blob/_generated/_azure_blob_storage.py +2 -1
- azure/storage/blob/_generated/_serialization.py +2 -0
- azure/storage/blob/_generated/aio/_azure_blob_storage.py +2 -1
- azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +1 -7
- azure/storage/blob/_generated/aio/operations/_blob_operations.py +21 -47
- azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +2 -10
- azure/storage/blob/_generated/aio/operations/_container_operations.py +13 -26
- azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +3 -14
- azure/storage/blob/_generated/aio/operations/_service_operations.py +14 -17
- azure/storage/blob/_generated/operations/_append_blob_operations.py +1 -7
- azure/storage/blob/_generated/operations/_blob_operations.py +21 -47
- azure/storage/blob/_generated/operations/_block_blob_operations.py +2 -10
- azure/storage/blob/_generated/operations/_container_operations.py +13 -26
- azure/storage/blob/_generated/operations/_page_blob_operations.py +3 -14
- azure/storage/blob/_generated/operations/_service_operations.py +14 -17
- azure/storage/blob/_generated/py.typed +1 -0
- azure/storage/blob/_lease.py +52 -63
- azure/storage/blob/_list_blobs_helper.py +129 -135
- azure/storage/blob/_models.py +480 -277
- azure/storage/blob/_quick_query_helper.py +30 -31
- azure/storage/blob/_serialize.py +39 -56
- azure/storage/blob/_shared/avro/datafile.py +1 -1
- azure/storage/blob/_shared/avro/datafile_async.py +1 -1
- azure/storage/blob/_shared/base_client.py +3 -1
- azure/storage/blob/_shared/base_client_async.py +1 -1
- azure/storage/blob/_shared/policies.py +16 -15
- azure/storage/blob/_shared/policies_async.py +21 -6
- azure/storage/blob/_shared/response_handlers.py +6 -2
- azure/storage/blob/_shared/shared_access_signature.py +21 -3
- azure/storage/blob/_shared/uploads.py +1 -1
- azure/storage/blob/_shared/uploads_async.py +1 -1
- azure/storage/blob/_shared_access_signature.py +110 -52
- azure/storage/blob/_upload_helpers.py +75 -68
- azure/storage/blob/_version.py +1 -1
- azure/storage/blob/aio/__init__.py +19 -11
- azure/storage/blob/aio/_blob_client_async.py +554 -301
- azure/storage/blob/aio/_blob_service_client_async.py +148 -97
- azure/storage/blob/aio/_container_client_async.py +289 -140
- azure/storage/blob/aio/_download_async.py +485 -337
- azure/storage/blob/aio/_lease_async.py +61 -60
- azure/storage/blob/aio/_list_blobs_helper.py +94 -96
- azure/storage/blob/aio/_models.py +60 -38
- azure/storage/blob/aio/_upload_helpers.py +75 -66
- {azure_storage_blob-12.21.0b1.dist-info → azure_storage_blob-12.23.0.dist-info}/METADATA +7 -7
- azure_storage_blob-12.23.0.dist-info/RECORD +84 -0
- {azure_storage_blob-12.21.0b1.dist-info → azure_storage_blob-12.23.0.dist-info}/WHEEL +1 -1
- azure/storage/blob/_generated/_vendor.py +0 -16
- azure_storage_blob-12.21.0b1.dist-info/RECORD +0 -81
- {azure_storage_blob-12.21.0b1.dist-info → azure_storage_blob-12.23.0.dist-info}/LICENSE +0 -0
- {azure_storage_blob-12.21.0b1.dist-info → azure_storage_blob-12.23.0.dist-info}/top_level.txt +0 -0
@@ -15,17 +15,17 @@ from azure.core.exceptions import (
|
|
15
15
|
ResourceExistsError,
|
16
16
|
ResourceNotFoundError,
|
17
17
|
ResourceNotModifiedError,
|
18
|
+
StreamClosedError,
|
19
|
+
StreamConsumedError,
|
18
20
|
map_error,
|
19
21
|
)
|
20
22
|
from azure.core.pipeline import PipelineResponse
|
21
|
-
from azure.core.
|
22
|
-
from azure.core.rest import HttpRequest
|
23
|
+
from azure.core.rest import HttpRequest, HttpResponse
|
23
24
|
from azure.core.tracing.decorator import distributed_trace
|
24
25
|
from azure.core.utils import case_insensitive_dict
|
25
26
|
|
26
27
|
from .. import models as _models
|
27
28
|
from .._serialization import Serializer
|
28
|
-
from .._vendor import _convert_request
|
29
29
|
|
30
30
|
if sys.version_info >= (3, 9):
|
31
31
|
from collections.abc import MutableMapping
|
@@ -427,7 +427,6 @@ class ServiceOperations:
|
|
427
427
|
headers=_headers,
|
428
428
|
params=_params,
|
429
429
|
)
|
430
|
-
_request = _convert_request(_request)
|
431
430
|
_request.url = self._client.format_url(_request.url)
|
432
431
|
|
433
432
|
_stream = False
|
@@ -497,7 +496,6 @@ class ServiceOperations:
|
|
497
496
|
headers=_headers,
|
498
497
|
params=_params,
|
499
498
|
)
|
500
|
-
_request = _convert_request(_request)
|
501
499
|
_request.url = self._client.format_url(_request.url)
|
502
500
|
|
503
501
|
_stream = False
|
@@ -519,7 +517,7 @@ class ServiceOperations:
|
|
519
517
|
response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
|
520
518
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
521
519
|
|
522
|
-
deserialized = self._deserialize("StorageServiceProperties", pipeline_response)
|
520
|
+
deserialized = self._deserialize("StorageServiceProperties", pipeline_response.http_response)
|
523
521
|
|
524
522
|
if cls:
|
525
523
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -572,7 +570,6 @@ class ServiceOperations:
|
|
572
570
|
headers=_headers,
|
573
571
|
params=_params,
|
574
572
|
)
|
575
|
-
_request = _convert_request(_request)
|
576
573
|
_request.url = self._client.format_url(_request.url)
|
577
574
|
|
578
575
|
_stream = False
|
@@ -595,7 +592,7 @@ class ServiceOperations:
|
|
595
592
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
596
593
|
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
|
597
594
|
|
598
|
-
deserialized = self._deserialize("StorageServiceStats", pipeline_response)
|
595
|
+
deserialized = self._deserialize("StorageServiceStats", pipeline_response.http_response)
|
599
596
|
|
600
597
|
if cls:
|
601
598
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -676,7 +673,6 @@ class ServiceOperations:
|
|
676
673
|
headers=_headers,
|
677
674
|
params=_params,
|
678
675
|
)
|
679
|
-
_request = _convert_request(_request)
|
680
676
|
_request.url = self._client.format_url(_request.url)
|
681
677
|
|
682
678
|
_stream = False
|
@@ -698,7 +694,7 @@ class ServiceOperations:
|
|
698
694
|
response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
|
699
695
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
700
696
|
|
701
|
-
deserialized = self._deserialize("ListContainersSegmentResponse", pipeline_response)
|
697
|
+
deserialized = self._deserialize("ListContainersSegmentResponse", pipeline_response.http_response)
|
702
698
|
|
703
699
|
if cls:
|
704
700
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -761,7 +757,6 @@ class ServiceOperations:
|
|
761
757
|
headers=_headers,
|
762
758
|
params=_params,
|
763
759
|
)
|
764
|
-
_request = _convert_request(_request)
|
765
760
|
_request.url = self._client.format_url(_request.url)
|
766
761
|
|
767
762
|
_stream = False
|
@@ -784,7 +779,7 @@ class ServiceOperations:
|
|
784
779
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
785
780
|
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
|
786
781
|
|
787
|
-
deserialized = self._deserialize("UserDelegationKey", pipeline_response)
|
782
|
+
deserialized = self._deserialize("UserDelegationKey", pipeline_response.http_response)
|
788
783
|
|
789
784
|
if cls:
|
790
785
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -835,7 +830,6 @@ class ServiceOperations:
|
|
835
830
|
headers=_headers,
|
836
831
|
params=_params,
|
837
832
|
)
|
838
|
-
_request = _convert_request(_request)
|
839
833
|
_request.url = self._client.format_url(_request.url)
|
840
834
|
|
841
835
|
_stream = False
|
@@ -923,9 +917,9 @@ class ServiceOperations:
|
|
923
917
|
headers=_headers,
|
924
918
|
params=_params,
|
925
919
|
)
|
926
|
-
_request = _convert_request(_request)
|
927
920
|
_request.url = self._client.format_url(_request.url)
|
928
921
|
|
922
|
+
_decompress = kwargs.pop("decompress", True)
|
929
923
|
_stream = True
|
930
924
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
931
925
|
_request, stream=_stream, **kwargs
|
@@ -934,6 +928,10 @@ class ServiceOperations:
|
|
934
928
|
response = pipeline_response.http_response
|
935
929
|
|
936
930
|
if response.status_code not in [200]:
|
931
|
+
try:
|
932
|
+
response.read() # Load the body in memory and close the socket
|
933
|
+
except (StreamConsumedError, StreamClosedError):
|
934
|
+
pass
|
937
935
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
938
936
|
error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
|
939
937
|
raise HttpResponseError(response=response, model=error)
|
@@ -943,7 +941,7 @@ class ServiceOperations:
|
|
943
941
|
response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
|
944
942
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
945
943
|
|
946
|
-
deserialized = response.stream_download(self._client._pipeline)
|
944
|
+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
|
947
945
|
|
948
946
|
if cls:
|
949
947
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -1025,7 +1023,6 @@ class ServiceOperations:
|
|
1025
1023
|
headers=_headers,
|
1026
1024
|
params=_params,
|
1027
1025
|
)
|
1028
|
-
_request = _convert_request(_request)
|
1029
1026
|
_request.url = self._client.format_url(_request.url)
|
1030
1027
|
|
1031
1028
|
_stream = False
|
@@ -1048,7 +1045,7 @@ class ServiceOperations:
|
|
1048
1045
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
1049
1046
|
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
|
1050
1047
|
|
1051
|
-
deserialized = self._deserialize("FilterBlobSegment", pipeline_response)
|
1048
|
+
deserialized = self._deserialize("FilterBlobSegment", pipeline_response.http_response)
|
1052
1049
|
|
1053
1050
|
if cls:
|
1054
1051
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -0,0 +1 @@
|
|
1
|
+
# Marker file for PEP 561.
|
azure/storage/blob/_lease.py
CHANGED
@@ -7,57 +7,51 @@
|
|
7
7
|
|
8
8
|
import uuid
|
9
9
|
|
10
|
-
from typing import
|
11
|
-
Union, Optional, Any, TypeVar, TYPE_CHECKING
|
12
|
-
)
|
10
|
+
from typing import Any, Optional, Union, TYPE_CHECKING
|
13
11
|
|
14
12
|
from azure.core.exceptions import HttpResponseError
|
15
13
|
from azure.core.tracing.decorator import distributed_trace
|
16
14
|
|
17
|
-
from ._shared.response_handlers import
|
15
|
+
from ._shared.response_handlers import process_storage_error, return_response_headers
|
18
16
|
from ._serialize import get_modify_conditions
|
19
17
|
|
20
18
|
if TYPE_CHECKING:
|
19
|
+
from azure.storage.blob import BlobClient, ContainerClient
|
21
20
|
from datetime import datetime
|
22
21
|
|
23
|
-
BlobClient = TypeVar("BlobClient")
|
24
|
-
ContainerClient = TypeVar("ContainerClient")
|
25
22
|
|
26
|
-
|
27
|
-
class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-keyword
|
23
|
+
class BlobLeaseClient(): # pylint: disable=client-accepts-api-version-keyword
|
28
24
|
"""Creates a new BlobLeaseClient.
|
29
25
|
|
30
26
|
This client provides lease operations on a BlobClient or ContainerClient.
|
31
|
-
|
32
|
-
:
|
33
|
-
|
34
|
-
|
35
|
-
:
|
36
|
-
The ETag of the lease currently being maintained. This will be `None` if no
|
37
|
-
lease has yet been acquired or modified.
|
38
|
-
:ivar ~datetime.datetime last_modified:
|
39
|
-
The last modified timestamp of the lease currently being maintained.
|
40
|
-
This will be `None` if no lease has yet been acquired or modified.
|
41
|
-
|
42
|
-
:param client:
|
43
|
-
The client of the blob or container to lease.
|
44
|
-
:type client: ~azure.storage.blob.BlobClient or
|
45
|
-
~azure.storage.blob.ContainerClient
|
46
|
-
:param str lease_id:
|
47
|
-
A string representing the lease ID of an existing lease. This value does not
|
48
|
-
need to be specified in order to acquire a new lease, or break one.
|
27
|
+
:param client: The client of the blob or container to lease.
|
28
|
+
:type client: Union[BlobClient, ContainerClient]
|
29
|
+
:param lease_id: A string representing the lease ID of an existing lease. This value does not need to be
|
30
|
+
specified in order to acquire a new lease, or break one.
|
31
|
+
:type lease_id: Optional[str]
|
49
32
|
"""
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
33
|
+
|
34
|
+
id: str
|
35
|
+
"""The ID of the lease currently being maintained. This will be `None` if no
|
36
|
+
lease has yet been acquired."""
|
37
|
+
etag: Optional[str]
|
38
|
+
"""The ETag of the lease currently being maintained. This will be `None` if no
|
39
|
+
lease has yet been acquired or modified."""
|
40
|
+
last_modified: Optional["datetime"]
|
41
|
+
"""The last modified timestamp of the lease currently being maintained.
|
42
|
+
This will be `None` if no lease has yet been acquired or modified."""
|
43
|
+
|
44
|
+
def __init__( # pylint: disable=missing-client-constructor-parameter-credential, missing-client-constructor-parameter-kwargs
|
45
|
+
self, client: Union["BlobClient", "ContainerClient"],
|
46
|
+
lease_id: Optional[str] = None
|
47
|
+
) -> None:
|
54
48
|
self.id = lease_id or str(uuid.uuid4())
|
55
49
|
self.last_modified = None
|
56
50
|
self.etag = None
|
57
51
|
if hasattr(client, 'blob_name'):
|
58
|
-
self._client = client._client.blob
|
52
|
+
self._client = client._client.blob
|
59
53
|
elif hasattr(client, 'container_name'):
|
60
|
-
self._client = client._client.container
|
54
|
+
self._client = client._client.container
|
61
55
|
else:
|
62
56
|
raise TypeError("Lease must use either BlobClient or ContainerClient.")
|
63
57
|
|
@@ -68,8 +62,7 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
68
62
|
self.release()
|
69
63
|
|
70
64
|
@distributed_trace
|
71
|
-
def acquire(self, lease_duration
|
72
|
-
# type: (int, **Any) -> None
|
65
|
+
def acquire(self, lease_duration: int = -1, **kwargs: Any) -> None:
|
73
66
|
"""Requests a new lease.
|
74
67
|
|
75
68
|
If the container does not have an active lease, the Blob service creates a
|
@@ -108,12 +101,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
108
101
|
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
|
109
102
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
110
103
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
111
|
-
#other-client--per-operation-configuration>`
|
104
|
+
#other-client--per-operation-configuration>`__.
|
112
105
|
:rtype: None
|
113
106
|
"""
|
114
107
|
mod_conditions = get_modify_conditions(kwargs)
|
115
108
|
try:
|
116
|
-
response = self._client.acquire_lease(
|
109
|
+
response: Any = self._client.acquire_lease(
|
117
110
|
timeout=kwargs.pop('timeout', None),
|
118
111
|
duration=lease_duration,
|
119
112
|
proposed_lease_id=self.id,
|
@@ -122,13 +115,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
122
115
|
**kwargs)
|
123
116
|
except HttpResponseError as error:
|
124
117
|
process_storage_error(error)
|
125
|
-
self.id = response.get('lease_id')
|
126
|
-
self.last_modified = response.get('last_modified')
|
127
|
-
self.etag = response.get('etag')
|
118
|
+
self.id = response.get('lease_id')
|
119
|
+
self.last_modified = response.get('last_modified')
|
120
|
+
self.etag = response.get('etag')
|
128
121
|
|
129
122
|
@distributed_trace
|
130
|
-
def renew(self, **kwargs):
|
131
|
-
# type: (Any) -> None
|
123
|
+
def renew(self, **kwargs: Any) -> None:
|
132
124
|
"""Renews the lease.
|
133
125
|
|
134
126
|
The lease can be renewed if the lease ID specified in the
|
@@ -165,12 +157,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
165
157
|
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
|
166
158
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
167
159
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
168
|
-
#other-client--per-operation-configuration>`
|
160
|
+
#other-client--per-operation-configuration>`__.
|
169
161
|
:return: None
|
170
162
|
"""
|
171
163
|
mod_conditions = get_modify_conditions(kwargs)
|
172
164
|
try:
|
173
|
-
response = self._client.renew_lease(
|
165
|
+
response: Any = self._client.renew_lease(
|
174
166
|
lease_id=self.id,
|
175
167
|
timeout=kwargs.pop('timeout', None),
|
176
168
|
modified_access_conditions=mod_conditions,
|
@@ -178,13 +170,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
178
170
|
**kwargs)
|
179
171
|
except HttpResponseError as error:
|
180
172
|
process_storage_error(error)
|
181
|
-
self.etag = response.get('etag')
|
182
|
-
self.id = response.get('lease_id')
|
183
|
-
self.last_modified = response.get('last_modified')
|
173
|
+
self.etag = response.get('etag')
|
174
|
+
self.id = response.get('lease_id')
|
175
|
+
self.last_modified = response.get('last_modified')
|
184
176
|
|
185
177
|
@distributed_trace
|
186
|
-
def release(self, **kwargs):
|
187
|
-
# type: (Any) -> None
|
178
|
+
def release(self, **kwargs: Any) -> None:
|
188
179
|
"""Release the lease.
|
189
180
|
|
190
181
|
The lease may be released if the client lease id specified matches
|
@@ -219,12 +210,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
219
210
|
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
|
220
211
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
221
212
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
222
|
-
#other-client--per-operation-configuration>`
|
213
|
+
#other-client--per-operation-configuration>`__.
|
223
214
|
:return: None
|
224
215
|
"""
|
225
216
|
mod_conditions = get_modify_conditions(kwargs)
|
226
217
|
try:
|
227
|
-
response = self._client.release_lease(
|
218
|
+
response: Any = self._client.release_lease(
|
228
219
|
lease_id=self.id,
|
229
220
|
timeout=kwargs.pop('timeout', None),
|
230
221
|
modified_access_conditions=mod_conditions,
|
@@ -232,13 +223,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
232
223
|
**kwargs)
|
233
224
|
except HttpResponseError as error:
|
234
225
|
process_storage_error(error)
|
235
|
-
self.etag = response.get('etag')
|
236
|
-
self.id = response.get('lease_id')
|
237
|
-
self.last_modified = response.get('last_modified')
|
226
|
+
self.etag = response.get('etag')
|
227
|
+
self.id = response.get('lease_id')
|
228
|
+
self.last_modified = response.get('last_modified')
|
238
229
|
|
239
230
|
@distributed_trace
|
240
|
-
def change(self, proposed_lease_id, **kwargs):
|
241
|
-
# type: (str, Any) -> None
|
231
|
+
def change(self, proposed_lease_id: str, **kwargs: Any) -> None:
|
242
232
|
"""Change the lease ID of an active lease.
|
243
233
|
|
244
234
|
:param str proposed_lease_id:
|
@@ -272,12 +262,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
272
262
|
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
|
273
263
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
274
264
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
275
|
-
#other-client--per-operation-configuration>`
|
265
|
+
#other-client--per-operation-configuration>`__.
|
276
266
|
:return: None
|
277
267
|
"""
|
278
268
|
mod_conditions = get_modify_conditions(kwargs)
|
279
269
|
try:
|
280
|
-
response = self._client.change_lease(
|
270
|
+
response: Any = self._client.change_lease(
|
281
271
|
lease_id=self.id,
|
282
272
|
proposed_lease_id=proposed_lease_id,
|
283
273
|
timeout=kwargs.pop('timeout', None),
|
@@ -286,13 +276,12 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
286
276
|
**kwargs)
|
287
277
|
except HttpResponseError as error:
|
288
278
|
process_storage_error(error)
|
289
|
-
self.etag = response.get('etag')
|
290
|
-
self.id = response.get('lease_id')
|
291
|
-
self.last_modified = response.get('last_modified')
|
279
|
+
self.etag = response.get('etag')
|
280
|
+
self.id = response.get('lease_id')
|
281
|
+
self.last_modified = response.get('last_modified')
|
292
282
|
|
293
283
|
@distributed_trace
|
294
|
-
def break_lease(self, lease_break_period=None, **kwargs):
|
295
|
-
# type: (Optional[int], Any) -> int
|
284
|
+
def break_lease(self, lease_break_period: Optional[int] = None, **kwargs: Any) -> int:
|
296
285
|
"""Break the lease, if the container or blob has an active lease.
|
297
286
|
|
298
287
|
Once a lease is broken, it cannot be renewed. Any authorized request can break the lease;
|
@@ -335,7 +324,7 @@ class BlobLeaseClient(object): # pylint: disable=client-accepts-api-version-key
|
|
335
324
|
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
|
336
325
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
337
326
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
338
|
-
#other-client--per-operation-configuration>`
|
327
|
+
#other-client--per-operation-configuration>`__.
|
339
328
|
:return: Approximate time remaining in the lease period, in seconds.
|
340
329
|
:rtype: int
|
341
330
|
"""
|