Class | Fog::AWS::SQS::Real
In: | lib/fog/aws/sqs.rb lib/fog/aws/requests/sqs/send_message.rb lib/fog/aws/requests/sqs/change_message_visibility.rb lib/fog/aws/requests/sqs/list_queues.rb lib/fog/aws/requests/sqs/create_queue.rb lib/fog/aws/requests/sqs/receive_message.rb lib/fog/aws/requests/sqs/get_queue_attributes.rb lib/fog/aws/requests/sqs/set_queue_attributes.rb lib/fog/aws/requests/sqs/delete_message.rb lib/fog/aws/requests/sqs/delete_queue.rb
Parent: | Object

### Methods

change_message_visibility create_queue delete_message delete_queue get_queue_attributes list_queues new receive_message reload send_message set_queue_attributes

### Included Modules

Fog::AWS::CredentialFetcher::ConnectionMethods

### Public Class methods

new(options={})

Initialize connection to SQS

#### Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

#### Examples

      sqs = SQS.new(
       :aws_access_key_id => your_aws_access_key_id,
       :aws_secret_access_key => your_aws_secret_access_key
      )

#### Parameters

- options<~Hash> - config arguments for connection. Defaults to {}.
  - region<~String> - optional region to use. For instance, ‘eu-west-1’, ‘us-east-1’ and etc.

#### Returns

- SQS object with connection to AWS.

### Public Instance methods

change_message_visibility(queue_url, receipt_handle, visibility_timeout)

Change visibility timeout for a message

#### Parameters

- queue_url<~String> - Url of queue for message to update
- receipt_handle<~String> - Token from previous recieve message
- visibility_timeout<~Integer> - New visibility timeout in 0..43200

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryChangeMessageVisibility.html

create_queue(name, options = {})

Create a queue

#### Parameters

- name<~String> - Name of queue to create
- options<~Hash>:
  - DefaultVisibilityTimeout<~String> - Time, in seconds, to hide a message after it has been received, in 0..43200, defaults to 30

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryCreateQueue.html

delete_message(queue_url, receipt_handle)

Delete a message from a queue

#### Parameters

- queue_url<~String> - Url of queue to delete message from
- receipt_handle<~String> - Token from previous recieve message

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryDeleteMessage.html

delete_queue(queue_url)

Delete a queue

#### Parameters

- queue_url<~String> - Url of queue to delete

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryDeleteQueue.html

get_queue_attributes(queue_url, attribute_name)

Get attributes of a queue

#### Parameters

- queue_url<~String> - Url of queue to get attributes for
- attribute_name<~Array> - Name of attribute to return, in [‘All’, ‘ApproximateNumberOfMessages’, ‘ApproximateNumberOfMessagesNotVisible’, ‘CreatedTimestamp’, ‘LastModifiedTimestamp’, ‘MaximumMessageSize’, ‘MessageRetentionPeriod’, ‘Policy’, ‘QueueArn’, ‘VisibilityTimeout’]

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryGetQueueAttributes.html

list_queues(options = {})

List queues

#### Parameters

- options<~Hash>:
  - QueueNamePrefix<~String> - String used to filter results to only those with matching prefixes

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryListQueues.html

receive_message(queue_url, options = {})

Get a message from a queue (marks it as unavailable temporarily, but does not remove from queue, see delete_message)

#### Parameters

- queue_url<~String> - Url of queue to get message from
- options<~Hash>:
  - Attributes<~Array> - List of attributes to return, in [‘All’, ‘ApproximateFirstReceiveTimestamp’, ‘ApproximateReceiveCount’, ‘SenderId’, ‘SentTimestamp’], defaults to ‘All‘
  - MaxNumberOfMessages<~Integer> - Maximum number of messages to return, defaults to 1
  - VisibilityTimeout<~Integer> - Duration, in seconds, to hide message from other receives. In 0..43200, defaults to visibility timeout for queue

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryReceiveMessage.html

reload()
send_message(queue_url, message)

Add a message to a queue

#### Parameters

- queue_url<~String> - Url of queue to add message to
- message<~String> - Message to add to queue

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QuerySendMessage.html

set_queue_attributes(queue_url, attribute_name, attribute_value)

Get attributes of a queue

#### Parameters

- queue_url<~String> - Url of queue to get attributes for
- attribute_name<~String> - Name of attribute to set, keys in [‘MaximumMessageSize’, ‘MessageRetentionPeriod’, ‘Policy’, ‘VisibilityTimeout’]
- attribute_value<~String> - Value to set for attribute

#### See Also

docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QuerySetQueueAttributes.html

[Validate]