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 :dns_name, :aliases => 'DNSName'
|
||||||
attribute :health_check, :aliases => 'HealthCheck'
|
attribute :health_check, :aliases => 'HealthCheck'
|
||||||
attribute :instances, :aliases => 'Instances'
|
attribute :instances, :aliases => 'Instances'
|
||||||
|
attribute :source_group, :aliases => 'SourceSecurityGroup'
|
||||||
|
|
||||||
def initialize(attributes={})
|
def initialize(attributes={})
|
||||||
attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d)
|
attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d)
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_load_balancer
|
def reset_load_balancer
|
||||||
@load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} }
|
@load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {}, 'SourceSecurityGroup' => {} }
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_listener_description
|
def reset_listener_description
|
||||||
|
@ -66,7 +66,7 @@ module Fog
|
||||||
reset_load_balancer
|
reset_load_balancer
|
||||||
end
|
end
|
||||||
|
|
||||||
when 'LoadBalancerName', 'DNSName'
|
when 'CanonicalHostedZoneName', 'CanonicalHostedZoneNameID', 'LoadBalancerName', 'DNSName'
|
||||||
@load_balancer[name] = value
|
@load_balancer[name] = value
|
||||||
when 'CreatedTime'
|
when 'CreatedTime'
|
||||||
@load_balancer[name] = Time.parse(value)
|
@load_balancer[name] = Time.parse(value)
|
||||||
|
@ -95,6 +95,9 @@ module Fog
|
||||||
when 'LBCookieStickinessPolicies'
|
when 'LBCookieStickinessPolicies'
|
||||||
@in_lb_cookies = false
|
@in_lb_cookies = false
|
||||||
|
|
||||||
|
when 'OwnerAlias', 'GroupName'
|
||||||
|
@load_balancer['SourceSecurityGroup'][name] = value
|
||||||
|
|
||||||
when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold'
|
when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold'
|
||||||
@load_balancer['HealthCheck'][name] = value.to_i
|
@load_balancer['HealthCheck'][name] = value.to_i
|
||||||
when 'Target'
|
when 'Target'
|
||||||
|
|
|
@ -18,6 +18,8 @@ module Fog
|
||||||
# * 'DescribeLoadBalancersResult'<~Hash>:
|
# * 'DescribeLoadBalancersResult'<~Hash>:
|
||||||
# * 'LoadBalancerDescriptions'<~Array>
|
# * 'LoadBalancerDescriptions'<~Array>
|
||||||
# * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer
|
# * '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
|
# * 'CreatedTime'<~Time> - time load balancer was created
|
||||||
# * 'DNSName'<~String> - external DNS name of load balancer
|
# * 'DNSName'<~String> - external DNS name of load balancer
|
||||||
# * 'HealthCheck'<~Hash>:
|
# * 'HealthCheck'<~Hash>:
|
||||||
|
@ -37,6 +39,9 @@ module Fog
|
||||||
# * 'Policies'<~Hash>:
|
# * 'Policies'<~Hash>:
|
||||||
# * 'LBCookieStickinessPolicies'<~Array> - list of Load Balancer Generated Cookie Stickiness policies for the LoadBalancer
|
# * '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
|
# * '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 = [])
|
def describe_load_balancers(lb_name = [])
|
||||||
params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
|
params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
|
||||||
request({
|
request({
|
||||||
|
|
|
@ -8,6 +8,8 @@ class AWS
|
||||||
|
|
||||||
LOAD_BALANCER = {
|
LOAD_BALANCER = {
|
||||||
"AvailabilityZones" => Array,
|
"AvailabilityZones" => Array,
|
||||||
|
"CanonicalHostedZoneName" => String,
|
||||||
|
"CanonicalHostedZoneNameID" => String,
|
||||||
"CreatedTime" => Time,
|
"CreatedTime" => Time,
|
||||||
"DNSName" => String,
|
"DNSName" => String,
|
||||||
"HealthCheck" => {"HealthyThreshold" => Integer, "Timeout" => Integer, "UnhealthyThreshold" => Integer, "Interval" => Integer, "Target" => String},
|
"HealthCheck" => {"HealthyThreshold" => Integer, "Timeout" => Integer, "UnhealthyThreshold" => Integer, "Interval" => Integer, "Target" => String},
|
||||||
|
@ -15,6 +17,7 @@ class AWS
|
||||||
"ListenerDescriptions" => Array,
|
"ListenerDescriptions" => Array,
|
||||||
"LoadBalancerName" => String,
|
"LoadBalancerName" => String,
|
||||||
"Policies" => {"LBCookieStickinessPolicies" => Array, "AppCookieStickinessPolicies" => Array},
|
"Policies" => {"LBCookieStickinessPolicies" => Array, "AppCookieStickinessPolicies" => Array},
|
||||||
|
"SourceSecurityGroup" => {"GroupName" => String, "OwnerAlias" => String},
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATE_LOAD_BALANCER = BASIC.merge({
|
CREATE_LOAD_BALANCER = BASIC.merge({
|
||||||
|
|
Loading…
Reference in a new issue