Sha256: 7ed627970e333534043fc7b3f56ebe08806792decaed4a2c0b697b6337fc88d9

Contents?: true

Size: 778 Bytes

Versions: 14

Compression:

Stored size: 778 Bytes

Contents

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

        firewall_policies = FirewallPolicy.find_or_call(args) do |id|
          raise "Couldn't find Firewall Policy #{id}"
        end

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