Sha256: 62ecbc99f9ab5728d958cc24f944b2245ef020dcb7767984d4c70de64f6dccf8

Contents?: true

Size: 530 Bytes

Versions: 4

Compression:

Stored size: 530 Bytes

Contents

module Brightbox
  command [:servers] do |cmd|

    cmd.desc "Stop the specified servers, aka turning the power off"
    cmd.arg_name "server-id..."
    cmd.command [:stop] do |c|

      c.action do |global_options, options, args|

        raise "You must specify servers to stop" if args.empty?

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

        servers.each do |s|
          info "Stopping server #{s}"
          s.stop
        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/servers-stop.rb
brightbox-cli-1.0.0 lib/brightbox-cli/commands/servers-stop.rb
brightbox-cli-1.0.0.rc2 lib/brightbox-cli/commands/servers-stop.rb
brightbox-cli-1.0.0.rc1 lib/brightbox-cli/commands/servers-stop.rb