Sdílet prostřednictvím


BlobContainerClient.GetBlobsByHierarchyAsync Method

Definition

The GetBlobsByHierarchyAsync(BlobTraits, BlobStates, String, String, CancellationToken) operation returns an async collection of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name. A delimiter can be used to traverse a virtual hierarchy of blobs as though it were a file system.

For more information, see List Blobs.

public virtual Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobHierarchyItem> GetBlobsByHierarchyAsync (Azure.Storage.Blobs.Models.BlobTraits traits = Azure.Storage.Blobs.Models.BlobTraits.None, Azure.Storage.Blobs.Models.BlobStates states = Azure.Storage.Blobs.Models.BlobStates.None, string delimiter = default, string prefix = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetBlobsByHierarchyAsync : Azure.Storage.Blobs.Models.BlobTraits * Azure.Storage.Blobs.Models.BlobStates * string * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobHierarchyItem>
override this.GetBlobsByHierarchyAsync : Azure.Storage.Blobs.Models.BlobTraits * Azure.Storage.Blobs.Models.BlobStates * string * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobHierarchyItem>
Public Overridable Function GetBlobsByHierarchyAsync (Optional traits As BlobTraits = Azure.Storage.Blobs.Models.BlobTraits.None, Optional states As BlobStates = Azure.Storage.Blobs.Models.BlobStates.None, Optional delimiter As String = Nothing, Optional prefix As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of BlobHierarchyItem)

Parameters

traits
BlobTraits

Specifies trait options for shaping the blobs.

states
BlobStates

Specifies state options for filtering the blobs.

delimiter
String

A delimiter that can be used to traverse a virtual hierarchy of blobs as though it were a file system. The delimiter may be a single character or a string. Prefix will be returned in place of all blobs whose names begin with the same substring up to the appearance of the delimiter character. The value of a prefix is substring+delimiter, where substring is the common substring that begins one or more blob names, and delimiter is the value of delimiter. You can use the value of prefix to make a subsequent call to list the blobs that begin with this prefix, by specifying the value of the prefix for the prefix.

Note that each BlobPrefix element returned counts toward the maximum result, just as each Blob element does.

prefix
String

Specifies a string that filters the results to return only blobs whose name begins with the specified prefix.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

An AsyncPageable<T> describing the blobs in the container.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to