Sha256: 2d753055f43ab7e6fb12de4e33182cba04d83130fbe96707121446731291b8ce

Contents?: true

Size: 528 Bytes

Versions: 4

Compression:

Stored size: 528 Bytes

Contents

module Brightbox
  command [:lbs] do |cmd|

    cmd.desc "Destroy load balancers"
    cmd.arg_name "lb-id..."
    cmd.command [:destroy] do |c|

      c.action do |global_options, options, args|

        raise "You must specify the load balancers to destroy" if args.empty?

        lbs = LoadBalancer.find_or_call(args) do |id|
          raise "Couldn't find load balancer #{id}"
        end

        lbs.each do |lb|
          info "Destroying load balancer #{lb}"
          lb.destroy
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
brightbox-cli-1.1.0 lib/brightbox-cli/commands/lbs-destroy.rb
brightbox-cli-1.0.0 lib/brightbox-cli/commands/lbs-destroy.rb
brightbox-cli-1.0.0.rc2 lib/brightbox-cli/commands/lbs-destroy.rb
brightbox-cli-1.0.0.rc1 lib/brightbox-cli/commands/lbs-destroy.rb