ListQueues#

Description#

Returns the list of all queues. The queues can be filtered by name prefix.

Request Syntax#

POST / HTTP/1.1
Content-type: application/json

{
    "MaxResults": integer,
    "NextToken": "string",
    "QueueNamePrefix": "string"
}

Request Parameters#

  • MaxResults — The maximum number of results to be returned.

    • Type: Integer

    • Required: No

    • Valid range: from 1 to 1000

  • NextToken — The pagination token, which should be used to get the next page of results.

    • Type: String

    • Required: No

  • QueueNamePrefix — The prefix by which the queue names are filtered.

    • Type: String

    • Required: No

Response Syntax#

HTTP/1.1 200
Content-type: application/json

{
    "QueueUrls": [
        "string"
    ]
}

Response Elements#

  • QueueUrls — The list of queue URLs.

    • Type: Array of strings

Examples#

boto3
 import boto3

 session = boto3.Session(
    aws_access_key_id="<AWS_ACCESS_KEY_ID>",
    aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
    region_name="",
 )

 sqs_client = session.client(
    'sqs',
    endpoint_url='https://sqs.ru-msk.k2.cloud/'
 )

 response = sqs_client.list_queues()

 for queue_url in response.get('QueueUrls', []):
     print(queue_url)
boto3 - With Prefix
 import boto3

 session = boto3.Session(
    aws_access_key_id="<AWS_ACCESS_KEY_ID>",
    aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
    region_name="",
 )

 sqs_client = session.client(
    'sqs',
    endpoint_url='https://sqs.ru-msk.k2.cloud/'
 )

 response = sqs_client.list_queues(
     QueueNamePrefix='prod-'
 )

 for queue_url in response.get('QueueUrls', []):
     print(queue_url)
aws-cli
 aws sqs --endpoint https://sqs.ru-msk.k2.cloud/ list-queues

 # With prefix
 aws sqs --endpoint https://sqs.ru-msk.k2.cloud/ list-queues \\
     --queue-name-prefix prod-