amazon-ec2 0.4.8 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/ChangeLog +7 -4
  2. data/README.rdoc +12 -12
  3. data/README_dev.rdoc +6 -0
  4. data/Rakefile +2 -1
  5. data/VERSION +1 -1
  6. data/amazon-ec2.gemspec +25 -18
  7. data/bin/ec2-gem-example.rb +3 -3
  8. data/bin/ec2-gem-profile.rb +2 -2
  9. data/bin/ec2sh +4 -4
  10. data/bin/setup.rb +4 -2
  11. data/lib/{EC2.rb → AWS.rb} +33 -67
  12. data/lib/AWS/EC2.rb +67 -0
  13. data/lib/AWS/EC2/availability_zones.rb +43 -0
  14. data/lib/AWS/EC2/console.rb +46 -0
  15. data/lib/AWS/EC2/elastic_ips.rb +154 -0
  16. data/lib/AWS/EC2/image_attributes.rb +168 -0
  17. data/lib/AWS/EC2/images.rb +136 -0
  18. data/lib/AWS/EC2/instances.rb +218 -0
  19. data/lib/AWS/EC2/keypairs.rb +96 -0
  20. data/lib/AWS/EC2/products.rb +45 -0
  21. data/lib/AWS/EC2/security_groups.rb +234 -0
  22. data/lib/AWS/EC2/snapshots.rb +96 -0
  23. data/lib/AWS/EC2/volumes.rb +172 -0
  24. data/lib/AWS/ELB.rb +67 -0
  25. data/lib/AWS/ELB/load_balancers.rb +198 -0
  26. data/lib/{EC2 → AWS}/exceptions.rb +21 -2
  27. data/lib/{EC2 → AWS}/responses.rb +4 -5
  28. data/perftools/ec2prof-results.txt +4 -4
  29. data/perftools/ec2prof.symbols +4 -4
  30. data/test/test_EC2.rb +14 -14
  31. data/test/test_EC2_availability_zones.rb +2 -2
  32. data/test/test_EC2_console.rb +5 -5
  33. data/test/test_EC2_elastic_ips.rb +13 -13
  34. data/test/test_EC2_image_attributes.rb +35 -35
  35. data/test/test_EC2_images.rb +7 -7
  36. data/test/test_EC2_instances.rb +35 -35
  37. data/test/test_EC2_keypairs.rb +10 -10
  38. data/test/test_EC2_products.rb +7 -7
  39. data/test/test_EC2_responses.rb +2 -2
  40. data/test/test_EC2_s3_xmlsimple.rb +2 -2
  41. data/test/test_EC2_security_groups.rb +13 -13
  42. data/test/test_EC2_snapshots.rb +2 -2
  43. data/test/test_EC2_volumes.rb +2 -2
  44. data/test/test_ELB_load_balancers.rb +239 -0
  45. data/test/test_helper.rb +1 -1
  46. metadata +24 -17
  47. data/lib/EC2/availability_zones.rb +0 -41
  48. data/lib/EC2/console.rb +0 -44
  49. data/lib/EC2/elastic_ips.rb +0 -153
  50. data/lib/EC2/image_attributes.rb +0 -166
  51. data/lib/EC2/images.rb +0 -134
  52. data/lib/EC2/instances.rb +0 -216
  53. data/lib/EC2/keypairs.rb +0 -94
  54. data/lib/EC2/products.rb +0 -43
  55. data/lib/EC2/security_groups.rb +0 -232
  56. data/lib/EC2/snapshots.rb +0 -94
  57. data/lib/EC2/volumes.rb +0 -170
