Sha256: 2393b6b51c9cea73cec53013e7bea8b4cf228646892555faa5cc34d58ffbb5d4

Contents?: true

Size: 628 Bytes

Versions: 10

Compression:

Stored size: 628 Bytes

Contents

module Brightbox
  desc 'List Firewall Rules'
  arg_name '[firewall-policy-id...]'
  command [:list] do |c|
    c.action do |global_options,options,args|
      if args.empty?
        raise "You must specify the firewall policy id as the first argument"
      end

      firewall_policy_id = args.shift
      raise "Invalid firewall policy id" unless firewall_policy_id =~ /^fwp-/

      firewall_policy = FirewallPolicy.find_or_call([firewall_policy_id]) do |id|
        raise "Couldn't find firewall policy #{id}"
      end
      render_table(FirewallRules.from_policy(firewall_policy.first), global_options)
    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-list.rb
brightbox-cli-0.18.0 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.17.5 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.17.4 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.17.3 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.17.2 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.17.1 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.17.0 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.16.0 lib/brightbox-cli/commands/firewall-rules-list.rb
brightbox-cli-0.15.0 lib/brightbox-cli/commands/firewall-rules-list.rb