sabat-rudy 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/CHANGES.txt +188 -0
  2. data/LICENSE.txt +19 -0
  3. data/README.rdoc +118 -0
  4. data/Rakefile +165 -0
  5. data/Rudyfile +184 -0
  6. data/bin/ird +153 -0
  7. data/bin/rudy +232 -0
  8. data/bin/rudy-ec2 +241 -0
  9. data/bin/rudy-s3 +79 -0
  10. data/bin/rudy-sdb +69 -0
  11. data/examples/README.md +10 -0
  12. data/examples/debian-sinatra-passenger/commands.rb +19 -0
  13. data/examples/debian-sinatra-passenger/machines.rb +32 -0
  14. data/examples/debian-sinatra-passenger/routines.rb +30 -0
  15. data/examples/debian-sinatra-thin/commands.rb +17 -0
  16. data/examples/debian-sinatra-thin/machines.rb +35 -0
  17. data/examples/debian-sinatra-thin/routines.rb +72 -0
  18. data/lib/rudy.rb +170 -0
  19. data/lib/rudy/aws.rb +75 -0
  20. data/lib/rudy/aws/ec2.rb +59 -0
  21. data/lib/rudy/aws/ec2/address.rb +157 -0
  22. data/lib/rudy/aws/ec2/group.rb +301 -0
  23. data/lib/rudy/aws/ec2/image.rb +168 -0
  24. data/lib/rudy/aws/ec2/instance.rb +438 -0
  25. data/lib/rudy/aws/ec2/keypair.rb +104 -0
  26. data/lib/rudy/aws/ec2/snapshot.rb +109 -0
  27. data/lib/rudy/aws/ec2/volume.rb +230 -0
  28. data/lib/rudy/aws/ec2/zone.rb +77 -0
  29. data/lib/rudy/aws/s3.rb +60 -0
  30. data/lib/rudy/aws/sdb.rb +312 -0
  31. data/lib/rudy/aws/sdb/error.rb +47 -0
  32. data/lib/rudy/cli.rb +186 -0
  33. data/lib/rudy/cli/aws/ec2/addresses.rb +105 -0
  34. data/lib/rudy/cli/aws/ec2/candy.rb +191 -0
  35. data/lib/rudy/cli/aws/ec2/groups.rb +118 -0
  36. data/lib/rudy/cli/aws/ec2/images.rb +185 -0
  37. data/lib/rudy/cli/aws/ec2/instances.rb +222 -0
  38. data/lib/rudy/cli/aws/ec2/keypairs.rb +53 -0
  39. data/lib/rudy/cli/aws/ec2/snapshots.rb +49 -0
  40. data/lib/rudy/cli/aws/ec2/volumes.rb +104 -0
  41. data/lib/rudy/cli/aws/ec2/zones.rb +22 -0
  42. data/lib/rudy/cli/aws/s3/buckets.rb +49 -0
  43. data/lib/rudy/cli/aws/s3/store.rb +22 -0
  44. data/lib/rudy/cli/aws/sdb/domains.rb +41 -0
  45. data/lib/rudy/cli/candy.rb +19 -0
  46. data/lib/rudy/cli/config.rb +81 -0
  47. data/lib/rudy/cli/disks.rb +58 -0
  48. data/lib/rudy/cli/machines.rb +114 -0
  49. data/lib/rudy/cli/routines.rb +108 -0
  50. data/lib/rudy/config.rb +116 -0
  51. data/lib/rudy/config/objects.rb +148 -0
  52. data/lib/rudy/global.rb +130 -0
  53. data/lib/rudy/guidelines.rb +18 -0
  54. data/lib/rudy/huxtable.rb +373 -0
  55. data/lib/rudy/machines.rb +281 -0
  56. data/lib/rudy/metadata.rb +51 -0
  57. data/lib/rudy/metadata/backup.rb +113 -0
  58. data/lib/rudy/metadata/backups.rb +65 -0
  59. data/lib/rudy/metadata/disk.rb +177 -0
  60. data/lib/rudy/metadata/disks.rb +67 -0
  61. data/lib/rudy/metadata/objectbase.rb +104 -0
  62. data/lib/rudy/mixins.rb +2 -0
  63. data/lib/rudy/mixins/hash.rb +25 -0
  64. data/lib/rudy/routines.rb +318 -0
  65. data/lib/rudy/routines/helper.rb +55 -0
  66. data/lib/rudy/routines/helpers/dependshelper.rb +34 -0
  67. data/lib/rudy/routines/helpers/diskhelper.rb +331 -0
  68. data/lib/rudy/routines/helpers/scmhelper.rb +39 -0
  69. data/lib/rudy/routines/helpers/scripthelper.rb +198 -0
  70. data/lib/rudy/routines/helpers/userhelper.rb +37 -0
  71. data/lib/rudy/routines/passthrough.rb +38 -0
  72. data/lib/rudy/routines/reboot.rb +75 -0
  73. data/lib/rudy/routines/release.rb +50 -0
  74. data/lib/rudy/routines/shutdown.rb +33 -0
  75. data/lib/rudy/routines/startup.rb +36 -0
  76. data/lib/rudy/scm.rb +75 -0
  77. data/lib/rudy/scm/git.rb +217 -0
  78. data/lib/rudy/scm/svn.rb +110 -0
  79. data/lib/rudy/utils.rb +365 -0
  80. data/rudy.gemspec +151 -0
  81. data/support/mailtest +40 -0
  82. data/support/randomize-root-password +45 -0
  83. data/support/rudy-ec2-startup +200 -0
  84. data/support/update-ec2-ami-tools +20 -0
  85. data/test/01_mixins/10_hash_test.rb +25 -0
  86. data/test/10_config/00_setup_test.rb +20 -0
  87. data/test/10_config/30_machines_test.rb +69 -0
  88. data/test/15_scm/00_setup_test.rb +20 -0
  89. data/test/15_scm/20_git_test.rb +61 -0
  90. data/test/20_sdb/00_setup_test.rb +16 -0
  91. data/test/20_sdb/10_domains_test.rb +115 -0
  92. data/test/25_ec2/00_setup_test.rb +29 -0
  93. data/test/25_ec2/10_keypairs_test.rb +41 -0
  94. data/test/25_ec2/20_groups_test.rb +131 -0
  95. data/test/25_ec2/30_addresses_test.rb +38 -0
  96. data/test/25_ec2/40_volumes_test.rb +49 -0
  97. data/test/25_ec2/50_snapshots_test.rb +74 -0
  98. data/test/26_ec2_instances/00_setup_test.rb +28 -0
  99. data/test/26_ec2_instances/10_instances_test.rb +83 -0
  100. data/test/26_ec2_instances/50_images_test.rb +13 -0
  101. data/test/30_sdb_metadata/00_setup_test.rb +21 -0
  102. data/test/30_sdb_metadata/10_disks_test.rb +109 -0
  103. data/test/30_sdb_metadata/20_backups_test.rb +102 -0
  104. data/test/coverage.txt +51 -0
  105. data/test/helper.rb +36 -0
  106. metadata +276 -0
