Sha256: 2b5d2bca613a7ff60a85dd3780df9f3b61d27d2ca374c62007f472d16b7f97ba

Contents?: true

Size: 1.96 KB

Versions: 98

Compression:

Stored size: 1.96 KB

Contents

module Fog
  module AWS
    class ELB
      class Real
        require 'fog/aws/parsers/elb/empty'

        # Create a Load Balancer 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_expiration_period<~Integer> - The time period in seconds after
        #   which the cookie should be considered stale. Not specifying this
        #   parameter indicates that the sticky session will last for the duration of the browser session.
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        def create_lb_cookie_stickiness_policy(lb_name, policy_name, cookie_expiration_period=nil)
          params = {'PolicyName' => policy_name, 'CookieExpirationPeriod' => cookie_expiration_period}

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

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

            create_load_balancer_policy(lb_name, policy_name, 'LBCookieStickinessPolicyType', {'CookieExpirationPeriod' => cookie_expiration_period})

            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

98 entries across 96 versions & 6 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.29.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.28.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.27.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.26.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.25.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.24.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.23.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.22.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.21.1 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.21.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.20.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.19.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.18.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.17.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.16.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.15.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.14.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.13.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb
fog-aws-3.12.0 lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb