Sha256: 56143c7a331030fa879177e18627684e8fbad550ab98015d51e139a1d324dfb2

Contents?: true

Size: 774 Bytes

Versions: 11

Compression:

Stored size: 774 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentFwDelete < Knife

      include Knife::JoyentBase

      banner "knife joyent fw delete <fw_id>"

      def run
        unless name_args.size === 1
          show_usage
          exit 1
        end

        id = name_args.first
        # puts id
        res = self.connection.request(
          :method => "DELETE",
          :path => "/my/fwrules/#{id}"
        )

        rules = [
          ui.color('ID', :bold),
          ui.color('Enabled', :bold),
          ui.color('Rule', :bold),
        ]

        if res.status == 204
          ui.info "Rule #{id} Deleted."
        else
          self.output_error(res)
        end

      rescue => e
        output_error(e)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
knife-joyent-0.4.14 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.12 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.11 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.10 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.9 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.8 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.5 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.4 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.3 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.2 lib/chef/knife/joyent_fw_delete.rb
knife-joyent-0.4.1 lib/chef/knife/joyent_fw_delete.rb