class Chef::HTTP::APIVersions
An HTTP
middleware to retrieve and store the Chef
Server’s minimum and maximum supported API versions.
Public Class Methods
Source
# File lib/chef/http/api_versions.rb, line 27 def initialize(options = {}); end
Public Instance Methods
Source
# File lib/chef/http/api_versions.rb, line 29 def handle_request(method, url, headers = {}, data = false) [method, url, headers, data] end
Source
# File lib/chef/http/api_versions.rb, line 33 def handle_response(http_response, rest_request, return_value) if http_response.code == "406" ServerAPIVersions.instance.reset! end if http_response.key?("x-ops-server-api-version") ServerAPIVersions.instance.set_versions(JSONCompat.parse(http_response["x-ops-server-api-version"])) else ServerAPIVersions.instance.unversioned! end [http_response, rest_request, return_value] end
Source
# File lib/chef/http/api_versions.rb, line 49 def handle_stream_complete(http_response, rest_request, return_value) [http_response, rest_request, return_value] end
Source
# File lib/chef/http/api_versions.rb, line 45 def stream_response_handler(response) nil end