Sha256: b0eb0e33fe646476170d55bff5bd9b8d47d5510f6a31a3032185a66868e1de34

Contents?: true

Size: 787 Bytes

Versions: 14

Compression:

Stored size: 787 Bytes

Contents

module Brightbox
  command [:sql] do |product|
    product.command [:instances] do |cmd|
      cmd.desc I18n.t("sql.instances.destroy.desc")
      cmd.arg_name "[instance-id...]"
      cmd.command [:destroy] do |c|
        c.action do |_global_options, _options, args|
          raise "You must specify instance IDs to destroy" if args.empty?

          servers = DatabaseServer.find_or_call(args) do |id|
            raise "Couldn't find an SQL instance with ID #{id}"
          end

          servers.each do |server|
            info "Destroying server instance #{server}"
            begin
              server.destroy
            rescue Brightbox::Api::Conflict
              error "Could not destroy #{server}"
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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