Skip to content

[Storage] [STG 100] List Blobs Flat + Hierarchal start_from #42173

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

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
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/storage/azure-storage-blob",
"Tag": "python/storage/azure-storage-blob_2bfcc41daa"
"Tag": "python/storage/azure-storage-blob_18c98ed997"
}
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@ def list_blobs(
:keyword int results_per_page:
Controls the maximum number of Blobs that will be included in each page of results if using
`ItemPaged.by_page()`.
:keyword str start_from:
Specifies the full path (inclusive) to list paths from.
Only one entity level is supported.
:keyword int timeout:
Sets the server-side timeout for the operation in seconds. For more details see
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
Expand Down Expand Up @@ -867,6 +870,9 @@ def list_blob_names(self, **kwargs: Any) -> ItemPaged[str]:
:keyword int results_per_page:
Controls the maximum number of Blobs that will be included in each page of results if using
`ItemPaged.by_page()`.
:keyword str start_from:
Specifies the full path (inclusive) to list paths from.
Only one entity level is supported.
:keyword int timeout:
Sets the server-side timeout for the operation in seconds. For more details see
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
Expand Down Expand Up @@ -925,6 +931,8 @@ def walk_blobs(
element in the response body that acts as a placeholder for all blobs whose
names begin with the same substring up to the appearance of the delimiter
character. The delimiter may be a single character or a string.
:keyword str start_from:
Specifies the full path (inclusive) to list paths from.
:keyword int timeout:
Sets the server-side timeout for the operation in seconds. For more details see
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword
:param base_url: Service URL. Required. Default value is "".
:type base_url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2025-11-05". Note that overriding this default value may result in unsupported behavior.
is "2026-02-06". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib
desired operation. Required.
:type url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2025-11-05". Note that overriding this default value may result in unsupported behavior.
is "2026-02-06". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

def __init__(self, url: str, **kwargs: Any) -> None:
version: Literal["2025-11-05"] = kwargs.pop("version", "2025-11-05")
version: Literal["2026-02-06"] = kwargs.pop("version", "2026-02-06")

if url is None:
raise ValueError("Parameter 'url' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword
:param base_url: Service URL. Required. Default value is "".
:type base_url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2025-11-05". Note that overriding this default value may result in unsupported behavior.
is "2026-02-06". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib
desired operation. Required.
:type url: str
:keyword version: Specifies the version of the operation to use for this request. Default value
is "2025-11-05". Note that overriding this default value may result in unsupported behavior.
is "2026-02-06". Note that overriding this default value may result in unsupported behavior.
:paramtype version: str
"""

def __init__(self, url: str, **kwargs: Any) -> None:
version: Literal["2025-11-05"] = kwargs.pop("version", "2025-11-05")
version: Literal["2026-02-06"] = kwargs.pop("version", "2026-02-06")

if url is None:
raise ValueError("Parameter 'url' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ async def list_blob_flat_segment(
marker: Optional[str] = None,
maxresults: Optional[int] = None,
include: Optional[List[Union[str, _models.ListBlobsIncludeItem]]] = None,
start_from: Optional[str] = None,
timeout: Optional[int] = None,
request_id_parameter: Optional[str] = None,
**kwargs: Any
Expand All @@ -1539,6 +1540,10 @@ async def list_blob_flat_segment(
:param include: Include this parameter to specify one or more datasets to include in the
response. Default value is None.
:type include: list[str or ~azure.storage.blob.models.ListBlobsIncludeItem]
:param start_from: Specifies the relative path to list paths from. For non-recursive list, only
one entity level is supported; For recursive list, multiple entity levels are supported.
(Inclusive). Default value is None.
:type start_from: str
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations">Setting
Expand Down Expand Up @@ -1573,6 +1578,7 @@ async def list_blob_flat_segment(
marker=marker,
maxresults=maxresults,
include=include,
start_from=start_from,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
Expand Down Expand Up @@ -1619,6 +1625,7 @@ async def list_blob_hierarchy_segment(
marker: Optional[str] = None,
maxresults: Optional[int] = None,
include: Optional[List[Union[str, _models.ListBlobsIncludeItem]]] = None,
start_from: Optional[str] = None,
timeout: Optional[int] = None,
request_id_parameter: Optional[str] = None,
**kwargs: Any
Expand Down Expand Up @@ -1650,6 +1657,10 @@ async def list_blob_hierarchy_segment(
:param include: Include this parameter to specify one or more datasets to include in the
response. Default value is None.
:type include: list[str or ~azure.storage.blob.models.ListBlobsIncludeItem]
:param start_from: Specifies the relative path to list paths from. For non-recursive list, only
one entity level is supported; For recursive list, multiple entity levels are supported.
(Inclusive). Default value is None.
:type start_from: str
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations">Setting
Expand Down Expand Up @@ -1685,6 +1696,7 @@ async def list_blob_hierarchy_segment(
marker=marker,
maxresults=maxresults,
include=include,
start_from=start_from,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def build_create_request(
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

blob_type: Literal["AppendBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "AppendBlob"))
version: Literal["2025-11-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-11-05"))
version: Literal["2026-02-06"] = kwargs.pop("version", _headers.pop("x-ms-version", "2026-02-06"))
accept = _headers.pop("Accept", "application/xml")

# Construct URL
Expand Down Expand Up @@ -178,7 +178,7 @@ def build_append_block_request(

comp: Literal["appendblock"] = kwargs.pop("comp", _params.pop("comp", "appendblock"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
version: Literal["2025-11-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-11-05"))
version: Literal["2026-02-06"] = kwargs.pop("version", _headers.pop("x-ms-version", "2026-02-06"))
accept = _headers.pop("Accept", "application/xml")

# Construct URL
Expand Down Expand Up @@ -281,7 +281,7 @@ def build_append_block_from_url_request(
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

comp: Literal["appendblock"] = kwargs.pop("comp", _params.pop("comp", "appendblock"))
version: Literal["2025-11-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-11-05"))
version: Literal["2026-02-06"] = kwargs.pop("version", _headers.pop("x-ms-version", "2026-02-06"))
accept = _headers.pop("Accept", "application/xml")

# Construct URL
Expand Down Expand Up @@ -381,7 +381,7 @@ def build_seal_request(
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

comp: Literal["seal"] = kwargs.pop("comp", _params.pop("comp", "seal"))
version: Literal["2025-11-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-11-05"))
version: Literal["2026-02-06"] = kwargs.pop("version", _headers.pop("x-ms-version", "2026-02-06"))
accept = _headers.pop("Accept", "application/xml")

# Construct URL
Expand Down
Loading