Sha256: 87945bb70c3bca64c10d7191a63063226869efdd55755698ae6cc61e0417a1e0

Contents?: true

Size: 525 Bytes

Versions: 10

Compression:

Stored size: 525 Bytes

Contents

module Brightbox
  desc 'Destroy server groups'
  arg_name 'grp-id...'

  # todo: add option to remove all servers from group before destroying

  command [:destroy] do |c|

    c.action do |global_options, options, args|
      raise "You must specify the server groups to destroy" if args.empty?

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

      sgs.each do |sg|
        info "Destroying server group #{sg}"
        sg.destroy
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.18.0 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.17.5 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.17.4 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.17.3 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.17.2 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.17.1 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.17.0 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.16.0 lib/brightbox-cli/commands/groups-destroy.rb
brightbox-cli-0.15.0 lib/brightbox-cli/commands/groups-destroy.rb