From b1eccb2cc4f6b80cb25f8e0dc2f8057d771bc1a8 Mon Sep 17 00:00:00 2001 From: Jason Haruska Date: Tue, 15 Nov 2011 11:09:02 -0500 Subject: [PATCH] add new cc2.8xlarge instance --- lib/AWS/EC2/instances.rb | 2 +- lib/AWS/EC2/spot_instance_requests.rb | 2 +- lib/AWS/EC2/spot_prices.rb | 2 +- lib/AWS/RDS/rds.rb | 2 +- test/test_EC2_instances.rb | 2 +- test/test_EC2_spot_instance_requests.rb | 2 +- test/test_EC2_spot_prices.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/AWS/EC2/instances.rb b/lib/AWS/EC2/instances.rb index 71f7653..79fff25 100644 --- a/lib/AWS/EC2/instances.rb +++ b/lib/AWS/EC2/instances.rb @@ -37,7 +37,7 @@ def run_instances( options = {} ) raise ArgumentError, ":image_id must be provided" if options[:image_id].nil? || options[:image_id].empty? raise ArgumentError, ":min_count is not valid" unless options[:min_count].to_i > 0 raise ArgumentError, ":max_count is not valid or must be >= :min_count" unless options[:max_count].to_i > 0 && options[:max_count].to_i >= options[:min_count].to_i - raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].include?(options[:instance_type]) + raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cc2.8xlarge"].include?(options[:instance_type]) raise ArgumentError, ":monitoring_enabled must be 'true' or 'false'" unless options[:monitoring_enabled].nil? || [true, false].include?(options[:monitoring_enabled]) raise ArgumentError, ":disable_api_termination must be 'true' or 'false'" unless options[:disable_api_termination].nil? || [true, false].include?(options[:disable_api_termination]) raise ArgumentError, ":instance_initiated_shutdown_behavior must be 'stop' or 'terminate'" unless options[:instance_initiated_shutdown_behavior].nil? || ["stop", "terminate"].include?(options[:instance_initiated_shutdown_behavior]) diff --git a/lib/AWS/EC2/spot_instance_requests.rb b/lib/AWS/EC2/spot_instance_requests.rb index 52cc1cc..a886909 100644 --- a/lib/AWS/EC2/spot_instance_requests.rb +++ b/lib/AWS/EC2/spot_instance_requests.rb @@ -37,7 +37,7 @@ def request_spot_instances( options = {} ) raise ArgumentError, ":addressing_type has been deprecated." if options[:addressing_type] raise ArgumentError, ":spot_price must be provided" if options[:spot_price].nil? || options[:spot_price].empty? raise ArgumentError, ":base64_encoded must be 'true' or 'false'" unless [true, false].include?(options[:base64_encoded]) - raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].include?(options[:instance_type]) + raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cc2.8xlarge"].include?(options[:instance_type]) user_data = extract_user_data(options) diff --git a/lib/AWS/EC2/spot_prices.rb b/lib/AWS/EC2/spot_prices.rb index c0c9c7f..c63827b 100644 --- a/lib/AWS/EC2/spot_prices.rb +++ b/lib/AWS/EC2/spot_prices.rb @@ -16,7 +16,7 @@ class Base < AWS::Base def describe_spot_price_history( options = {} ) raise ArgumentError, ":start_time must be a Time object" unless options[:start_time].nil? || options[:start_time].kind_of?(Time) raise ArgumentError, ":end_time must be a Time object" unless options[:end_time].nil? || options[:end_time].kind_of?(Time) - raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cg1.4xlarge"].include?(options[:instance_type]) + raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cc2.8xlarge", "cg1.4xlarge"].include?(options[:instance_type]) raise ArgumentError, ":product_description must be 'Linux/UNIX' or 'Windows'" unless options[:product_description].nil? || ["Linux/UNIX", "Windows"].include?(options[:product_description]) params = {} diff --git a/lib/AWS/RDS/rds.rb b/lib/AWS/RDS/rds.rb index 2539e52..4f5efe2 100644 --- a/lib/AWS/RDS/rds.rb +++ b/lib/AWS/RDS/rds.rb @@ -471,7 +471,7 @@ def restore_db_instance_from_snapshot( options = {} ) # @option options [optional, Boolean] :use_latest_restorable_time specifies that the db be restored to the latest restored time. Conditional, cannot be specified if :restore_time parameter is provided. # @option options [optional, Date] :restore_time specifies the date and time to restore from. Conditional, cannot be specified if :use_latest_restorable_time parameter is true. # @option options [String] :target_db_instance_identifier is the name of the new database instance to be created. - # @option options [optional, String] :db_instance_class specifies the class of the compute and memory of the EC2 instance, Options : db.m1.small | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge | db.cc1.4xlarge + # @option options [optional, String] :db_instance_class specifies the class of the compute and memory of the EC2 instance, Options : db.m1.small | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge | db.cc1.4xlarge | db.cc2.8xlarge # @option options [optional, Integer] :port is the port which the db can accept connections on. Constraints: Value must be 1115-65535 # @option options [optional, String] :availability_zone is the EC2 zone which the db instance will be created # diff --git a/test/test_EC2_instances.rb b/test/test_EC2_instances.rb index 2d771d4..4a9a31b 100644 --- a/test/test_EC2_instances.rb +++ b/test/test_EC2_instances.rb @@ -332,7 +332,7 @@ # :instance_type - ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].each do |type| + ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cc2.8xlarge"].each do |type| @ec2.stubs(:make_request).with('RunInstances', "ImageId" => "ami-60a54009", "MinCount" => '1', "MaxCount" => '1', "InstanceType" => type). returns stub(:body => @run_instances_response_body, :is_a? => true) lambda { @ec2.run_instances( :image_id => "ami-60a54009", :instance_type => type ) }.should.not.raise(AWS::ArgumentError) diff --git a/test/test_EC2_spot_instance_requests.rb b/test/test_EC2_spot_instance_requests.rb index c751ac0..c80a779 100644 --- a/test/test_EC2_spot_instance_requests.rb +++ b/test/test_EC2_spot_instance_requests.rb @@ -108,7 +108,7 @@ end specify "should be able to be requested with various instance sizes" do - ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].each do |type| + ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cc2.8xlarge"].each do |type| @ec2.stubs(:make_request).with('RequestSpotInstances', {"SpotPrice"=>"0.50", 'LaunchSpecification.InstanceType' => type, 'LaunchSpecification.ImageId' => 'ami-60a54009', "InstanceCount"=>"1"}). returns stub(:body => @create_spot_instances_request_response_body, :is_a? => true) lambda { @ec2.request_spot_instances( :image_id => "ami-60a54009", :instance_type => type, :spot_price => '0.50' ) }.should.not.raise(AWS::ArgumentError) diff --git a/test/test_EC2_spot_prices.rb b/test/test_EC2_spot_prices.rb index ec9b63d..5339d13 100644 --- a/test/test_EC2_spot_prices.rb +++ b/test/test_EC2_spot_prices.rb @@ -41,7 +41,7 @@ end specify "should be able to be requested with various instance types" do - ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cg1.4xlarge"].each do |type| + ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cc2.4xlarge", "cg1.4xlarge"].each do |type| @ec2.stubs(:make_request).with('DescribeSpotPriceHistory', {'InstanceType' => type}). returns stub(:body => @describe_spot_price_history_response_body, :is_a? => true) lambda { @ec2.describe_spot_price_history( :instance_type => type ) }.should.not.raise(AWS::ArgumentError)