Sha256: 22b3879daa1c1d2affee2cace99be7e669d7fc1ccca74f5a2c94ffa39e982386

Contents?: true

Size: 641 Bytes

Versions: 16

Compression:

Stored size: 641 Bytes

Contents

module Brightbox
  desc 'Remove nodes from a load balancer'
  arg_name 'lb-id node-id...'
  command [:remove_nodes] do |c|

    c.action do |global_options, options, args|

      raise "You must specify the load balancer and the node ids to remove" if args.size < 2

      lb = LoadBalancer.find(args.shift)

      # We don't want to check servers exist as you can remove deleted
      # servers from a load balancer.
      nodes = args.collect { |a| Server.new(a) }

      info "Removing #{nodes.size} nodes from load balancer #{lb.id}"
      lb.remove_nodes nodes
      lb.reload
      render_table([lb], global_options)
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

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