azure-storage-blob 12.19.1__py3-none-any.whl → 12.20.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 +17 -5
- azure/storage/blob/_blob_client.py +23 -7
- azure/storage/blob/_blob_service_client.py +9 -3
- azure/storage/blob/_container_client.py +37 -13
- azure/storage/blob/_download.py +3 -3
- azure/storage/blob/_encryption.py +254 -165
- azure/storage/blob/_generated/_azure_blob_storage.py +21 -3
- azure/storage/blob/_generated/_configuration.py +4 -11
- azure/storage/blob/_generated/_serialization.py +41 -49
- azure/storage/blob/_generated/aio/_azure_blob_storage.py +23 -3
- azure/storage/blob/_generated/aio/_configuration.py +4 -11
- azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +24 -58
- azure/storage/blob/_generated/aio/operations/_blob_operations.py +123 -306
- azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +37 -86
- azure/storage/blob/_generated/aio/operations/_container_operations.py +98 -289
- azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +51 -150
- azure/storage/blob/_generated/aio/operations/_service_operations.py +49 -125
- azure/storage/blob/_generated/models/_models_py3.py +31 -31
- azure/storage/blob/_generated/operations/_append_blob_operations.py +25 -59
- azure/storage/blob/_generated/operations/_blob_operations.py +123 -306
- azure/storage/blob/_generated/operations/_block_blob_operations.py +39 -88
- azure/storage/blob/_generated/operations/_container_operations.py +100 -291
- azure/storage/blob/_generated/operations/_page_blob_operations.py +52 -151
- azure/storage/blob/_generated/operations/_service_operations.py +50 -126
- azure/storage/blob/_lease.py +1 -0
- azure/storage/blob/_models.py +3 -4
- azure/storage/blob/_serialize.py +1 -0
- azure/storage/blob/_shared/authentication.py +1 -1
- azure/storage/blob/_shared/avro/avro_io.py +0 -6
- azure/storage/blob/_shared/avro/avro_io_async.py +0 -6
- azure/storage/blob/_shared/avro/datafile.py +0 -4
- azure/storage/blob/_shared/avro/datafile_async.py +0 -4
- azure/storage/blob/_shared/avro/schema.py +4 -4
- azure/storage/blob/_shared/base_client.py +72 -87
- azure/storage/blob/_shared/base_client_async.py +115 -27
- azure/storage/blob/_shared/models.py +120 -27
- azure/storage/blob/_shared/parser.py +7 -6
- azure/storage/blob/_shared/policies.py +96 -66
- azure/storage/blob/_shared/policies_async.py +48 -21
- azure/storage/blob/_shared/response_handlers.py +14 -16
- azure/storage/blob/_shared/shared_access_signature.py +3 -3
- azure/storage/blob/_shared_access_signature.py +38 -27
- azure/storage/blob/_upload_helpers.py +4 -7
- azure/storage/blob/_version.py +1 -1
- azure/storage/blob/aio/__init__.py +13 -4
- azure/storage/blob/aio/_blob_client_async.py +17 -6
- azure/storage/blob/aio/_blob_service_client_async.py +4 -2
- azure/storage/blob/aio/_container_client_async.py +26 -9
- azure/storage/blob/aio/_download_async.py +9 -9
- azure/storage/blob/aio/_encryption_async.py +72 -0
- azure/storage/blob/aio/_lease_async.py +1 -1
- azure/storage/blob/aio/_upload_helpers.py +8 -10
- {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/METADATA +10 -10
- azure_storage_blob-12.20.0.dist-info/RECORD +81 -0
- {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/WHEEL +1 -1
- azure/storage/blob/_generated/py.typed +0 -1
- azure_storage_blob-12.19.1.dist-info/RECORD +0 -81
- {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/LICENSE +0 -0
- {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/top_level.txt +0 -0
azure/storage/blob/__init__.py
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
# Licensed under the MIT License. See License.txt in the project root for
|
4
4
|
# license information.
|
5
5
|
# --------------------------------------------------------------------------
|
6
|
+
# pylint: disable=docstring-keyword-should-match-keyword-only
|
7
|
+
|
6
8
|
import os
|
7
9
|
|
8
10
|
from typing import Union, Iterable, AnyStr, IO, Any, Dict # pylint: disable=unused-import
|
@@ -21,7 +23,8 @@ from ._shared.models import(
|
|
21
23
|
ResourceTypes,
|
22
24
|
AccountSasPermissions,
|
23
25
|
StorageErrorCode,
|
24
|
-
UserDelegationKey
|
26
|
+
UserDelegationKey,
|
27
|
+
Services
|
25
28
|
)
|
26
29
|
from ._generated.models import (
|
27
30
|
RehydratePriority,
|
@@ -60,7 +63,7 @@ from ._models import (
|
|
60
63
|
ArrowType,
|
61
64
|
ObjectReplicationPolicy,
|
62
65
|
ObjectReplicationRule,
|
63
|
-
ImmutabilityPolicy
|
66
|
+
ImmutabilityPolicy,
|
64
67
|
)
|
65
68
|
from ._list_blobs_helper import BlobPrefix
|
66
69
|
|
@@ -91,7 +94,11 @@ def upload_blob_to_url(
|
|
91
94
|
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
|
92
95
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
93
96
|
should be the storage account key.
|
94
|
-
:
|
97
|
+
:type credential:
|
98
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
99
|
+
~azure.core.credentials.AzureSasCredential or
|
100
|
+
~azure.core.credentials.TokenCredential or
|
101
|
+
str or dict[str, str] or None
|
95
102
|
:keyword bool overwrite:
|
96
103
|
Whether the blob to be uploaded should overwrite the current data.
|
97
104
|
If True, upload_blob_to_url will overwrite any existing data. If set to False, the
|
@@ -155,7 +162,11 @@ def download_blob_from_url(
|
|
155
162
|
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
|
156
163
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
157
164
|
should be the storage account key.
|
158
|
-
:
|
165
|
+
:type credential:
|
166
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
167
|
+
~azure.core.credentials.AzureSasCredential or
|
168
|
+
~azure.core.credentials.TokenCredential or
|
169
|
+
str or dict[str, str] or None
|
159
170
|
:keyword bool overwrite:
|
160
171
|
Whether the local file should be overwritten if it already exists. The default value is
|
161
172
|
`False` - in which case a ValueError will be raised if the file already exists. If set to
|
@@ -246,5 +257,6 @@ __all__ = [
|
|
246
257
|
'ArrowType',
|
247
258
|
'BlobQueryReader',
|
248
259
|
'ObjectReplicationPolicy',
|
249
|
-
'ObjectReplicationRule'
|
260
|
+
'ObjectReplicationRule',
|
261
|
+
'Services',
|
250
262
|
]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Licensed under the MIT License. See License.txt in the project root for
|
4
4
|
# license information.
|
5
5
|
# --------------------------------------------------------------------------
|
6
|
-
# pylint: disable=too-many-lines
|
6
|
+
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
|
7
7
|
|
8
8
|
from functools import partial
|
9
9
|
from io import BytesIO
|
@@ -237,7 +237,11 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
237
237
|
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
|
238
238
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
239
239
|
should be the storage account key.
|
240
|
-
:type credential:
|
240
|
+
:type credential:
|
241
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
242
|
+
~azure.core.credentials.AzureSasCredential or
|
243
|
+
~azure.core.credentials.TokenCredential or
|
244
|
+
str or dict[str, str] or None
|
241
245
|
:param str snapshot:
|
242
246
|
The optional blob snapshot on which to operate. This can be the snapshot ID string
|
243
247
|
or the response returned from :func:`create_snapshot`. If specified, this will override
|
@@ -326,7 +330,11 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
326
330
|
Credentials provided here will take precedence over those in the connection string.
|
327
331
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
328
332
|
should be the storage account key.
|
329
|
-
:type credential:
|
333
|
+
:type credential:
|
334
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
335
|
+
~azure.core.credentials.AzureSasCredential or
|
336
|
+
~azure.core.credentials.TokenCredential or
|
337
|
+
str or dict[str, str] or None
|
330
338
|
:keyword str version_id: The version id parameter is an opaque DateTime value that, when present,
|
331
339
|
specifies the version of the blob to operate on.
|
332
340
|
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
|
@@ -449,7 +457,6 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
449
457
|
|
450
458
|
if blob_type == BlobType.BlockBlob:
|
451
459
|
kwargs['client'] = self._client.block_blob
|
452
|
-
kwargs['data'] = data
|
453
460
|
elif blob_type == BlobType.PageBlob:
|
454
461
|
if self.encryption_version == '2.0' and (self.require_encryption or self.key_encryption_key is not None):
|
455
462
|
raise ValueError("Encryption version 2.0 does not currently support page blobs.")
|
@@ -602,6 +609,8 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
602
609
|
:keyword str source_authorization:
|
603
610
|
Authenticate as a service principal using a client secret to access a source blob. Ensure "bearer " is
|
604
611
|
the prefix of the source_authorization string.
|
612
|
+
:returns: Response from creating a new block blob for a given URL.
|
613
|
+
:rtype: Dict[str, Any]
|
605
614
|
"""
|
606
615
|
options = self._upload_blob_from_url_options(
|
607
616
|
source_url=self._encode_source_url(source_url),
|
@@ -613,7 +622,7 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
613
622
|
|
614
623
|
@distributed_trace
|
615
624
|
def upload_blob(
|
616
|
-
self, data: Union[bytes, str, Iterable[AnyStr], IO[
|
625
|
+
self, data: Union[bytes, str, Iterable[AnyStr], IO[bytes]],
|
617
626
|
blob_type: Union[str, BlobType] = BlobType.BlockBlob,
|
618
627
|
length: Optional[int] = None,
|
619
628
|
metadata: Optional[Dict[str, str]] = None,
|
@@ -622,6 +631,7 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
622
631
|
"""Creates a new blob from a data source with automatic chunking.
|
623
632
|
|
624
633
|
:param data: The blob data to upload.
|
634
|
+
:type data: Union[bytes, str, Iterable[AnyStr], IO[AnyStr]]
|
625
635
|
:param ~azure.storage.blob.BlobType blob_type: The type of the blob. This can be
|
626
636
|
either BlockBlob, PageBlob or AppendBlob. The default value is BlockBlob.
|
627
637
|
:param int length:
|
@@ -1025,7 +1035,7 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
1025
1035
|
These dialects can be passed through their respective classes, the QuickQueryDialect enum or as a string
|
1026
1036
|
|
1027
1037
|
.. note::
|
1028
|
-
|
1038
|
+
"ParquetDialect" is in preview, so some features may not work as intended.
|
1029
1039
|
|
1030
1040
|
:paramtype blob_format: ~azure.storage.blob.DelimitedTextDialect or ~azure.storage.blob.DelimitedJsonDialect
|
1031
1041
|
or ~azure.storage.blob.QuickQueryDialect or str
|
@@ -1532,6 +1542,7 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
1532
1542
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
1533
1543
|
#other-client--per-operation-configuration>`_.
|
1534
1544
|
:returns: Blob-updated property dict (Etag and last modified)
|
1545
|
+
:rtype: Dict[str, Union[str, datetime]]
|
1535
1546
|
"""
|
1536
1547
|
options = self._set_blob_metadata_options(metadata=metadata, **kwargs)
|
1537
1548
|
try:
|
@@ -2515,6 +2526,7 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
2515
2526
|
The string should be less than or equal to 64 bytes in size.
|
2516
2527
|
For a given blob, the block_id must be the same size for each block.
|
2517
2528
|
:param data: The blob data.
|
2529
|
+
:type data: Union[Iterable[AnyStr], IO[AnyStr]]
|
2518
2530
|
:param int length: Size of the block.
|
2519
2531
|
:keyword bool validate_content:
|
2520
2532
|
If true, calculates an MD5 hash for each chunk of the blob. The storage
|
@@ -3284,7 +3296,7 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
3284
3296
|
.. versionadded:: 12.2.0
|
3285
3297
|
This operation was introduced in API version '2019-07-07'.
|
3286
3298
|
|
3287
|
-
:param previous_snapshot_url:
|
3299
|
+
:param str previous_snapshot_url:
|
3288
3300
|
Specifies the URL of a previous snapshot of the managed disk.
|
3289
3301
|
The response will only contain pages that were changed between the target blob and
|
3290
3302
|
its previous snapshot.
|
@@ -3812,6 +3824,8 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
3812
3824
|
:keyword str source_authorization:
|
3813
3825
|
Authenticate as a service principal using a client secret to access a source blob. Ensure "bearer " is
|
3814
3826
|
the prefix of the source_authorization string.
|
3827
|
+
:returns: Response after uploading pages from specified URL.
|
3828
|
+
:rtype: Dict[str, Any]
|
3815
3829
|
"""
|
3816
3830
|
options = self._upload_pages_from_url_options(
|
3817
3831
|
source_url=self._encode_source_url(source_url),
|
@@ -4240,6 +4254,8 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
|
|
4240
4254
|
:keyword str source_authorization:
|
4241
4255
|
Authenticate as a service principal using a client secret to access a source blob. Ensure "bearer " is
|
4242
4256
|
the prefix of the source_authorization string.
|
4257
|
+
:returns: Result after appending a new block.
|
4258
|
+
:rtype: Dict[str, Union[str, datetime, int]]
|
4243
4259
|
"""
|
4244
4260
|
options = self._append_block_from_url_options(
|
4245
4261
|
copy_source_url=self._encode_source_url(copy_source_url),
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# Licensed under the MIT License. See License.txt in the project root for
|
4
4
|
# license information.
|
5
5
|
# --------------------------------------------------------------------------
|
6
|
+
# pylint: disable=docstring-keyword-should-match-keyword-only
|
6
7
|
|
7
8
|
import functools
|
8
9
|
import warnings
|
@@ -171,7 +172,11 @@ class BlobServiceClient(StorageAccountHostsMixin, StorageEncryptionMixin):
|
|
171
172
|
Credentials provided here will take precedence over those in the connection string.
|
172
173
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
173
174
|
should be the storage account key.
|
174
|
-
:
|
175
|
+
:type credential:
|
176
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
177
|
+
~azure.core.credentials.AzureSasCredential or
|
178
|
+
~azure.core.credentials.TokenCredential or
|
179
|
+
str or dict[str, str] or None
|
175
180
|
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
|
176
181
|
authentication. Only has an effect when credential is of type TokenCredential. The value could be
|
177
182
|
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.
|
@@ -551,6 +556,7 @@ class BlobServiceClient(StorageAccountHostsMixin, StorageEncryptionMixin):
|
|
551
556
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
552
557
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
553
558
|
#other-client--per-operation-configuration>`_.
|
559
|
+
:returns: A container client to interact with the newly created container.
|
554
560
|
:rtype: ~azure.storage.blob.ContainerClient
|
555
561
|
|
556
562
|
.. admonition:: Example:
|
@@ -588,7 +594,7 @@ class BlobServiceClient(StorageAccountHostsMixin, StorageEncryptionMixin):
|
|
588
594
|
If specified, delete_container only succeeds if the
|
589
595
|
container's lease is active and matches this ID.
|
590
596
|
Required if the container has an active lease.
|
591
|
-
:
|
597
|
+
:type lease: ~azure.storage.blob.BlobLeaseClient or str
|
592
598
|
:keyword ~datetime.datetime if_modified_since:
|
593
599
|
A DateTime value. Azure expects the date value passed in to be UTC.
|
594
600
|
If timezone is included, any non-UTC datetimes will be converted to UTC.
|
@@ -612,7 +618,6 @@ class BlobServiceClient(StorageAccountHostsMixin, StorageEncryptionMixin):
|
|
612
618
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
613
619
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
614
620
|
#other-client--per-operation-configuration>`_.
|
615
|
-
:rtype: None
|
616
621
|
|
617
622
|
.. admonition:: Example:
|
618
623
|
|
@@ -652,6 +657,7 @@ class BlobServiceClient(StorageAccountHostsMixin, StorageEncryptionMixin):
|
|
652
657
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
653
658
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
654
659
|
#other-client--per-operation-configuration>`_.
|
660
|
+
:returns: A container client for the renamed container.
|
655
661
|
:rtype: ~azure.storage.blob.ContainerClient
|
656
662
|
"""
|
657
663
|
renamed_container = self.get_container_client(new_name)
|
@@ -1,9 +1,9 @@
|
|
1
|
-
# pylint: disable=too-many-lines
|
2
1
|
# -------------------------------------------------------------------------
|
3
2
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
4
3
|
# Licensed under the MIT License. See License.txt in the project root for
|
5
4
|
# license information.
|
6
5
|
# --------------------------------------------------------------------------
|
6
|
+
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
|
7
7
|
|
8
8
|
import functools
|
9
9
|
import warnings
|
@@ -65,7 +65,7 @@ def _get_blob_name(blob):
|
|
65
65
|
"""Return the blob name.
|
66
66
|
|
67
67
|
:param blob: A blob string or BlobProperties
|
68
|
-
:
|
68
|
+
:type blob: str or BlobProperties
|
69
69
|
:returns: The name of the blob.
|
70
70
|
:rtype: str
|
71
71
|
"""
|
@@ -202,7 +202,11 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
202
202
|
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
|
203
203
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
204
204
|
should be the storage account key.
|
205
|
-
:
|
205
|
+
:type credential:
|
206
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
207
|
+
~azure.core.credentials.AzureSasCredential or
|
208
|
+
~azure.core.credentials.TokenCredential or
|
209
|
+
str or dict[str, str] or None
|
206
210
|
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
|
207
211
|
authentication. Only has an effect when credential is of type TokenCredential. The value could be
|
208
212
|
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.
|
@@ -251,7 +255,11 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
251
255
|
Credentials provided here will take precedence over those in the connection string.
|
252
256
|
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
|
253
257
|
should be the storage account key.
|
254
|
-
:
|
258
|
+
:type credential:
|
259
|
+
~azure.core.credentials.AzureNamedKeyCredential or
|
260
|
+
~azure.core.credentials.AzureSasCredential or
|
261
|
+
~azure.core.credentials.TokenCredential or
|
262
|
+
str or dict[str, str] or None
|
255
263
|
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
|
256
264
|
authentication. Only has an effect when credential is of type TokenCredential. The value could be
|
257
265
|
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.
|
@@ -338,13 +346,14 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
338
346
|
:keyword lease:
|
339
347
|
Specify this to perform only if the lease ID given
|
340
348
|
matches the active lease ID of the source container.
|
341
|
-
:
|
349
|
+
:type lease: ~azure.storage.blob.BlobLeaseClient or str
|
342
350
|
:keyword int timeout:
|
343
351
|
Sets the server-side timeout for the operation in seconds. For more details see
|
344
352
|
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
|
345
353
|
This value is not tracked or validated on the client. To configure client-side network timesouts
|
346
354
|
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
347
355
|
#other-client--per-operation-configuration>`_.
|
356
|
+
:returns: The renamed container client.
|
348
357
|
:rtype: ~azure.storage.blob.ContainerClient
|
349
358
|
"""
|
350
359
|
lease = kwargs.pop('lease', None)
|
@@ -792,8 +801,11 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
792
801
|
process_storage_error(error)
|
793
802
|
|
794
803
|
@distributed_trace
|
795
|
-
def list_blobs(
|
796
|
-
|
804
|
+
def list_blobs(
|
805
|
+
self, name_starts_with: Optional[str] = None,
|
806
|
+
include: Optional[Union[str, List[str]]] = None,
|
807
|
+
**kwargs: Any
|
808
|
+
) -> ItemPaged[BlobProperties]:
|
797
809
|
"""Returns a generator to list the blobs under the specified container.
|
798
810
|
The generator will lazily follow the continuation tokens returned by
|
799
811
|
the service.
|
@@ -824,6 +836,10 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
824
836
|
:dedent: 8
|
825
837
|
:caption: List the blobs in the container.
|
826
838
|
"""
|
839
|
+
if kwargs.pop('prefix', None):
|
840
|
+
raise ValueError("Passing 'prefix' has no effect on filtering, " +
|
841
|
+
"please use the 'name_starts_with' parameter instead.")
|
842
|
+
|
827
843
|
if include and not isinstance(include, list):
|
828
844
|
include = [include]
|
829
845
|
|
@@ -860,6 +876,10 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
860
876
|
:returns: An iterable (auto-paging) response of blob names as strings.
|
861
877
|
:rtype: ~azure.core.paging.ItemPaged[str]
|
862
878
|
"""
|
879
|
+
if kwargs.pop('prefix', None):
|
880
|
+
raise ValueError("Passing 'prefix' has no effect on filtering, " +
|
881
|
+
"please use the 'name_starts_with' parameter instead.")
|
882
|
+
|
863
883
|
name_starts_with = kwargs.pop('name_starts_with', None)
|
864
884
|
results_per_page = kwargs.pop('results_per_page', None)
|
865
885
|
timeout = kwargs.pop('timeout', None)
|
@@ -881,12 +901,11 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
881
901
|
|
882
902
|
@distributed_trace
|
883
903
|
def walk_blobs(
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
):
|
889
|
-
# type: (...) -> ItemPaged[BlobProperties]
|
904
|
+
self, name_starts_with: Optional[str] = None,
|
905
|
+
include: Optional[Union[List[str], str]] = None,
|
906
|
+
delimiter: str = "/",
|
907
|
+
**kwargs: Any
|
908
|
+
) -> ItemPaged[BlobProperties]:
|
890
909
|
"""Returns a generator to list the blobs under the specified container.
|
891
910
|
The generator will lazily follow the continuation tokens returned by
|
892
911
|
the service. This operation will list blobs in accordance with a hierarchy,
|
@@ -914,6 +933,10 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
914
933
|
:returns: An iterable (auto-paging) response of BlobProperties.
|
915
934
|
:rtype: ~azure.core.paging.ItemPaged[~azure.storage.blob.BlobProperties]
|
916
935
|
"""
|
936
|
+
if kwargs.pop('prefix', None):
|
937
|
+
raise ValueError("Passing 'prefix' has no effect on filtering, " +
|
938
|
+
"please use the 'name_starts_with' parameter instead.")
|
939
|
+
|
917
940
|
if include and not isinstance(include, list):
|
918
941
|
include = [include]
|
919
942
|
|
@@ -980,6 +1003,7 @@ class ContainerClient(StorageAccountHostsMixin, StorageEncryptionMixin): # py
|
|
980
1003
|
|
981
1004
|
:param str name: The blob with which to interact.
|
982
1005
|
:param data: The blob data to upload.
|
1006
|
+
:type data: Union[bytes, str, Iterable[AnyStr], IO[AnyStr]]
|
983
1007
|
:param ~azure.storage.blob.BlobType blob_type: The type of the blob. This can be
|
984
1008
|
either BlockBlob, PageBlob or AppendBlob. The default value is BlockBlob.
|
985
1009
|
:param int length:
|
azure/storage/blob/_download.py
CHANGED
@@ -236,7 +236,7 @@ class _ChunkIterator(object):
|
|
236
236
|
self._current_content = content
|
237
237
|
self._iter_downloader = downloader
|
238
238
|
self._iter_chunks = None
|
239
|
-
self._complete =
|
239
|
+
self._complete = size == 0
|
240
240
|
|
241
241
|
def __len__(self):
|
242
242
|
return self.size
|
@@ -700,10 +700,10 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
|
|
700
700
|
self._encoding = encoding
|
701
701
|
return self.readall()
|
702
702
|
|
703
|
-
def readinto(self, stream: IO[
|
703
|
+
def readinto(self, stream: IO[bytes]) -> int:
|
704
704
|
"""Download the contents of this file to a stream.
|
705
705
|
|
706
|
-
:param IO[
|
706
|
+
:param IO[bytes] stream:
|
707
707
|
The stream to download to. This can be an open file-handle,
|
708
708
|
or any writable stream. The stream must be seekable if the download
|
709
709
|
uses more than one parallel connection.
|