Sha256: 73a0c3267655832c08d12b175e258051a76a553d1c221e14d185748a8abf31fa

Contents?: true

Size: 748 Bytes

Versions: 14

Compression:

Stored size: 748 Bytes

Contents

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

        firewall_rules = FirewallRule.find_or_call(args) do |id|
          raise "Couldn't find Firewall Rule #{id}"
        end

        firewall_rules.each do |firewall_rule|
          info "Destroying firewall rule #{firewall_rule}"
          begin
            firewall_rule.destroy
          rescue Brightbox::Api::Conflict
            error "Could not destroy #{firewall_rule}"
          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/firewall/rules_destroy.rb
brightbox-cli-4.7.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.6.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.5.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.5.0.rc1 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.4.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.3.2 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.3.1 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.3.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.2.1 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.2.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.1.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.0.0 lib/brightbox-cli/commands/firewall/rules_destroy.rb
brightbox-cli-4.0.0.rc2 lib/brightbox-cli/commands/firewall/rules_destroy.rb