Module: DeltacloudVM::Client::Methods::BackwardCompatibility

Included in:
Connection
Defined in:
lib/deltacloud_vm/client/methods/backward_compatiblity.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#api_hostObject

Backward compatibility methods provides fallback for the old deltacloud-client gem.



24
25
26
# File 'lib/deltacloud_vm/client/methods/backward_compatiblity.rb', line 24

def api_host
  connection.url_prefix.host
end

#api_portObject



28
29
30
# File 'lib/deltacloud_vm/client/methods/backward_compatiblity.rb', line 28

def api_port
  connection.url_prefix.port
end

#connect {|self.clone| ... } ⇒ Object

Yields:

  • (self.clone)


32
33
34
# File 'lib/deltacloud_vm/client/methods/backward_compatiblity.rb', line 32

def connect(&block)
  yield self.clone
end

#discovered?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/deltacloud_vm/client/methods/backward_compatiblity.rb', line 52

def discovered?
  true unless entrypoint.nil?
end

#use_driver(new_driver, opts = {}) ⇒ Object Also known as: use_config!



46
47
48
# File 'lib/deltacloud_vm/client/methods/backward_compatiblity.rb', line 46

def use_driver(new_driver, opts={})
  with_config(opts.merge(:driver => new_driver))
end

#with_config(opts) {|inst = use( opts[:driver], opts[:username], opts[:password], opts[:provider] )| ... } ⇒ Object

Yields:

  • (inst = use( opts[:driver], opts[:username], opts[:password], opts[:provider] ))


36
37
38
39
40
41
42
43
44
# File 'lib/deltacloud_vm/client/methods/backward_compatiblity.rb', line 36

def with_config(opts, &block)
  yield inst = use(
    opts[:driver],
    opts[:username],
    opts[:password],
    opts[:provider]
  ) if block_given?
  inst
end