GetQueueUrl
In this article:
GetQueueUrl#
Description#
Returns the URL of an existing queue by its name.
Request Syntax#
POST / HTTP/1.1
Content-type: application/json
{
"QueueName": "string"
}
Request Parameters#
QueueName — The name of the queue whose URL is to be received.
Type: String
Required: Yes
Response Syntax#
HTTP/1.1 200
Content-type: application/json
{
"QueueUrl": "string"
}
Response Elements#
QueueUrl — The queue URL.
Type: String
Errors#
QueueDoesNotExist — The queue with the specified name 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/'
)
response = sqs_client.get_queue_url(
QueueName='my-queue'
)
print(f"Queue URL: {response['QueueUrl']}")
aws-cli
aws sqs --endpoint https://sqs.ru-msk.k2.cloud/ get-queue-url \\
--queue-name my-queue