Class: VSphereCloud::SoapStub

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud/vsphere/soap_stub.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, soap_log) ⇒ SoapStub

Returns a new instance of SoapStub.



5
6
7
8
# File 'lib/cloud/vsphere/soap_stub.rb', line 5

def initialize(host, soap_log)
  @host = host
  @soap_log = soap_log
end

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cloud/vsphere/soap_stub.rb', line 10

def create
  http_client = HTTPClient.new
  case @soap_log
    when String
      log_file = File.open(@soap_log, 'w')
      log_file.sync = true
      http_client.debug_dev = log_file
    when IO, StringIO
      http_client.debug_dev = @soap_log
  end
  http_client.send_timeout = 14400
  http_client.receive_timeout = 14400
  http_client.connect_timeout = 30
  http_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE

  VimSdk::Soap::StubAdapter.new(@host, 'vim.version.version6', http_client)
end