Sha256: a8ebacbf5f1fa91e4962c9ab2cd1dd83aab24a7193220a9647d013a145590777

Contents?: true

Size: 646 Bytes

Versions: 10

Compression:

Stored size: 646 Bytes

Contents

module Brightbox
  desc 'Destroy Firewall Rule'
  arg_name '[firewall-rule-id...]'
  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 => e
          error "Could not destroy #{firewall_rule}"
        end
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.18.0 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.17.5 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.17.4 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.17.3 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.17.2 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.17.1 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.17.0 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.16.0 lib/brightbox-cli/commands/firewall-rules-destroy.rb
brightbox-cli-0.15.0 lib/brightbox-cli/commands/firewall-rules-destroy.rb