class Chef::Knife::JoyentServerFwDisable

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/joyent_server_fw_disable.rb, line 11
def run
  unless name_args.size === 1
    show_usage
    exit 1
  end

  id = name_args.first

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

  if (res.status == 202)
    puts ui.color("Firewall Disabled for server #{id}", :cyan)
  else
    output_error(res)
  end
end