@@ -0,0 +1,222 @@
1
+
2
+
3
+ module Rudy; module CLI;
4
+ module AWS; module EC2;
5
+ class InstanceAndGroupError < Drydock::ArgError
6
+ def message; "You cannot provide a group and an instance ID"; end
7
+ end
8
+ class NoInstanceError < Drydock::ArgError
9
+ def message; "You must provide a group or instance ID"; end
10
+ end
11
+
12
+ class Instances < Rudy::CLI::CommandBase
13
+
14
+ def instances_create_valid?
15
+
16
+ raise "Cannot supply an instance ID" if @option.instid
17
+
18
+ if @option.group
19
+ rgroup = Rudy::AWS::EC2::Groups.new(@@global.accesskey, @@global.secretkey, @@global.region)
20
+ raise "Group #{@option.group} does not exist" unless rgroup.exists?(@option.group)
21
+ end
22
+
23
+ true
24
+ end
25
+
26
+ def instances_create
27
+
28
+ opts = { # Defaults
29
+ :group => 'default',
30
+ :size => 'm1.small',
31
+ :zone => @@global.zone
32
+ }
33
+
34
+ radd = Rudy::AWS::EC2::Addresses.new(@@global.accesskey, @@global.secretkey, @@global.region)
35
+ rinst = Rudy::AWS::EC2::Instances.new(@@global.accesskey, @@global.secretkey, @@global.region)
36
+
37
+ if @option.address
38
+ raise "Cannot specify both -a and -n" if @option.newaddress
39
+ raise "#{@option.address} is not allocated to you" unless radd.exists?(@option.address)
40
+ raise "#{@option.address} is already associated!" if radd.associated?(@option.address)
41
+ end
42
+
43
+ # These can be sent directly to EC2 class
44
+ [:group, :ami, :size, :keypair, :private].each do |n|
45
+ opts[n] = @option.send(n) if @option.send(n)
46
+ end
47
+
48
+ puts "Creating #{opts[:size]} instance in #{@@global.zone}"
49
+
50
+ unless opts[:keypair]
51
+ puts "You did not specify a keypair. Unless you've prepared a user account".bright
52
+ puts "on this image (#{opts[:ami]}) you will not be able to log in to it.".bright
53
+ exit unless Annoy.proceed?(:low)
54
+ end
55
+
56
+ instances = rinst.list_group(opts[:group], :running)
57
+
58
+ if instances && instances.size > 0
59
+ instance_count = (instances.size == 1) ? 'is 1 instance' : "are #{instances.size} instances"
60
+ puts "There #{instance_count} running in the #{opts[:group]} group."
61
+ exit unless Annoy.proceed?(:low)
62
+ end
63
+
64
+ if @option.newaddress
65
+ print "Creating address... "
66
+ address = radd.create
67
+ puts "#{address.ipaddress}"
68
+ @option.address = address.ipaddress
69
+ end
70
+
71
+ execute_action do
72
+ first_instance = true
73
+ rinst.create(opts) do |inst| # Rudy::AWS::EC2::Instance objects
74
+
75
+ # Assign IP address to only the first instance
76
+ if first_instance && @option.address
77
+ puts "Associating #{@option.address} to #{inst.awsid}"
78
+ radd.associate(@option.address, inst.awsid)
79
+ first_instance = false
80
+ end
81
+
82
+ puts @@global.verbose > 0 ? inst.inspect : inst.dump(@@global.format)
83
+ end
84
+ end
85
+ end
86
+
87
+ def instances_restart_valid?
88
+ raise InstanceAndGroupError.new(nil, @alias) if @option.group && @argv.instid
89
+ raise NoInstanceError.new(nil, @alias) if !@option.group && !@argv.instid
90
+
91
+ if @option.group
92
+ rgroup = Rudy::AWS::EC2::Groups.new(@@global.accesskey, @@global.secretkey, @@global.region)
93
+ raise "Group #{@option.group} does not exist" unless rgroup.exists?(@option.group)
94
+ end
95
+
96
+ if @option.private
97
+ raise Drydock::OptsError.new(nil, @alias, "Cannot allocate public IP for private instance") if @option.address || @option.newadress
98
+ end
99
+
100
+ @rinst = Rudy::AWS::EC2::Instances.new(@@global.accesskey, @@global.secretkey, @@global.region)
101
+ raise "No instances" unless @rinst.any?
102
+ true
103
+ end
104
+ alias :instances_destroy_valid? :instances_restart_valid?
105
+
106
+ def instances_destroy
107
+ instances_action :destroy
108
+ end
109
+
110
+ def instances_restart
111
+ instances_action :restart
112
+ end
113
+
114
+ def consoles_valid?
115
+ @rinst = Rudy::AWS::EC2::Instances.new(@@global.accesskey, @@global.secretkey, @@global.region)
116
+ if @@global.pkey
117
+ raise "Cannot find file #{@@global.pkey}" unless File.exists?(@@global.pkey)
118
+ raise "Insecure permissions for #{@@global.pkey}" unless (File.stat(@@global.pkey).mode & 600) == 0
119
+ end
120
+ raise "No instances" unless @rinst.any?
121
+ true
122
+ end
123
+ def consoles
124
+ opts = {}
125
+ opts[:group] = @option.group if @option.group
126
+ opts[:id] = @argv.instid if @argv.instid
127
+ opts[:id] &&= [opts[:id]].flatten
128
+
129
+ lt = @rinst.list_group(opts[:group], :any, opts[:id]) do |inst|
130
+ puts instance_separator(inst.dns_public || inst.state, inst.awsid)
131
+ console = @rinst.console(inst.awsid)
132
+ output = console ? Base64.decode64(console) : "Unavailable"
133
+
134
+ # The linux console can include ANSI escape codes for color,
135
+ # clear screen etc... We strip them out to get rid of the
136
+ # clear specifically. Otherwise the display is messed!
137
+ output &&= output.noansi
138
+
139
+ puts output
140
+
141
+ if output.match(/<Password>(.+)<\/Password>/m) # /m, match multiple lines
142
+ puts
143
+ if @@global.pkey
144
+ encrtypted_text = ($1 || '').strip
145
+ k = Rye::Key.from_file(@@global.pkey)
146
+ pword = k.decrypt(encrtypted_text)
147
+ answer = "%s: %s" % ['password', pword]
148
+ Annoy.timed_display(answer, STDERR, 10)
149
+ puts
150
+ else
151
+ puts "Please supply a private key path to decode the administrator password"
152
+ puts "rudy-ec2 -k path/2/privatekey console [-g group] [instance ID]"
153
+ end
154
+ end
155
+
156
+ end
157
+
158
+ end
159
+
160
+ def status
161
+ opts = {}
162
+
163
+ opts[:group] = @option.group if @option.group
164
+ opts[:state] = @option.state if @option.state
165
+
166
+ # A nil value forces the @ec2.instances.list to return all instances
167
+ if @option.all
168
+ opts[:state] = :any
169
+ opts[:group] = :any
170
+ end
171
+
172
+ opts[:id] = @argv.instid if @argv.instid
173
+ opts[:id] &&= [opts[:id]].flatten
174
+
175
+ rudy = Rudy::AWS::EC2::Instances.new(@@global.accesskey, @@global.secretkey, @@global.region)
176
+ lt = rudy.list_group(opts[:group], opts[:state], opts[:id]) do |inst|
177
+ puts @@global.verbose > 0 ? inst.inspect : inst.dump(@@global.format)
178
+ end
179
+ puts "No instances running" if !lt || lt.empty?
180
+ end
181
+ alias :instances :status
182
+
183
+
184
+ private
185
+
186
+ # * +action+ is one of :destroy, :restart
187
+ def instances_action(action)
188
+ opts = {}
189
+ opts[:group] = @option.group if @option.group
190
+ opts[:id] = @argv.instid if @argv.instid
191
+ opts[:id] &&= [opts[:id]].flatten
192
+
193
+ instances = @rinst.list_group(opts[:group], :running, opts[:id])
194
+ raise "No matching instances running" if instances.nil?
195
+
196
+ inst_names = instances.collect { |inst| inst.dns_public || inst.awsid }
197
+ inst_ids = instances.collect { |inst| inst.awsid }
198
+
199
+ instance_count = (instances.size == 1) ? '1 instance' : "#{instances.size} instances"
200
+
201
+ print "#{action.to_s.capitalize} #{instance_count} (#{inst_names.join(', ')}) "
202
+ print "in #{opts[:group]}" if opts[:group]
203
+ puts
204
+ execute_check(:medium)
205
+
206
+ execute_action("#{action.to_s.capitalize} Failed") {
207
+ @rinst.send(action, inst_ids)
208
+ }
209
+ status
210
+ end
211
+
212
+ def instance_separator(name, awsid)
213
+ ('%s %-63s awsid: %s ' % [$/, name, awsid]).att(:reverse)
214
+ end
215
+
216
+ end
217
+
218
+ end; end
219
+ end; end
220
+
221
+
222
+
@@ -0,0 +1,53 @@
1
+
2
+
3
+ module Rudy; module CLI;
4
+ module AWS; module EC2;
5
+
6
+ class KeyPairs < Rudy::CLI::CommandBase
7
+
8
+ def create_keypairs_valid?
9
+ raise Drydock::ArgError.new('name', @alias) unless @argv.name
10
+ true
11
+ end
12
+ def create_keypairs
13
+ rkey = Rudy::AWS::EC2::KeyPairs.new(@@global.accesskey, @@global.secretkey, @@global.region)
14
+ kp = execute_action { rkey.create(@argv.name) }
15
+ if [:s, :string].member?(@@global.format)
16
+ puts "Name: #{kp.name}"
17
+ puts "Fingerprint: #{kp.fingerprint}", $/
18
+ puts "Copy the following private key data into a file."
19
+ puts "Set the permissions to 0600 and keep it safe.", $/
20
+ puts kp.private_key
21
+ else
22
+ puts @@global.verbose > 0 ? kp.inspect : kp.dump(@@global.format)
23
+ end
24
+ end
25
+
26
+ def destroy_keypairs_valid?
27
+ raise Drydock::ArgError.new('name', @alias) unless @argv.name
28
+ true
29
+ end
30
+ def destroy_keypairs
31
+ rkey = Rudy::AWS::EC2::KeyPairs.new(@@global.accesskey, @@global.secretkey, @@global.region)
32
+ raise "KeyPair #{@argv.name} does not exist" unless rkey.exists?(@argv.name)
33
+ kp = rkey.get(@argv.name)
34
+ puts "Destroying: #{kp.name}"
35
+ execute_check(:medium)
36
+ execute_action { rkey.destroy(kp.name) }
37
+ keypairs
38
+ end
39
+
40
+ def keypairs
41
+ rkey = Rudy::AWS::EC2::KeyPairs.new(@@global.accesskey, @@global.secretkey, @@global.region)
42
+ (rkey.list || []).each do |kp|
43
+ puts @@global.verbose > 0 ? kp.inspect : kp.dump(@@global.format)
44
+ end
45
+ puts "No keypairs" unless rkey.any?
46
+ end
47
+
48
+
49
+ end
50
+
51
+
52
+ end; end
53
+ end; end
@@ -0,0 +1,49 @@
1
+
2
+
3
+ module Rudy; module CLI;
4
+ module AWS; module EC2;
5
+
6
+ class Snapshots < Rudy::CLI::CommandBase
7
+
8
+ def create_snapshots_valid?
9
+ raise Drydock::ArgError.new('volume ID', @alias) unless @option.volume
10
+ @rvol = Rudy::AWS::EC2::Volumes.new(@@global.accesskey, @@global.secretkey, @@global.region)
11
+ @volume = @rvol.get(@argv.volid)
12
+ raise "Volume #{@volume.awsid} does not exist" unless @volume
13
+ true
14
+ end
15
+ def create_snapshots
16
+ rsnap = Rudy::AWS::EC2::Snapshots.new(@@global.accesskey, @@global.secretkey, @@global.region)
17
+ snap = execute_action { rsnap.create(@volume.awsid) }
18
+ puts @@global.verbose > 0 ? snap.inspect : snap.dump(@@global.format)
19
+ end
20
+
21
+ def destroy_snapshots_valid?
22
+ raise Drydock::ArgError.new('snapshot ID', @alias) unless @argv.snapid
23
+ @rsnap = Rudy::AWS::EC2::Snapshots.new(@@global.accesskey, @@global.secretkey, @@global.region)
24
+ @snap = @rsnap.get(@argv.snapid)
25
+ raise "Snapshot #{@snap.awsid} does not exist" unless @snap
26
+ true
27
+ end
28
+ def destroy_snapshots
29
+ puts "Destroying: #{@snap.awsid}"
30
+ execute_check(:medium)
31
+ execute_action { @rsnap.destroy(@snap.awsid) }
32
+ snapshots
33
+ end
34
+
35
+ def snapshots
36
+ rsnap = Rudy::AWS::EC2::Snapshots.new(@@global.accesskey, @@global.secretkey, @@global.region)
37
+ snaps = rsnap.list || []
38
+ snaps.each do |snap|
39
+ puts @@global.verbose > 0 ? snap.inspect : snap.dump(@@global.format)
40
+ end
41
+ puts "No snapshots" if snaps.empty?
42
+ end
43
+
44
+
45
+ end
46
+
47
+
48
+ end; end
49
+ end; end
@@ -0,0 +1,104 @@
1
+
2
+
3
+ module Rudy; module CLI;
4
+ module AWS; module EC2;
5
+
6
+ class Volumes < Rudy::CLI::CommandBase
7
+
8
+
9
+ def volumes_create_valid?
10
+ raise "You must supply a volume size. See rudy volume -h" unless @option.size
11
+ raise "You must supply a zone." unless @@global.zone
12
+ true
13
+ end
14
+ def volumes_create
15
+ puts "Creating #{@option.size}GB volume in #{@@global.zone}"
16
+ rvol = Rudy::AWS::EC2::Volumes.new(@@global.accesskey, @@global.secretkey, @@global.region)
17
+ execute_check(:low)
18
+ vol = execute_action("Create Failed") {
19
+ rvol.create(@option.size, @@global.zone, @option.snapshot)
20
+ }
21
+ puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
22
+ end
23
+
24
+
25
+ def destroy_volumes_valid?
26
+ raise "You must supply a volume ID. See rudy volume -h" unless @argv.volid
27
+ true
28
+ end
29
+
30
+ def destroy_volumes
31
+ @rvol = Rudy::AWS::EC2::Volumes.new(@@global.accesskey, @@global.secretkey, @@global.region)
32
+ @volume = @rvol.get(@argv.volid)
33
+ raise "Volume #{@volume.awsid} does not exist" unless @volume
34
+ raise "Volume #{@volume.awsid} is still in-use" if @volume.in_use?
35
+ raise "Volume #{@volume.awsid} is still attached" if @volume.attached?
36
+ raise "Volume #{@volume.awsid} is not available (#{@volume.state})" unless @volume.available?
37
+
38
+ puts "Destroying #{@volume.awsid}"
39
+ execute_check(:medium)
40
+ execute_action("Destroy Failed") { @rvol.destroy(@volume.awsid) }
41
+
42
+ vol = @rvol.get(@volume.awsid)
43
+ puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
44
+ end
45
+
46
+
47
+ def volumes_attach_valid?
48
+ raise "You must supply an instance ID." unless @option.instance
49
+ raise "You must supply a volume ID." unless @argv.volid
50
+ true
51
+ end
52
+ def volumes_attach
53
+ @option.device ||= "/dev/sdh"
54
+
55
+ rvol = Rudy::AWS::EC2::Volumes.new(@@global.accesskey, @@global.secretkey, @@global.region)
56
+ rinst = Rudy::AWS::EC2::Instances.new(@@global.accesskey, @@global.secretkey, @@global.region)
57
+ raise "Volume #{@argv.volid} does not exist" unless rvol.exists?(@argv.volid)
58
+ raise "Volume #{@argv.volid} is already attached" if rvol.attached?(@argv.volid)
59
+ raise "Instance #{@option.instance} does not exist" unless rinst.exists?(@option.instance)
60
+
61
+ puts "Attaching #{@argv.volid} to #{@option.instance} on #{@option.device}"
62
+ execute_check(:low)
63
+ execute_action("Attach Failed") {
64
+ rvol.attach(@argv.volid, @option.instance, @option.device)
65
+ }
66
+
67
+ vol = rvol.get(@argv.volid)
68
+ puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
69
+ end
70
+
71
+ def volumes_detach_valid?
72
+ raise "You must supply a volume ID." unless @argv.volid
73
+ true
74
+ end
75
+
76
+ def volumes_detach
77
+ rvol = Rudy::AWS::EC2::Volumes.new(@@global.accesskey, @@global.secretkey, @@global.region)
78
+ raise "Volume #{@argv.volid} does not exist" unless rvol.exists?(@argv.volid)
79
+
80
+ vol = rvol.get(@argv.volid)
81
+ raise "Volume #{vol.awsid} is not attached" unless vol.attached?
82
+
83
+ puts "Detaching #{vol.awsid} from #{vol.instid}"
84
+ execute_check(:medium)
85
+ execute_action("Detach Failed") { rvol.detach(vol.awsid) }
86
+
87
+ vol = rvol.get(vol.awsid)
88
+ puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
89
+ end
90
+
91
+
92
+ def volumes
93
+ rvol = Rudy::AWS::EC2::Volumes.new(@@global.accesskey, @@global.secretkey, @@global.region)
94
+ volumes = rvol.list || []
95
+ volumes.each do |vol|
96
+ puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
97
+ end
98
+ puts "No volumes" if volumes.empty?
99
+ end
100
+
101
+ end
102
+
103
+ end; end
104
+ end; end
@@ -0,0 +1,22 @@
1
+
2
+
3
+ module Rudy; module CLI;
4
+ module AWS; module EC2;
5
+
6
+ class Zones < Rudy::CLI::CommandBase
7
+
8
+
9
+ def zones
10
+ rzone = Rudy::AWS::EC2::Zones.new(@@global.accesskey, @@global.secretkey, @@global.region)
11
+ rzone.list_as_hash(@argv.name).each_value do |zon|
12
+ puts zon.dump(@@global.format)
13
+ end
14
+ puts "No zones" unless rzone.any?
15
+ end
16
+
17
+
18
+ end
19
+
20
+
21
+ end; end
22
+ end; end