Sha256: 6deb233e3695839b61e9349b12782117c133d7bcf679fe4448a3b27c7a0da8ab

Contents?: true

Size: 562 Bytes

Versions: 16

Compression:

Stored size: 562 Bytes

Contents

module Brightbox
  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
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.18.0 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.17.5 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.17.4 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.17.3 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.17.2 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.17.1 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.17.0 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.16.0 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.15.0 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.14.1 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.14.0 lib/brightbox-cli/commands/servers-destroy.rb
brightbox-cli-0.13.1 lib/brightbox-cli/commands/servers-destroy.rb
bbcloud-0.13.0 lib/bbcloud/commands/servers-destroy.rb
brightbox-cli-0.13.0 lib/brightbox-cli/commands/servers-destroy.rb
bbcloud-0.12.0 lib/bbcloud/commands/servers-destroy.rb