Class: Fog::Parsers::AWS::ELB::DescribeLoadBalancers
- Inherits:
-
Base
- Object
- Nokogiri::XML::SAX::Document
- Base
- Fog::Parsers::AWS::ELB::DescribeLoadBalancers
show all
- Defined in:
- lib/fog/aws/parsers/elb/describe_load_balancers.rb
Instance Attribute Summary
Attributes inherited from Base
#response
Instance Method Summary
collapse
Methods inherited from Base
#attr_value, #characters, #initialize
Instance Method Details
#end_element(name) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/fog/aws/parsers/elb/describe_load_balancers.rb', line 35
def end_element(name)
case name
when 'member'
if @in_policy_names
@listener_description['PolicyNames'] << @value
elsif @in_availability_zones
@load_balancer['AvailabilityZones'] << @value
elsif @in_listeners
@load_balancer['ListenerDescriptions'] << @listener_description
@listener_description = { 'PolicyNames' => [], 'Listener' => {} }
elsif @in_app_cookies
@load_balancer['Policies']['AppCookieStickinessPolicies'] << @value
elsif @in_lb_cookies
@load_balancer['Policies']['LBCookieStickinessPolicies'] << @value
elsif !@in_instances && !@in_policies
@results['LoadBalancerDescriptions'] << @load_balancer
@load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} }
end
when 'LoadBalancerName', 'DNSName'
@load_balancer[name] = @value
when 'CreatedTime'
@load_balancer[name] = Time.parse(@value)
when 'ListenerDescriptions'
@in_listeners = false
when 'PolicyNames'
@in_policy_names = false
when 'Protocol'
@listener_description['Listener'][name] = @value
when 'LoadBalancerPort', 'InstancePort'
@listener_description['Listener'][name] = @value.to_i
when 'Instances'
@in_instances = false
when 'InstanceId'
@load_balancer['Instances'] << @value
when 'AvailabilityZones'
@in_availability_zones = false
when 'Policies'
@in_policies = false
when 'AppCookieStickinessPolicies'
@in_app_cookies = false
when 'LBCookieStickinessPolicies'
@in_lb_cookies = false
when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold'
@load_balancer['HealthCheck'][name] = @value.to_i
when 'Target'
@load_balancer['HealthCheck'][name] = @value
when 'RequestId'
@response['ResponseMetadata'][name] = @value
when 'DescribeLoadBalancersResponse'
@response['DescribeLoadBalancersResult'] = @results
end
end
|
#reset ⇒ Object
8
9
10
11
12
13
|
# File 'lib/fog/aws/parsers/elb/describe_load_balancers.rb', line 8
def reset
@load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} }
@listener_description = { 'PolicyNames' => [], 'Listener' => {} }
@results = { 'LoadBalancerDescriptions' => [] }
@response = { 'DescribeLoadBalancersResult' => {}, 'ResponseMetadata' => {} }
end
|
#start_element(name, attrs = []) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/fog/aws/parsers/elb/describe_load_balancers.rb', line 15
def start_element(name, attrs = [])
super
case name
when 'ListenerDescriptions'
@in_listeners = true
when 'Instances'
@in_instances = true
when 'AvailabilityZones'
@in_availability_zones = true
when 'PolicyNames'
@in_policy_names = true
when 'Policies'
@in_policies = true
when 'LBCookieStickinessPolicies'
@in_lb_cookies = true
when 'AppCookieStickinessPolicies'
@in_app_cookies = true
end
end
|