Sha256: c04636644c48724bf7868548395f24c14348d4ccdfc4bb28b0cc631666c7ba48

Contents?: true

Size: 1.83 KB

Versions: 46

Compression:

Stored size: 1.83 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

            load_balancer['Policies']['AppCookieStickinessPolicies'] << { 'CookieName' => cookie_name, 'PolicyName' => policy_name }

            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

46 entries across 46 versions & 15 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.14.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.13.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
gapinc-fog-1.12.1.2 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
gapinc-fog-1.12.1.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
gapinc-fog-1.12.1a lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
gapinc-fog-1.12.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.12.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.12.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
hpfog-0.0.20 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-nirvanix-1.8.2 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.11.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.11.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-nirvanix-1.8.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-1.10.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-parser-fix-1.6.1 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-test-again-1.6.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
fog-test-me-1.10.0 lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb