Sha256: a94784c739cdff2154034dd7c9179b3467e709f3d26d09060bc1d432483c7b17
Contents?: true
Size: 1.77 KB
Versions: 2
Compression:
Stored size: 1.77 KB
Contents
module Fog module AWS class ELB class Real require 'fog/aws/parsers/elb/empty' # Sets attributes of the load balancer # # Currently the only attribute that can be set is whether CrossZoneLoadBalancing # is enabled # # http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_ModifyLoadBalancerAttributes.html # ==== Parameters # * lb_name<~String> - Name of the ELB # * options<~Hash> # * 'CrossZoneLoadBalancing'<~Hash>: # * 'Enabled'<~Boolean> whether to enable cross zone load balancing # # ==== Returns # * response<~Excon::Response>: # * body<~Hash>: # * 'ResponseMetadata'<~Hash>: # * 'RequestId'<~String> - Id of request def modify_load_balancer_attributes(lb_name, options) attributes = Fog::AWS.serialize_keys 'LoadBalancerAttributes', options request(attributes.merge( 'Action' => 'ModifyLoadBalancerAttributes', 'LoadBalancerName' => lb_name, :parser => Fog::Parsers::AWS::ELB::Empty.new )) end end class Mock def modify_load_balancer_attributes(lb_name, attributes) raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name] if attributes['CrossZoneLoadBalancing'] load_balancer['LoadBalancerAttributes'].merge! attributes end response = Excon::Response.new response.status = 200 response.body = { "ResponseMetadata" => { "RequestId" => Fog::AWS::Mock.request_id } } response end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-1.22.0 | lib/fog/aws/requests/elb/modify_load_balancer_attributes.rb |
fog-1.21.0 | lib/fog/aws/requests/elb/modify_load_balancer_attributes.rb |