Class: Chef::Knife::Raw::RawInputServerAPI

Inherits:
HTTP
  • Object
show all
Defined in:
lib/chef/knife/raw.rb

Overview

We need a custom HTTP client class here because we don’t want to even try to decode the body, in case we get back corrupted JSON or whatnot.

Instance Attribute Summary

Attributes inherited from HTTP

#keepalives, #middlewares, #options, #redirect_limit, #sign_on_redirect, #url

Instance Method Summary collapse

Methods inherited from HTTP

#delete, #get, #head, #http_client, #last_response, middlewares, #post, #put, #request, #streaming_request, #streaming_request_with_progress, use

Constructor Details

#initialize(options = {}) ⇒ RawInputServerAPI

Returns a new instance of RawInputServerAPI.



61
62
63
64
65
66
67
68
# File 'lib/chef/knife/raw.rb', line 61

def initialize(options = {})
  # If making a change here, also update Chef::ServerAPI.
  options[:client_name] ||= Chef::Config[:node_name]
  options[:raw_key] ||= Chef::Config[:client_key_contents]
  options[:signing_key_filename] ||= Chef::Config[:client_key] unless options[:raw_key]
  options[:ssh_agent_signing] ||= Chef::Config[:ssh_agent_signing]
  super(Chef::Config[:chef_server_url], options)
end