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.
Parameters:
-
queue_name_prefix
(Optional[String], default:
None
)
–
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.
-
next_token
(Optional[Token], default:
None
)
–
Pagination token to request the next set of results.
-
max_results
(Optional[BoxedInteger], default:
None
)
–
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.
Raises:
-
InvalidAddress
–
The specified ID is invalid.
-
InvalidSecurity
–
The request was not made over HTTPS or did not use SigV4 for signing.
-
RequestThrottled
–
The request was denied due to request throttling.
-
Exceeds the permitted request rate for the queue or for the recipient of the request.
-
Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see Amazon SQS quotas in the Amazon SQS Developer Guide.
-
UnsupportedOperation
–
Error code 400. Unsupported operation.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_sqs/_services/async_sqs.py
| async def list_queues(
self,
*,
config_overrides: Optional[AsyncSQSClientConfig] = None,
queue_name_prefix: Optional["capo_sqs.types.string.String"] = None,
next_token: Optional["capo_sqs.types.token.Token"] = None,
max_results: Optional["capo_sqs.types.boxed_integer.BoxedInteger"] = None,
) -> "capo_sqs.types.list_queues_result.ListQueuesResult":
"""<p>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 <code>QueueNamePrefix</code> parameter, only queues with a name that begins with the specified value are returned.</p> <p> The <code>listQueues</code> methods supports pagination. Set parameter <code>MaxResults</code> in the request to specify the maximum number of results to be returned in the response. If you do not set <code>MaxResults</code>, the response includes a maximum of 1,000 results. If you set <code>MaxResults</code> and there are additional results to display, the response includes a value for <code>NextToken</code>. Use <code>NextToken</code> as a parameter in your next request to <code>listQueues</code> to receive the next page of results. </p> <note> <p>Cross-account permissions don't apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant cross-account permissions to a role and a username</a> in the <i>Amazon SQS Developer Guide</i>.</p> </note>
Args:
queue_name_prefix: <p>A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.</p> <p>Queue URLs and names are case-sensitive.</p>
next_token: <p>Pagination token to request the next set of results.</p>
max_results: <p>Maximum number of results to include in the response. Value range is 1 to 1000. You must set <code>MaxResults</code> to receive a value for <code>NextToken</code> in the response.</p>
Raises:
capo_sqs.errors.invalid_address.InvalidAddress: <p>The specified ID is invalid.</p>
capo_sqs.errors.invalid_security.InvalidSecurity: <p>The request was not made over HTTPS or did not use SigV4 for signing.</p>
capo_sqs.errors.request_throttled.RequestThrottled: <p>The request was denied due to request throttling.</p> <ul> <li> <p>Exceeds the permitted request rate for the queue or for the recipient of the request.</p> </li> <li> <p>Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests">Amazon SQS quotas</a> in the <i>Amazon SQS Developer Guide</i>.</p> </li> </ul>
capo_sqs.errors.unsupported_operation.UnsupportedOperation: <p>Error code 400. Unsupported operation.</p>
capo_sqs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sqs.types.list_queues_request.ListQueuesRequest]",
) -> AsyncOperationResponse[
"capo_sqs.types.list_queues_result.ListQueuesResult"
]:
import capo_sqs._operations.amazon_sqs.list_queues
(
output,
http_response,
) = await capo_sqs._operations.amazon_sqs.list_queues.async_list_queues(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListQueues")
)
input_: capo_sqs.types.list_queues_request.ListQueuesRequest = {}
if queue_name_prefix is not None:
input_["queue_name_prefix"] = queue_name_prefix
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|