Sha256: 61990ddd3da3209a49b8f1db276fcea72a0610b26b02b7e191c5b0b2898d4812

Contents?: true

Size: 672 Bytes

Versions: 10

Compression:

Stored size: 672 Bytes

Contents

module Brightbox
  desc 'Destroy Firewall Policy'
  arg_name '[firewall-policy-id...]'
  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 => e
          error "Could not destroy #{firewall_policy}"
        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-policies-destroy.rb
brightbox-cli-0.18.0 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.17.5 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.17.4 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.17.3 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.17.2 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.17.1 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.17.0 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.16.0 lib/brightbox-cli/commands/firewall-policies-destroy.rb
brightbox-cli-0.15.0 lib/brightbox-cli/commands/firewall-policies-destroy.rb