CloudQueueClient.ListQueuesSegmented Method (String, QueueListingDetails)

Storage Client Library NET API

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Returns a result segment containing a collection of queues whose names begin with the specified prefix, with each listing the specified queue details.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

Usage

Visual Basic
Dim instance As CloudQueueClient
Dim prefix As String
Dim detailsIncluded As QueueListingDetails
Dim returnValue As ResultSegment(Of CloudQueue)

returnValue = instance.ListQueuesSegmented(prefix, detailsIncluded)

Syntax

Visual Basic
Public Function ListQueuesSegmented ( _
	prefix As String, _
	detailsIncluded As QueueListingDetails _
) As ResultSegment(Of CloudQueue)
C#
public ResultSegment<CloudQueue> ListQueuesSegmented (
	string prefix,
	QueueListingDetails detailsIncluded
)
C++
public:
ResultSegment<CloudQueue^>^ ListQueuesSegmented (
	String^ prefix, 
	QueueListingDetails detailsIncluded
)
J#
JScript

Parameters

prefix

Type: System.String

The queue name prefix.

detailsIncluded

Type: Microsoft.WindowsAzure.StorageClient.QueueListingDetails

One of the enumeration values that indicates which details to include in the listing.

Return Value

Type: Microsoft.WindowsAzure.StorageClient.ResultSegment

A result segment containing a collection of queues.

Example

The following code example lists queues in pages of ten.

 Copy Code
static void ListQueuesInSegments(Uri queueEndpoint, string accountName, string accountKey)
{
    //Create service client for credentialed access to the Queue service.
    CloudQueueClient queueClient = new CloudQueueClient(queueEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

    //Return a page of 10 queues beginning with the specified prefix.
    ResultSegment<CloudQueue> resultSegment = queueClient.ListQueuesSegmented("my", QueueListingDetails.None, 10, null);
    WriteQueuesInResultSegment(resultSegment);

    Console.WriteLine();

    //Check that the page is complete.
    while (resultSegment.HasMoreResults)
    {
        resultSegment = resultSegment.GetNext();
        WriteQueuesInResultSegment(resultSegment);
    }

    Console.WriteLine();
}

Remarks

The ListQueuesSegmented method lists queues in pages. To specify the page size to return, pass in a non-zero value for the maxResults parameter. Passing in zero for the maxResults parameter returns either the maximum number of results available, or the per-operation limit of 5000 results.

If you have specified a page size, you can check the HasMoreResults property to check whether the page is complete. For example, if you have specified a page size of 10,000, a value which exceeds the per-operation limit, HasMoreResults will return true, indicating that the page is not complete. Note that if you have not specified a page size, HasMoreResults will always be false.

If you have not specified a page size, or the value of maxResults is zero, then check the value of the ContinuationToken property to determine whether there are more results to return. The continuation token is non-null as long as there are more results to return from the service.

Call the GetNext method to return the next segment of results from the service.


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Change History

See Also