Sha256: eee4d1b081a2225347d5bffc3b1cf5e9e190b11d0edd4b425d03806344e9415c

Contents?: true

Size: 694 Bytes

Versions: 11

Compression:

Stored size: 694 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentServerFwEnable < Knife

      include Knife::JoyentBase

      banner "knife joyent server fw enable <server_id>"

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

        id = name_args.first
        # puts id
        res = self.connection.request(
          :method => "POST",
          :path => "/my/machines/#{id}",
          :query => {"action" => "enable_firewall"}
        )

        if (res.status === 202)
          ui.info ui.color("Firewall Enabled for server #{id}", :cyan)
        else
          output_error(res)
        end
      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_server_fw_enable.rb
knife-joyent-0.4.12 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.11 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.10 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.9 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.8 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.5 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.4 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.3 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.2 lib/chef/knife/joyent_server_fw_enable.rb
knife-joyent-0.4.1 lib/chef/knife/joyent_server_fw_enable.rb