PurgeQueue#

Description#

Deletes all messages from the specified queue. This may take up to 60 seconds.

Request Syntax#

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

{
    "QueueUrl": "string"
}

Request Parameters#

  • QueueUrl — The URL of the queue to be purged.

    • Type: String

    • Required: Yes

Response Syntax#

HTTP/1.1 200
Content-type: application/json

{
    "Success": boolean
}

Response Elements#

  • Success — The purge operation result.

    • Type: Boolean

Errors#

  • PurgeQueueInProgress — A purge operation is already in progress for this queue.

  • QueueDoesNotExist — The specified queue does not exist.

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/',
 )

 sqs_client.purge_queue(
     QueueUrl='https://sqs.ru-msk.k2.cloud/123456789012/my-queue'
 )
aws-cli
 aws sqs --endpoint https://sqs.ru-msk.k2.cloud/ purge-queue \\
     --queue-url https://sqs.ru-msk.k2.cloud/123456789012/my-queue