data/lib/EC2/snapshots.rb DELETED
@@ -1,94 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library, EBS snaphshots support
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Yann Klis (mailto:yann.klis@novelys.com)
6
- # Copyright:: Copyright (c) 2008 Yann Klis
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- module EC2
12
-
13
- class Base
14
-
15
- #Amazon Developer Guide Docs:
16
- #
17
- # The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
18
- #
19
- #Required Arguments:
20
- #
21
- # none
22
- #
23
- #Optional Arguments:
24
- #
25
- # :snapshot_id => Array (default : [])
26
- #
27
-
28
- def describe_snapshots( options = {} )
29
-
30
- options = { :snapshot_id => [] }.merge(options)
31
-
32
- params = pathlist("SnapshotId", options[:snapshot_id] )
33
-
34
- return response_generator(:action => "DescribeSnapshots", :params => params)
35
-
36
- end
37
-
38
- #Amazon Developer Guide Docs:
39
- #
40
- # 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.
41
- #
42
- #Required Arguments:
43
- #
44
- # :volume_id => String (default : '')
45
- #
46
- #Optional Arguments:
47
- #
48
- # none
49
- #
50
-
51
- def create_snapshot( options = {} )
52
-
53
- # defaults
54
- options = { :volume_id => '' }.merge(options)
55
-
56
- raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
57
-
58
- params = {
59
- "VolumeId" => options[:volume_id]
60
- }
61
-
62
- return response_generator(:action => "CreateSnapshot", :params => params)
63
-
64
- end
65
-
66
- #Amazon Developer Guide Docs:
67
- #
68
- # The DeleteSnapshot operation deletes a snapshot of an Amazon EBS volume that is stored in Amazon S3.
69
- #
70
- #Required Arguments:
71
- #
72
- # :snapshot_id => String (default : '')
73
- #
74
- #Optional Arguments:
75
- #
76
- # none
77
- #
78
-
79
- def delete_snapshot( options = {} )
80
-
81
- options = { :snapshot_id => '' }.merge(options)
82
-
83
- raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
84
-
85
- params = {
86
- "SnapshotId" => options[:snapshot_id]
87
- }
88
-
89
- return response_generator(:action => "DeleteSnapshot", :params => params)
90
-
91
- end
92
-
93
- end
94
- end
data/lib/EC2/volumes.rb DELETED
@@ -1,170 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library, EBS volumes support
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Yann Klis (mailto:yann.klis@novelys.com)
6
- # Copyright:: Copyright (c) 2008 Yann Klis
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- module EC2
12
-
13
- class Base
14
-
15
- #Amazon Developer Guide Docs:
16
- #
17
- # The DescribeVolumes operation lists one or more Amazon EBS volumes that you own, If you do not specify any volumes, Amazon EBS returns all volumes that you own.
18
- #
19
- #Required Arguments:
20
- #
21
- # none
22
- #
23
- #Optional Arguments:
24
- #
25
- # :volume_id => Array (default : [])
26
- #
27
-
28
- def describe_volumes( options = {} )
29
-
30
- options = { :volume_id => [] }.merge(options)
31
-
32
- params = pathlist("VolumeId", options[:volume_id] )
33
-
34
- return response_generator(:action => "DescribeVolumes", :params => params)
35
-
36
- end
37
-
38
- #Amazon Developer Guide Docs:
39
- #
40
- # The CreateVolume operation creates a new Amazon EBS volume that you can mount from any Amazon EC2 instance.
41
- #
42
- #Required Arguments:
43
- #
44
- # :availability_zone => String (default : '')
45
- #
46
- #Optional Arguments:
47
- #
48
- # :size => String (default : '')
49
- # :snapshot_id => String (default : '')
50
- #
51
-
52
- def create_volume( options = {} )
53
-
54
- # defaults
55
- options = { :availability_zone => '' }.merge(options)
56
-
57
- raise ArgumentError, "No :availability_zone provided" if options[:availability_zone].nil? || options[:availability_zone].empty?
58
-
59
- options = { :size => '' }.merge(options)
60
- options = { :snapshot_id => '' }.merge(options)
61
-
62
- params = {
63
- "AvailabilityZone" => options[:availability_zone],
64
- "Size" => options[:size],
65
- "SnapshotId" => options[:snapshot_id]
66
- }
67
-
68
- return response_generator(:action => "CreateVolume", :params => params)
69
-
70
- end
71
-
72
- #Amazon Developer Guide Docs:
73
- #
74
- # The DeleteVolume operation deletes an Amazon EBS volume.
75
- #
76
- #Required Arguments:
77
- #
78
- # :volume_id => String (default : '')
79
- #
80
- #Optional Arguments:
81
- #
82
- # none
83
- #
84
-
85
- def delete_volume( options = {} )
86
-
87
- options = { :volume_id => '' }.merge(options)
88
-
89
- raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
90
-
91
- params = {
92
- "VolumeId" => options[:volume_id]
93
- }
94
-
95
- return response_generator(:action => "DeleteVolume", :params => params)
96
-
97
- end
98
-
99
- #Amazon Developer Guide Docs:
100
- #
101
- # The AttachVolume operation attaches an Amazon EBS volume to an instance.
102
- #
103
- #Required Arguments:
104
- #
105
- # :volume_id => String (default : '')
106
- # :instance_id => String (default : '')
107
- # :device => String (default : '')
108
- #
109
- #Optional Arguments:
110
- #
111
- # none
112
- #
113
-
114
- def attach_volume( options = {} )
115
-
116
- options = { :volume_id => '' }.merge(options)
117
- options = { :instance_id => '' }.merge(options)
118
- options = { :device => '' }.merge(options)
119
-
120
- raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
121
- raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
122
- raise ArgumentError, "No :device provided" if options[:device].nil? || options[:device].empty?
123
-
124
- params = {
125
- "VolumeId" => options[:volume_id],
126
- "InstanceId" => options[:instance_id],
127
- "Device" => options[:device]
128
- }
129
-
130
- return response_generator(:action => "AttachVolume", :params => params)
131
-
132
- end
133
-
134
- #Amazon Developer Guide Docs:
135
- #
136
- # The DetachVolume operation detaches an Amazon EBS volume from an instance.
137
- #
138
- #Required Arguments:
139
- #
140
- # :volume_id => String (default : '')
141
- #
142
- #Optional Arguments:
143
- #
144
- # :instance_id => String (default : '')
145
- # :device => String (default : '')
146
- # :force => Boolean (default : '')
147
- #
148
-
149
- def detach_volume( options = {} )
150
-
151
- options = { :volume_id => '' }.merge(options)
152
-
153
- raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
154
-
155
- options = { :instance_id => '' }.merge(options)
156
- options = { :device => '' }.merge(options)
157
- options = { :force => '' }.merge(options)
158
-
159
- params = {
160
- "VolumeId" => options[:volume_id],
161
- "InstanceId" => options[:instance_id],
162
- "Device" => options[:device],
163
- "Force" => options[:force]
164
- }
165
-
166
- return response_generator(:action => "DetachVolume", :params => params)
167
-
168
- end
169
- end
170
- end