amazon-ec2 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/amazon-ec2.gemspec +2 -2
- data/lib/AWS/Autoscaling/autoscaling.rb +4 -2
- data/test/test_Autoscaling_groups.rb +3 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.3
|
data/amazon-ec2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{amazon-ec2}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Glenn Rempe"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-11}
|
13
13
|
s.description = %q{A Ruby library for accessing the Amazon Web Services EC2, ELB, RDS, Cloudwatch, and Autoscaling API's.}
|
14
14
|
s.email = %q{glenn@rempe.us}
|
15
15
|
s.executables = ["ec2-gem-example.rb", "ec2-gem-profile.rb", "ec2sh", "setup.rb"]
|
@@ -73,6 +73,7 @@ module AWS
|
|
73
73
|
# When called as a hash, the values must look like: {:name => "name", :value => "value"}
|
74
74
|
# In the array format, the first value is assumed to be the name and the second is assumed to be the value
|
75
75
|
# @option options [String] :measure_name (nil) the measure name associated with the metric used by the trigger
|
76
|
+
# @option options [optional,String] :namespace (nil) namespace of the metric on which to trigger. Used to describe the monitoring metric.
|
76
77
|
# @option options [String|Integer] :period (nil) the period associated with the metric in seconds
|
77
78
|
# @option options [String] :statistic (nil) The particular statistic used by the trigger when fetching metric statistics to examine. Must be one of the following: Minimum, Maximum, Sum, Average
|
78
79
|
# @option options [String] :trigger_name (nil) the name for this trigger
|
@@ -102,7 +103,7 @@ module AWS
|
|
102
103
|
end
|
103
104
|
|
104
105
|
params = {}
|
105
|
-
params['Unit'] = options[:unit]
|
106
|
+
params['Unit'] = options[:unit] if options[:unit]
|
106
107
|
params['AutoScalingGroupName'] = options[:autoscaling_group_name]
|
107
108
|
case options[:dimensions]
|
108
109
|
when Array
|
@@ -112,9 +113,10 @@ module AWS
|
|
112
113
|
params["Dimensions.member.1.Name"] = options[:dimensions][:name]
|
113
114
|
params["Dimensions.member.1.Value"] = options[:dimensions][:value]
|
114
115
|
else
|
115
|
-
raise ArgumentError, "
|
116
|
+
raise ArgumentError, "Dimensions must be either an array or a hash"
|
116
117
|
end
|
117
118
|
params['MeasureName'] = options[:measure_name]
|
119
|
+
params['Namespace'] = options[:namespace] if options[:namespace]
|
118
120
|
params['Statistic'] = options[:statistic]
|
119
121
|
params['Period'] = options[:period].to_s
|
120
122
|
params['TriggerName'] = options[:trigger_name]
|
@@ -110,10 +110,11 @@ context "autoscaling " do
|
|
110
110
|
'LowerBreachScaleIncrement' => "-1",
|
111
111
|
'UpperThreshold' => "1.5",
|
112
112
|
'UpperBreachScaleIncrement' => "1",
|
113
|
-
'BreachDuration' => "120"
|
113
|
+
'BreachDuration' => "120",
|
114
|
+
'Namespace' => "AWS/EC2",
|
114
115
|
}).returns stub(:body => @create_or_update_trigger_response, :is_a? => true)
|
115
116
|
|
116
|
-
valid_create_or_update_scaling_trigger_params = {:autoscaling_group_name => "AutoScalingGroupName", :dimensions => {:name => "AutoScalingGroupName", :value => "Bob"}, :unit => "Seconds", :measure_name => "CPUUtilization", :statistic => "Average", :period => 120, :trigger_name => "AFunNameForATrigger", :lower_threshold => 0.2, :lower_breach_scale_increment => "-1", :upper_threshold => 1.5, :upper_breach_scale_increment => 1, :breach_duration => 120}
|
117
|
+
valid_create_or_update_scaling_trigger_params = {:autoscaling_group_name => "AutoScalingGroupName", :dimensions => {:name => "AutoScalingGroupName", :value => "Bob"}, :unit => "Seconds", :measure_name => "CPUUtilization", :namespace => "AWS/EC2", :statistic => "Average", :period => 120, :trigger_name => "AFunNameForATrigger", :lower_threshold => 0.2, :lower_breach_scale_increment => "-1", :upper_threshold => 1.5, :upper_breach_scale_increment => 1, :breach_duration => 120}
|
117
118
|
|
118
119
|
%w(dimensions autoscaling_group_name measure_name statistic period trigger_name lower_threshold lower_breach_scale_increment upper_threshold upper_breach_scale_increment breach_duration).each do |meth_str|
|
119
120
|
lambda { @as.create_or_updated_scaling_trigger(valid_create_or_update_scaling_trigger_params.merge(meth_str.to_sym=>nil)) }.should.raise(AWS::ArgumentError)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glenn Rempe
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-11 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|