mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
add load_balancer_id attr to elb/policy
* fix 1.9 only syntax * don't rely on possible collection for a required attribute
This commit is contained in:
parent
cdd724dff6
commit
8a2bd922ab
2 changed files with 13 additions and 8 deletions
|
@ -31,9 +31,10 @@ module Fog
|
|||
policy_attribute_descriptions = e["PolicyAttributeDescriptions"]
|
||||
|
||||
policy = {
|
||||
:id => e["PolicyName"],
|
||||
:type_name => e["PolicyTypeName"],
|
||||
:policy_attributes => policy_attributes(policy_attribute_descriptions)
|
||||
:id => e["PolicyName"],
|
||||
:type_name => e["PolicyTypeName"],
|
||||
:policy_attributes => policy_attributes(policy_attribute_descriptions),
|
||||
:load_balancer_id => self.load_balancer_id,
|
||||
}
|
||||
|
||||
case e["PolicyTypeName"]
|
||||
|
|
|
@ -8,12 +8,13 @@ module Fog
|
|||
attribute :expiration, :aliases => 'CookieExpirationPeriod'
|
||||
attribute :type_name
|
||||
attribute :policy_attributes
|
||||
attribute :load_balancer_id
|
||||
|
||||
attr_accessor :cookie_stickiness # Either :app or :lb
|
||||
|
||||
def save
|
||||
requires :id, :load_balancer
|
||||
args = [load_balancer.id, id]
|
||||
requires :id, :load_balancer_id
|
||||
args = [load_balancer_id, id]
|
||||
|
||||
if cookie_stickiness
|
||||
case cookie_stickiness
|
||||
|
@ -39,13 +40,16 @@ module Fog
|
|||
end
|
||||
|
||||
def destroy
|
||||
requires :id, :load_balancer
|
||||
service.delete_load_balancer_policy(load_balancer.id, id)
|
||||
requires :identity, :load_balancer_id
|
||||
|
||||
service.delete_load_balancer_policy(self.load_balancer_id, self.identity)
|
||||
reload
|
||||
end
|
||||
|
||||
def load_balancer
|
||||
service.load_balancers.new(identity: collection.load_balancer_id)
|
||||
requires :load_balancer_id
|
||||
|
||||
service.load_balancers.new(:identity => self.load_balancer_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue