Sha256: 714297471b4c4280e45daaf43fbdfb1fa6d32540baefb3f39ff608a514d5136a
Contents?: true
Size: 611 Bytes
Versions: 3
Compression:
Stored size: 611 Bytes
Contents
desc 'Destroy servers' arg_name '[server-id...]' command [:destroy] do |c| c.action do |global_options, options, args| if args.empty? raise "you must specify the id of the server(s) you want to destroy" end servers = args.collect do |sid| info "Destroying server #{sid}" server = Server.find sid raise "Server #{sid} does not exist" if server.nil? begin server.destroy rescue Brightbox::Api::Conflict => e error "Could not destroy #{sid}" end server.reload server end render_table(servers, global_options) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bbcloud-0.8.2 | lib/bbcloud/commands/servers-destroy.rb |
bbcloud-0.8.1 | lib/bbcloud/commands/servers-destroy.rb |
bbcloud-0.8 | lib/bbcloud/commands/servers-destroy.rb |