Sha256: 14f7cd061b221de8699ee6df82026b3d0ee4599cec1e56549c863dfa75e409ec

Contents?: true

Size: 1.14 KB

Versions: 58

Compression:

Stored size: 1.14 KB

Contents

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

          instances = DatabaseServer.find_or_call(args) do |instance|
            raise "Couldn't find #{instance}"
          end

          instances.each do |instance|
            info "Locking #{instance}"
            instance.lock!
          end
        end
      end

      cmd.desc I18n.t("sql.instances.unlock.desc")
      cmd.arg_name "[instance-id...]"
      cmd.command [:unlock] do |c|
        c.action do |_global_options, _options, args|
          raise "You must specify sql instances as arguments" if args.empty?

          instances = DatabaseServer.find_or_call(args) do |instance|
            raise "Couldn't find #{instance}"
          end

          instances.each do |instance|
            info "Unlocking #{instance}"
            instance.unlock!
          end
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
brightbox-cli-2.4.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.3.4 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.3.3 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.3.2 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.3.1 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.3.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.2.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.1.2 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.1.1 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.1.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-2.0.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.6.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.5.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.4.3 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.4.2 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.4.1 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.4.0 lib/brightbox-cli/commands/sql/instances_locking.rb
brightbox-cli-1.3.0 lib/brightbox-cli/commands/sql/instances_locking.rb