Sha256: 14f55f27c1d0ffb7ea629951ac82acacd99f89fa25386b48f6f19b9bc4f13557

Contents?: true

Size: 732 Bytes

Versions: 4

Compression:

Stored size: 732 Bytes

Contents

module Brightbox
  command [:"firewall-rules"] do |cmd|

    cmd.desc "Show Firewall Rule"
    cmd.arg_name "firewall-rule-id"
    cmd.command [:show] do |c|

      c.action do |global_options, options, args|
        raise "You must specify server groups to show" if args.empty?

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

        display_options = { :fields => [
          :id, :protocol,:source, :sport, :destination, :dport, :icmp_type, :firewall_policy, :description
        ],
          :vertical => true
        }
        table_opts = global_options.update(display_options)
        render_table(policies, table_opts)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
brightbox-cli-1.1.0 lib/brightbox-cli/commands/firewall-rules-show.rb
brightbox-cli-1.0.0 lib/brightbox-cli/commands/firewall-rules-show.rb
brightbox-cli-1.0.0.rc2 lib/brightbox-cli/commands/firewall-rules-show.rb
brightbox-cli-1.0.0.rc1 lib/brightbox-cli/commands/firewall-rules-show.rb