mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|elb] Add new attributes for 2011-04-05 API.
This commit is contained in:
parent
9ea567cbcf
commit
cc2ab5e8ec
4 changed files with 14 additions and 2 deletions
|
@ -11,6 +11,7 @@ module Fog
|
|||
attribute :dns_name, :aliases => 'DNSName'
|
||||
attribute :health_check, :aliases => 'HealthCheck'
|
||||
attribute :instances, :aliases => 'Instances'
|
||||
attribute :source_group, :aliases => 'SourceSecurityGroup'
|
||||
|
||||
def initialize(attributes={})
|
||||
attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d)
|
||||
|
|
|
@ -14,7 +14,7 @@ module Fog
|
|||
end
|
||||
|
||||
def reset_load_balancer
|
||||
@load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} }
|
||||
@load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {}, 'SourceSecurityGroup' => {} }
|
||||
end
|
||||
|
||||
def reset_listener_description
|
||||
|
@ -66,7 +66,7 @@ module Fog
|
|||
reset_load_balancer
|
||||
end
|
||||
|
||||
when 'LoadBalancerName', 'DNSName'
|
||||
when 'CanonicalHostedZoneName', 'CanonicalHostedZoneNameID', 'LoadBalancerName', 'DNSName'
|
||||
@load_balancer[name] = value
|
||||
when 'CreatedTime'
|
||||
@load_balancer[name] = Time.parse(value)
|
||||
|
@ -95,6 +95,9 @@ module Fog
|
|||
when 'LBCookieStickinessPolicies'
|
||||
@in_lb_cookies = false
|
||||
|
||||
when 'OwnerAlias', 'GroupName'
|
||||
@load_balancer['SourceSecurityGroup'][name] = value
|
||||
|
||||
when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold'
|
||||
@load_balancer['HealthCheck'][name] = value.to_i
|
||||
when 'Target'
|
||||
|
|
|
@ -18,6 +18,8 @@ module Fog
|
|||
# * 'DescribeLoadBalancersResult'<~Hash>:
|
||||
# * 'LoadBalancerDescriptions'<~Array>
|
||||
# * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer
|
||||
# * 'CanonicalHostedZoneName'<~String> - name of the Route 53 hosted zone associated with the load balancer
|
||||
# * 'CanonicalHostedZoneNameID'<~String> - ID of the Route 53 hosted zone associated with the load balancer
|
||||
# * 'CreatedTime'<~Time> - time load balancer was created
|
||||
# * 'DNSName'<~String> - external DNS name of load balancer
|
||||
# * 'HealthCheck'<~Hash>:
|
||||
|
@ -37,6 +39,9 @@ module Fog
|
|||
# * 'Policies'<~Hash>:
|
||||
# * 'LBCookieStickinessPolicies'<~Array> - list of Load Balancer Generated Cookie Stickiness policies for the LoadBalancer
|
||||
# * 'AppCookieStickinessPolicies'<~Array> - list of Application Generated Cookie Stickiness policies for the LoadBalancer
|
||||
# * 'SourceSecurityGroup'<~Hash>:
|
||||
# * 'GroupName'<~String> - Name of the source security group to use with inbound security group rules
|
||||
# * 'OwnerAlias'<~String> - Owner of the source security group
|
||||
def describe_load_balancers(lb_name = [])
|
||||
params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
|
||||
request({
|
||||
|
|
|
@ -8,6 +8,8 @@ class AWS
|
|||
|
||||
LOAD_BALANCER = {
|
||||
"AvailabilityZones" => Array,
|
||||
"CanonicalHostedZoneName" => String,
|
||||
"CanonicalHostedZoneNameID" => String,
|
||||
"CreatedTime" => Time,
|
||||
"DNSName" => String,
|
||||
"HealthCheck" => {"HealthyThreshold" => Integer, "Timeout" => Integer, "UnhealthyThreshold" => Integer, "Interval" => Integer, "Target" => String},
|
||||
|
@ -15,6 +17,7 @@ class AWS
|
|||
"ListenerDescriptions" => Array,
|
||||
"LoadBalancerName" => String,
|
||||
"Policies" => {"LBCookieStickinessPolicies" => Array, "AppCookieStickinessPolicies" => Array},
|
||||
"SourceSecurityGroup" => {"GroupName" => String, "OwnerAlias" => String},
|
||||
}
|
||||
|
||||
CREATE_LOAD_BALANCER = BASIC.merge({
|
||||
|
|
Loading…
Reference in a new issue