ListQueues - Amazon Simple Queue Service

ListQueues

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.

Note

Cross-account permissions don't apply to this action. For more information, see Grant Cross-Account Permissions to a Role and a User Name in the Amazon Simple Queue Service Developer Guide.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

MaxResults

Maximum number of results to include in the response. Value range is 1 to 1000. You must set MaxResults to receive a value for NextToken in the response.

Type: Integer

Required: No

NextToken

Pagination token to request the next set of results.

Type: String

Required: No

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.

Type: String

Required: No

Response Elements

The following elements are returned by the service.

NextToken

Pagination token to include in the next request. Token value is null if there are no additional results to request, or if you did not set MaxResults in the request.

Type: String

QueueUrl.N

A list of queue URLs, up to 1,000 entries, or the value of MaxResults that you sent in the request.

Type: Array of strings

Errors

For information about the errors that are common to all actions, see Common Errors.

Example

The following example query request returns the queues whose names begin with the letter t The structure of AUTHPARAMS depends on the signature of the API request. For more information, see Examples of Signed Signature Version 4 Requests in the Amazon Web Services General Reference.

Sample Request

https://sqs.us-east-2.amazonaws.com/ ?Action=ListQueues &QueueNamePrefix=M &Expires=2020-04-18T22%3A52%3A43PST &Version=2012-11-05 &AUTHPARAMS

Sample Response

<ListQueuesResponse> <ListQueuesResult> <QueueUrl>https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue</QueueUrl> </ListQueuesResult> <ResponseMetadata> <RequestId>725275ae-0b9b-4762-b238-436d7c65a1ac</RequestId> </ResponseMetadata> </ListQueuesResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: