Sha256: a10d2082bc3d9cc72bca95148ffc328f2f3730739fa298c876fc1fc734801937

Contents?: true

Size: 505 Bytes

Versions: 7

Compression:

Stored size: 505 Bytes

Contents

desc 'Destroy servers'
arg_name '[server-id...]'
command [:destroy] do |c|
  c.action do |global_options, options, args|

    raise "You must specify servers to destroy" if args.empty?

    servers = Server.find_or_call(args) do |id|
      raise "Couldn't find server #{id}"
    end

    servers.each do |server|
      info "Destroying server #{server}"
      begin
        server.destroy
      rescue Brightbox::Api::Conflict => e
        error "Could not destroy #{server}"
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bbcloud-0.11.2 lib/bbcloud/commands/servers-destroy.rb
bbcloud-0.11.1 lib/bbcloud/commands/servers-destroy.rb
bbcloud-0.11.0 lib/bbcloud/commands/servers-destroy.rb
bbcloud-0.10.1 lib/bbcloud/commands/servers-destroy.rb
bbcloud-0.9.2 lib/bbcloud/commands/servers-destroy.rb
bbcloud-0.9.1 lib/bbcloud/commands/servers-destroy.rb
bbcloud-0.9 lib/bbcloud/commands/servers-destroy.rb