amazon-ec2 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5
1
+ 0.9.6
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.5"
8
+ s.version = "0.9.6"
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-23}
12
+ s.date = %q{2010-02-25}
13
13
  s.description = %q{A Ruby library for accessing the Amazon Web Services EC2, ELB, RDS, Cloudwatch, and Autoscaling APIs.}
14
14
  s.email = %q{glenn@rempe.us}
15
15
  s.executables = ["ec2-gem-example.rb", "ec2-gem-profile.rb", "ec2sh", "setup.rb"]
@@ -22,6 +22,7 @@ module AWS
22
22
  # The CreateSnapshot operation creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to launch instances from identical snapshots, and to save data before shutting down an instance.
23
23
  #
24
24
  # @option options [String] :volume_id ('')
25
+ # @option options [optional,String] :description ('') Description of the Amazon EBS snapshot.
25
26
  #
26
27
  def create_snapshot( options = {} )
27
28
  options = { :volume_id => '' }.merge(options)
@@ -29,6 +30,7 @@ module AWS
29
30
  params = {
30
31
  "VolumeId" => options[:volume_id]
31
32
  }
33
+ params["Description"] = options[:description] unless options[:description].nil?
32
34
  return response_generator(:action => "CreateSnapshot", :params => params)
33
35
  end
34
36
 
@@ -14,8 +14,8 @@ module AWS
14
14
  # @option options [String] :product_description (nil)
15
15
  #
16
16
  def describe_spot_price_history( options = {} )
17
- raise ArgumentError, ":start_time must be a Time object" unless options[:start_time].nil? || Time == options[:start_time].class
18
- raise ArgumentError, ":end_time must be a Time object" unless options[:end_time].nil? || Time == options[:end_time].class
17
+ raise ArgumentError, ":start_time must be a Time object" unless options[:start_time].nil? || options[:start_time].kind_of?(Time)
18
+ raise ArgumentError, ":end_time must be a Time object" unless options[:end_time].nil? || options[:end_time].kind_of?(Time)
19
19
  raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["m1.small", "m1.large", "m1.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge"].include?(options[:instance_type])
20
20
  raise ArgumentError, ":product_description must be 'Linux/UNIX' or 'Windows'" unless options[:product_description].nil? || ["Linux/UNIX", "Windows"].include?(options[:product_description])
21
21
 
@@ -32,6 +32,7 @@ context "EC2 snaphots " do
32
32
  <status>pending</status>
33
33
  <startTime>2008-05-07T12:51:50.000Z</startTime>
34
34
  <progress></progress>
35
+ <description>Daily Backup</description>
35
36
  </CreateSnapshotResponse>
36
37
  RESPONSE
37
38
 
@@ -70,6 +71,20 @@ context "EC2 snaphots " do
70
71
  response.progress.should.equal nil
71
72
  end
72
73
 
74
+ specify "should be able to be created with a volume_id and description" do
75
+ @ec2.stubs(:make_request).with('CreateSnapshot', {"VolumeId" => "vol-4d826724", "Description" => "Daily Backup"}).
76
+ returns stub(:body => @create_snapshot_response_body, :is_a? => true)
77
+
78
+ @ec2.create_snapshot( :volume_id => "vol-4d826724", :description => "Daily Backup" ).should.be.an.instance_of Hash
79
+
80
+ response = @ec2.create_snapshot( :volume_id => "vol-4d826724", :description => "Daily Backup")
81
+ response.snapshotId.should.equal "snap-78a54011"
82
+ response.volumeId.should.equal "vol-4d826724"
83
+ response.status.should.equal "pending"
84
+ response.progress.should.equal nil
85
+ response.description.should.equal "Daily Backup"
86
+ end
87
+
73
88
  specify "should be able to be deleted with a snapsot_id" do
74
89
  @ec2.stubs(:make_request).with('DeleteSnapshot', {"SnapshotId" => "snap-78a54011"}).
75
90
  returns stub(:body => @delete_snapshot_response_body, :is_a? => true)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 5
9
- version: 0.9.5
8
+ - 6
9
+ version: 0.9.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Glenn Rempe
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-02-23 00:00:00 -08:00
17
+ date: 2010-02-25 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency