AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the ListQueues operation.
Returns a list of your queues in the current region. The response includes a maximum
of 1,000 results. If you specify a value for the optional QueueNamePrefix
parameter,
only queues with a name that begins with the specified value are returned.
The listQueues
methods supports pagination. Set parameter MaxResults
in the request to specify the maximum number of results to be returned in the response.
If you do not set MaxResults
, the response includes a maximum of 1,000 results.
If you set MaxResults
and there are additional results to display, the response
includes a value for NextToken
. Use NextToken
as a parameter in your
next request to listQueues
to receive the next page of results.
Cross-account permissions don't apply to this action. For more information, see Grant cross-account permissions to a role and a username in the Amazon SQS Developer Guide.
Namespace: Amazon.SQS.Model
Assembly: AWSSDK.SQS.dll
Version: 3.x.y.z
public class ListQueuesRequest : AmazonSQSRequest IAmazonWebServiceRequest
The ListQueuesRequest type exposes the following members
Name | Description | |
---|---|---|
ListQueuesRequest() |
Empty constructor used to set properties independently even when a simple constructor is available |
|
ListQueuesRequest(string) |
Instantiates ListQueuesRequest with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
MaxResults | System.Int32 |
Gets and sets the property MaxResults.
Maximum number of results to include in the response. Value range is 1 to 1000. You
must set |
|
NextToken | System.String |
Gets and sets the property NextToken. Pagination token to request the next set of results. |
|
QueueNamePrefix | System.String |
Gets and sets the property QueueNamePrefix. A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned. Queue URLs and names are case-sensitive. |
This example shows how to list queues.
var client = new AmazonSQSClient(); // List all queues that start with "My". var request = new ListQueuesRequest { QueueNamePrefix = "My" }; var response = client.ListQueues(request); if (response.QueueUrls.Count > 0) { Console.WriteLine("Queue URLs:"); foreach (var url in response.QueueUrls) { Console.WriteLine(" " + url); } } else { Console.WriteLine("No matching queues."); }
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5