Sha256: 41496ecdfd9ce67ac44dc4053440fa86a25f46ea3b8ad259fa01f51f704c5f17

Contents?: true

Size: 1.7 KB

Versions: 44

Compression:

Stored size: 1.7 KB

Contents

module Fog
  module AWS
    class ELB
      class Real

        require 'fog/aws/parsers/elb/empty'

        # Create an app cookie stickiness policy
        #
        # ==== Parameters
        # * lb_name<~String> - Name of the ELB
        # * policy_name<~String> - The name of the policy being created.
        #   The name must be unique within the set of policies for this Load Balancer.
        # * cookie_name<~String> - Name of the application cookie used for stickiness.
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        def create_app_cookie_stickiness_policy(lb_name, policy_name, cookie_name)
          params = {'CookieName' => cookie_name, 'PolicyName' => policy_name}

          request({
            'Action'           => 'CreateAppCookieStickinessPolicy',
            'LoadBalancerName' => lb_name,
            :parser            => Fog::Parsers::AWS::ELB::Empty.new
          }.merge!(params))
        end

      end

      class Mock
        def create_app_cookie_stickiness_policy(lb_name, policy_name, cookie_name)
          if load_balancer = self.data[:load_balancers][lb_name]
            response = Excon::Response.new
            response.status = 200

            create_load_balancer_policy(lb_name, policy_name, 'AppCookieStickinessPolicyType', {'CookieName' => cookie_name})

            response.body = {
              'ResponseMetadata' => {
                'RequestId' => Fog::AWS::Mock.request_id
              }
            }

            response
          else
            raise Fog::AWS::ELB::NotFound
          end
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
fog-1.22.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.21.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.20.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.19.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb