Sha256: 4387945c51cabc01a869700c277d812c9184f44a5a25556bf2584079d23cab5b

Contents?: true

Size: 654 Bytes

Versions: 17

Compression:

Stored size: 654 Bytes

Contents

module Brightbox
  command [:servers] do |cmd|
    cmd.desc I18n.t("servers.destroy.desc")
    cmd.arg_name "[server-id...]"
    cmd.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
            error "Could not destroy #{server}"
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0.rc2 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-5.0.0.rc1 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-5.0.0.alpha lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.8.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.7.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.6.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.5.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.5.0.rc1 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.4.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.3.2 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.3.1 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.3.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.2.1 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.2.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.1.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.0.0 lib/brightbox-cli/commands/servers/destroy.rb
brightbox-cli-4.0.0.rc2 lib/brightbox-cli/commands/servers/destroy.rb