aws 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/awsbase/awsbase.rb +1 -0
- data/lib/ec2/ec2.rb +1 -0
- data/lib/elb/elb_interface.rb +106 -6
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bff10a7cac38b08d6fe22df978795da02d3986d8
|
4
|
+
data.tar.gz: 16cc29bd2736fa5bcdacabeb1cfce739645a34b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654cec5b0dde5782803b0f5c5f59d8e41b444c6ccc8599f953a7e8c8891b6b71bf3808476de48e891eab55f62b8c750c20c5894a0e6928a306e0e3c4f87ec4fa
|
7
|
+
data.tar.gz: 867f637b84da19d74f9d439b684dfd1a1d7efbeec677e7fd217bcb040f8bd0c6932189f52a4871b27037ded5446f6dd073223a2fc06fbc2f33592d721f8fc1b2
|
data/lib/awsbase/awsbase.rb
CHANGED
@@ -145,6 +145,7 @@ module Aws
|
|
145
145
|
@params[:port] = URI.parse(@params[:endpoint_url]).port
|
146
146
|
@params[:service] = URI.parse(@params[:endpoint_url]).path
|
147
147
|
@params[:protocol] = URI.parse(@params[:endpoint_url]).scheme
|
148
|
+
@params[:api_version] ||= service_info[:api_version]
|
148
149
|
@params[:region] = nil
|
149
150
|
else
|
150
151
|
@params[:server] ||= service_info[:default_host]
|
data/lib/ec2/ec2.rb
CHANGED
@@ -554,6 +554,7 @@ module Aws
|
|
554
554
|
'AddressingType' => options[:addressing_type] || DEFAULT_ADDRESSING_TYPE,
|
555
555
|
'InstanceType' => options[:instance_type] || DEFAULT_INSTANCE_TYPE})
|
556
556
|
# optional params
|
557
|
+
params.merge!(hash_params('SecurityGroupId',options[:SecurityGroupId].to_a)) unless Aws::Utils.blank?(options[:SecurityGroupId])
|
557
558
|
params['KeyName'] = options[:key_name] unless Aws::Utils.blank?(options[:key_name])
|
558
559
|
params['KernelId'] = options[:kernel_id] unless Aws::Utils.blank?(options[:kernel_id])
|
559
560
|
params['RamdiskId'] = options[:ramdisk_id] unless Aws::Utils.blank?(options[:ramdisk_id])
|
data/lib/elb/elb_interface.rb
CHANGED
@@ -8,7 +8,7 @@ module Aws
|
|
8
8
|
|
9
9
|
|
10
10
|
#Amazon ELB API version being used
|
11
|
-
API_VERSION = "
|
11
|
+
API_VERSION = "2012-06-01"
|
12
12
|
DEFAULT_HOST = "elasticloadbalancing.amazonaws.com"
|
13
13
|
DEFAULT_PATH = '/'
|
14
14
|
DEFAULT_PROTOCOL = 'https'
|
@@ -108,6 +108,52 @@ module Aws
|
|
108
108
|
on_exception
|
109
109
|
end
|
110
110
|
|
111
|
+
#
|
112
|
+
# name: name of load balancer
|
113
|
+
# listeners: array of hashes containing :load_balancer_port, :instance_port, :protocol
|
114
|
+
# eg: {:load_balancer_port=>80, :instance_port=>8080, :protocol=>"HTTP"}
|
115
|
+
#
|
116
|
+
def create_load_balancer_listeners(name, listeners)
|
117
|
+
params = {}
|
118
|
+
params['LoadBalancerName'] = name
|
119
|
+
i = 1
|
120
|
+
listeners.each do |l|
|
121
|
+
params["Listeners.member.#{i}.Protocol"] = "#{l[:protocol]}"
|
122
|
+
params["Listeners.member.#{i}.LoadBalancerPort"] = "#{l[:load_balancer_port]}"
|
123
|
+
params["Listeners.member.#{i}.InstancePort"] = "#{l[:instance_port]}"
|
124
|
+
i += 1
|
125
|
+
end
|
126
|
+
|
127
|
+
@logger.info("Creating Listeners for LoadBalancer #{name}")
|
128
|
+
|
129
|
+
link = generate_request("CreateLoadBalancerListeners", params)
|
130
|
+
resp = request_info(link, QElbEmptyResponseParser.new(:logger => @logger))
|
131
|
+
|
132
|
+
rescue Exception
|
133
|
+
on_exception
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# name: name of load balancer
|
138
|
+
# ports: array of client port number(s) of the load balancer listener(s) to be removed.
|
139
|
+
#
|
140
|
+
def delete_load_balancer_listeners(name, ports)
|
141
|
+
params = {}
|
142
|
+
params['LoadBalancerName'] = name
|
143
|
+
i = 1
|
144
|
+
ports.each do |l|
|
145
|
+
params["LoadBalancerPorts.member.#{i}"] = "#{l}"
|
146
|
+
i += 1
|
147
|
+
end
|
148
|
+
|
149
|
+
@logger.info("Deleting Listeners for LoadBalancer #{name}")
|
150
|
+
|
151
|
+
link = generate_request("DeleteLoadBalancerListeners", params)
|
152
|
+
resp = request_info(link, QElbEmptyResponseParser.new(:logger => @logger))
|
153
|
+
|
154
|
+
rescue Exception
|
155
|
+
on_exception
|
156
|
+
end
|
111
157
|
|
112
158
|
# name: name of load balancer
|
113
159
|
# instance_ids: array of instance_id's to add to load balancer
|
@@ -149,6 +195,30 @@ module Aws
|
|
149
195
|
on_exception
|
150
196
|
end
|
151
197
|
|
198
|
+
# name: name of load balancer
|
199
|
+
# healthy_threshold: number of successful probes required to enter Healthy state.
|
200
|
+
# unhealthy_threshold: number of unsuccessful probes required to enter Unhealthy state.
|
201
|
+
# interval: interval between probes (seconds)
|
202
|
+
# target: probe target (protocol:port[/path])
|
203
|
+
# timeout: probe response timeout
|
204
|
+
def configure_health_check(name, healthy_threshold, unhealthy_threshold, interval, target, timeout )
|
205
|
+
params = {}
|
206
|
+
params['LoadBalancerName'] = name
|
207
|
+
params['HealthCheck.HealthyThreshold'] = "#{healthy_threshold}"
|
208
|
+
params['HealthCheck.UnhealthyThreshold'] = "#{unhealthy_threshold}"
|
209
|
+
params['HealthCheck.Interval'] = "#{interval}"
|
210
|
+
params['HealthCheck.Target'] = target
|
211
|
+
params['HealthCheck.Timeout'] = "#{timeout}"
|
212
|
+
|
213
|
+
@logger.info("Configuring health check for Load Balancer '#{name}'")
|
214
|
+
|
215
|
+
link = generate_request("ConfigureHealthCheck", params)
|
216
|
+
resp = request_info(link, QElbConfigureHealthCheckParser.new(:logger => @logger))
|
217
|
+
|
218
|
+
rescue Exception
|
219
|
+
on_exception
|
220
|
+
end
|
221
|
+
|
152
222
|
|
153
223
|
def describe_load_balancers(lparams={})
|
154
224
|
@logger.info("Describing Load Balancers")
|
@@ -196,7 +266,7 @@ module Aws
|
|
196
266
|
|
197
267
|
link = generate_request("DeleteLoadBalancer", params)
|
198
268
|
|
199
|
-
resp = request_info(link,
|
269
|
+
resp = request_info(link, QElbEmptyResponseParser.new(:logger => @logger))
|
200
270
|
|
201
271
|
rescue Exception
|
202
272
|
on_exception
|
@@ -231,7 +301,7 @@ module Aws
|
|
231
301
|
|
232
302
|
def tagstart(name, attributes)
|
233
303
|
# puts 'tagstart ' + name + ' -- ' + @xmlpath
|
234
|
-
if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/
|
304
|
+
if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/ListenerDescriptions')
|
235
305
|
@listener = {}
|
236
306
|
end
|
237
307
|
if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/AvailabilityZones')
|
@@ -280,7 +350,7 @@ module Aws
|
|
280
350
|
@member[:health_check][:unhealthy_threshold] = @text.to_i
|
281
351
|
# AvailabilityZones
|
282
352
|
when 'member' then
|
283
|
-
if @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/
|
353
|
+
if @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/ListenerDescriptions'
|
284
354
|
@member[:listeners] << @listener
|
285
355
|
elsif @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/AvailabilityZones'
|
286
356
|
@availability_zone = @text
|
@@ -323,6 +393,35 @@ module Aws
|
|
323
393
|
#
|
324
394
|
end
|
325
395
|
|
396
|
+
class QElbConfigureHealthCheckParser < AwsParser
|
397
|
+
|
398
|
+
def reset
|
399
|
+
@result = {}
|
400
|
+
end
|
401
|
+
|
402
|
+
def tagstart(name, attributes)
|
403
|
+
if name == 'HealthCheck'
|
404
|
+
@result[:health_check] = {}
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
def tagend(name)
|
409
|
+
case name
|
410
|
+
when 'HealthyThreshold' then
|
411
|
+
@result[:health_check][:healthy_threshold] = @text.to_i
|
412
|
+
when 'UnhealthyThreshold' then
|
413
|
+
@result[:health_check][:unhealthy_threshold] = @text.to_i
|
414
|
+
when 'Interval' then
|
415
|
+
@result[:health_check][:interval] = @text.to_i
|
416
|
+
when 'Target' then
|
417
|
+
@result[:health_check][:target] = @text
|
418
|
+
when 'Timeout' then
|
419
|
+
@result[:health_check][:timeout] = @text.to_i
|
420
|
+
end
|
421
|
+
end
|
422
|
+
#
|
423
|
+
end
|
424
|
+
|
326
425
|
class QElbDescribeInstancesHealthParser < AwsParser
|
327
426
|
|
328
427
|
def reset
|
@@ -353,7 +452,7 @@ module Aws
|
|
353
452
|
#
|
354
453
|
end
|
355
454
|
|
356
|
-
class
|
455
|
+
class QElbEmptyResponseParser < AwsParser
|
357
456
|
def reset
|
358
457
|
@result = true
|
359
458
|
end
|
@@ -363,4 +462,5 @@ module Aws
|
|
363
462
|
end
|
364
463
|
|
365
464
|
|
366
|
-
end
|
465
|
+
end
|
466
|
+
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.10.
|
4
|
+
version: 2.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: uuidtools
|