Sha256: 93610b25cffe2d142c420b8a1ff05ab3543b71cef6d4683956ad9f4443ca3a46

Contents?: true

Size: 1.67 KB

Versions: 99

Compression:

Stored size: 1.67 KB

Contents

module Fog
  module AWS
    class SQS
      class Real

        require 'fog/aws/parsers/sqs/basic'

        # 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
        # http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QuerySetQueueAttributes.html
        #

        def set_queue_attributes(queue_url, attribute_name, attribute_value)
          request({
            'Action'          => 'SetQueueAttributes',
            'Attribute.Name'  => attribute_name,
            'Attribute.Value' => attribute_value,
            :path             => path_from_queue_url(queue_url),
            :parser           => Fog::Parsers::AWS::SQS::Basic.new
          })
        end

      end
      
      class Mock
        def set_queue_attributes(queue_url, attribute_name, attribute_value)
          Excon::Response.new.tap do |response|
            if (queue = data[:queues][queue_url])
              response.status = 200
              queue['Attributes'][attribute_name] = attribute_value
              response.body = {
                'ResponseMetadata' => {
                  'RequestId' => Fog::AWS::Mock.request_id
                }
              }
            else
              response.status = 404
              raise(Excon::Errors.status_error({:expects => 200}, response))
            end
          end
        end
      end
    end
  end
end

Version data entries

99 entries across 99 versions & 17 rubygems

Version Path
fog-test-again-1.6.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-test-me-1.10.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-parser-fix-1.6.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.10.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.9.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/aws/requests/sqs/set_queue_attributes.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-sgonyea-1.8.1 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.8.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.7.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.6.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.5.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
fog-1.4.0 lib/fog/aws/requests/sqs/set_queue_attributes.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/set_queue_attributes.rb
michiels-fog-1.3.1 lib/fog/aws/requests/sqs/set_queue_attributes.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/aws/requests/sqs/set_queue_attributes.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/set_queue_attributes.rb