Class: TrainPlugins::Vsphere::Connection

Inherits:
Train::Plugins::Transport::BaseConnection
  • Object
show all
Includes:
Platform
Defined in:
lib/train-vsphere/connection.rb

Instance Method Summary collapse

Methods included from Platform

#platform

Constructor Details

#initialize(options) ⇒ Connection

Returns a new instance of Connection.



20
21
22
23
24
25
26
# File 'lib/train-vsphere/connection.rb', line 20

def initialize(options)

  options = validate_options(options)
  super(options)
  enable_cache :api_call

end

Instance Method Details

#authenticateObject



28
29
30
31
32
33
# File 'lib/train-vsphere/connection.rb', line 28

def authenticate

  return api_client unless cache_enabled?(:api_call)

  @cache[:api_call][api_client.to_s.to_sym] ||= api_client
end

#local?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/train-vsphere/connection.rb', line 44

def local?
  false
end

#uriObject



38
39
40
41
# File 'lib/train-vsphere/connection.rb', line 38

def uri
  #Report vsphere URI
  "vsphere://#{options[:host]}"
end