ShareServiceClient.GetSharesAsync Method

Definition

The GetSharesAsync(ShareTraits, ShareStates, String, CancellationToken) operation returns an async collection of the shares in the storage account. Enumerating the shares may make multiple requests to the service while fetching all the values.

For more information, see List Shares.

public virtual Azure.AsyncPageable<Azure.Storage.Files.Shares.Models.ShareItem> GetSharesAsync (Azure.Storage.Files.Shares.Models.ShareTraits traits = Azure.Storage.Files.Shares.Models.ShareTraits.None, Azure.Storage.Files.Shares.Models.ShareStates states = Azure.Storage.Files.Shares.Models.ShareStates.None, string prefix = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSharesAsync : Azure.Storage.Files.Shares.Models.ShareTraits * Azure.Storage.Files.Shares.Models.ShareStates * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Storage.Files.Shares.Models.ShareItem>
override this.GetSharesAsync : Azure.Storage.Files.Shares.Models.ShareTraits * Azure.Storage.Files.Shares.Models.ShareStates * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Storage.Files.Shares.Models.ShareItem>
Public Overridable Function GetSharesAsync (Optional traits As ShareTraits = Azure.Storage.Files.Shares.Models.ShareTraits.None, Optional states As ShareStates = Azure.Storage.Files.Shares.Models.ShareStates.None, Optional prefix As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of ShareItem)

Parameters

traits
ShareTraits

Specifies traits to include in the ShareItems.

states
ShareStates

Specifies states to include when listing shares.

prefix
String

String that filters the results to return only shares whose name begins with the specified prefix.

cancellationToken
CancellationToken

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

Returns

A AsyncPageable<T> describing the shares in the storage account.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to