amazon-ec2 0.7.8 → 0.7.9

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.8
1
+ 0.7.9
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{amazon-ec2}
8
- s.version = "0.7.8"
8
+ s.version = "0.7.9"
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{2009-12-21}
12
+ s.date = %q{2009-12-22}
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"]
@@ -47,33 +47,55 @@ module AWS
47
47
  end
48
48
 
49
49
 
50
- # Not yet implemented
50
+ # The DescribeSnapshotAttribute operation returns information about an attribute of a snapshot. Only one attribute can be specified per call.
51
51
  #
52
- # @todo Implement this method
52
+ # @option options [String] :attribute ('createVolumePermission') Attribute to modify.
53
+ # @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot.
53
54
  #
54
55
  def describe_snapshot_attribute( options = {} )
55
- raise "Not yet implemented"
56
+ params = { "Attribute" => options[:attribute] || 'createVolumePermission' }
57
+ params.merge!(pathlist("SnapshotId", options[:snapshot_id] )) unless options[:snapshot_id].nil? || options[:snapshot_id] == []
58
+ return response_generator(:action => "DescribeSnapshotAttribute", :params => params)
56
59
  end
57
60
 
58
61
 
59
- # Not yet implemented
62
+ # The ModifySnapshotAttribute operation adds or remove permission settings for the specified snapshot.
60
63
  #
61
- # @todo Implement this method
64
+ # @option options [String] :snapshot_id ('') The ID of the Amazon EBS snapshot.
65
+ # @option options [String] :attribute ('createVolumePermission') Attribute to modify.
66
+ # @option options [String] :operation_type ('') Operation to perform on the attribute.
67
+ # @option options [optional,String] :user_id ('') Account ID of a user that can create volumes from the snapshot.
68
+ # @option options [optional,String] :user_group ('') Group that is allowed to create volumes from the snapshot.
62
69
  #
63
70
  def modify_snapshot_attribute( options = {} )
64
- raise "Not yet implemented"
71
+ options = { :snapshot_id => '' }.merge(options)
72
+ raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
73
+ options = { :operation_type => '' }.merge(options)
74
+ raise ArgumentError, "No :operation_type provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
75
+ params = {
76
+ "Attribute" => options[:attribute] || 'createVolumePermission',
77
+ "SnapshotId" => options[:snapshot_id],
78
+ "OperationType" => options[:operation_type]
79
+ }
80
+ params["UserId"] = options[:user_id] unless options[:user_id].nil?
81
+ params["UserGroup"] = options[:user_group] unless options[:user_group].nil?
82
+ return response_generator(:action => "ModifySnapshotAttribute", :params => params)
65
83
  end
66
84
 
67
85
 
68
- # Not yet implemented
86
+ # The ResetSnapshotAttribute operation resets permission settings for the specified snapshot.
69
87
  #
70
- # @todo Implement this method
88
+ # @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot.
89
+ # @option options [String] :attribute ('createVolumePermission') Attribute to reset.
71
90
  #
72
91
  def reset_snapshot_attribute( options = {} )
73
- raise "Not yet implemented"
92
+ options = { :snapshot_id => '' }.merge(options)
93
+ raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
94
+ params = { "Attribute" => options[:attribute] || 'createVolumePermission' }
95
+ params["SnapshotId"] = options[:snapshot_id] unless options[:snapshot_id].nil? || options[:snapshot_id].empty?
96
+ return response_generator(:action => "ResetSnapshotAttribute", :params => params)
74
97
  end
75
98
 
76
-
77
99
  end
78
100
  end
79
101
  end
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.7.8
4
+ version: 0.7.9
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: 2009-12-21 00:00:00 -08:00
12
+ date: 2009-12-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency