mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Take care of Certificates block in listeners parser
This commit is contained in:
parent
9310aaaefa
commit
4ef5513890
3 changed files with 23 additions and 3 deletions
|
@ -6,12 +6,13 @@ module Fog
|
|||
def reset
|
||||
reset_listener
|
||||
@default_action = {}
|
||||
@certificate = {}
|
||||
@results = { 'Listeners' => [] }
|
||||
@response = { 'DescribeListenersResult' => {}, 'ResponseMetadata' => {} }
|
||||
end
|
||||
|
||||
def reset_listener
|
||||
@listener= { 'DefaultActions' => [] }
|
||||
@listener= { 'DefaultActions' => [], 'Certificates' => [] }
|
||||
end
|
||||
|
||||
def start_element(name, attrs = [])
|
||||
|
@ -19,6 +20,8 @@ module Fog
|
|||
case name
|
||||
when 'DefaultActions'
|
||||
@in_default_actions = true
|
||||
when 'Certificates'
|
||||
@in_certificates = true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -28,6 +31,9 @@ module Fog
|
|||
if @in_default_actions
|
||||
@listener['DefaultActions'] << @default_action
|
||||
@default_action = {}
|
||||
elsif @in_certificates
|
||||
@listener['Certificates'] << @certificate
|
||||
@certificate = {}
|
||||
else
|
||||
@results['Listeners'] << @listener
|
||||
reset_listener
|
||||
|
@ -36,9 +42,13 @@ module Fog
|
|||
@listener[name] = value
|
||||
when 'Type', 'TargetGroupArn'
|
||||
@default_action[name] = value
|
||||
when 'CertificateArn'
|
||||
@certificate[name] = value
|
||||
|
||||
when 'DefaultActions'
|
||||
@in_default_actions = false
|
||||
when 'Certificates'
|
||||
@in_certificates = false
|
||||
|
||||
when 'RequestId'
|
||||
@response['ResponseMetadata'][name] = value
|
||||
|
|
|
@ -7,7 +7,7 @@ DESCRIBE_LISTENERS_RESULT = <<-EOF
|
|||
<Listeners>
|
||||
<member>
|
||||
<LoadBalancerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</LoadBalancerArn>
|
||||
<Protocol>HTTP</Protocol>
|
||||
<Protocol>HTTPS</Protocol>
|
||||
<Port>80</Port>
|
||||
<ListenerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2</ListenerArn>
|
||||
<DefaultActions>
|
||||
|
@ -16,6 +16,11 @@ DESCRIBE_LISTENERS_RESULT = <<-EOF
|
|||
<TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn>
|
||||
</member>
|
||||
</DefaultActions>
|
||||
<Certificates>
|
||||
<member>
|
||||
<CertificateArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:certificate/56d36256-1245-40d6-916e-6f5a95e2b4c6</CertificateArn>
|
||||
</member>
|
||||
</Certificates>
|
||||
</member>
|
||||
</Listeners>
|
||||
</DescribeListenersResult>
|
||||
|
|
|
@ -26,12 +26,17 @@ class AWS
|
|||
'DescribeLoadBalancersResult' => {'LoadBalancers' => [LOAD_BALANCER], 'NextMarker' => Fog::Nullable::String}
|
||||
})
|
||||
|
||||
CREATE_LOAD_BALANCER = BASIC.merge({
|
||||
'CreateLoadBalancerResult' => {'LoadBalancers' => [LOAD_BALANCER], 'NextMarker' => Fog::Nullable::String}
|
||||
})
|
||||
|
||||
LISTENER = {
|
||||
"LoadBalancerArn" => String,
|
||||
"Protocol" => String,
|
||||
"Port" => String,
|
||||
"ListenerArn" => String,
|
||||
"DefaultActions" => [{"Type" => String, "TargetGroupArn" => String}]
|
||||
"DefaultActions" => [{"Type" => String, "TargetGroupArn" => String}],
|
||||
"Certificates" => [{"CertificateArn" => String}]
|
||||
}
|
||||
|
||||
DESCRIBE_LISTENERS = BASIC.merge({
|
||||
|
|
Loading…
Add table
Reference in a new issue