Class: OcciClient

Inherits:
Object
  • Object
show all
Defined in:
lib/probe/occi/client.rb

Overview

OCCI Client class.

Options

  • options - Hash with provided command line arguments.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ OcciClient

Returns a new instance of OcciClient.



27
28
29
30
31
32
33
34
35
36
# File 'lib/probe/occi/client.rb', line 27

def initialize(options)
  @connection = options

  # Select OCCI version
  if options[:occi].to_s == 'rocci'
    @occi_ver = 'Rocci'
  else
    @occi_ver = 'Occi'
  end
end

Instance Method Details

#computeObject



47
48
49
# File 'lib/probe/occi/client.rb', line 47

def compute
  @compute  ||= eval("#{@occi_ver}::Compute.new @connection")
end

#networkObject

Dynamically selects the proper class



39
40
41
# File 'lib/probe/occi/client.rb', line 39

def network
  @network  ||= eval("#{@occi_ver}::Network.new @connection")
end

#storageObject



43
44
45
# File 'lib/probe/occi/client.rb', line 43

def storage
  @storage  ||= eval("#{@occi_ver}::Storage.new @connection")
end