    # File lib/chef/api_client.rb, line 237
        def save(new_key=false, validation=false)
          if validation
            r = Chef::REST.new(Chef::Config[:chef_server_url], Chef::Config[:validation_client_name], Chef::Config[:validation_key])
          else
            r = Chef::REST.new(Chef::Config[:chef_server_url])
          end
          # First, try and create a new registration
          begin
            r.post_rest("clients", {:name => self.name, :admin => self.admin })
          rescue Net::HTTPServerException => e
            # If that fails, go ahead and try and update it
            if e.response.code == "409"
              r.put_rest("clients/#{name}", { :name => self.name, :admin => self.admin, :private_key => new_key })
            else
              raise e
            end
          end
        end