Class: Nagios::Promoo::Occi::Probes::BaseProbe

Inherits:
Object
  • Object
show all
Defined in:
lib/nagios/promoo/occi/probes/base_probe.rb

Overview

Base probe for all OCCI-related probes.

Author:

Direct Known Subclasses

CategoriesProbe, ComputeProbe, KindsProbe, MixinsProbe

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BaseProbe

Returns a new instance of BaseProbe.



17
18
19
# File 'lib/nagios/promoo/occi/probes/base_probe.rb', line 17

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/nagios/promoo/occi/probes/base_probe.rb', line 15

def options
  @options
end

Class Method Details

.runnable?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/nagios/promoo/occi/probes/base_probe.rb', line 10

def runnable?
  false
end

Instance Method Details

#clientObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/nagios/promoo/occi/probes/base_probe.rb', line 21

def client
  @_client ||= ::Occi::Api::Client::ClientHttp.new(
    endpoint: options[:endpoint],
    auth: {
      type: options[:auth].gsub('-voms', ''),
      user_cert: options[:token].gsub('file://', ''),
      user_cert_password: nil,
      token: options[:token],
      ca_path: options[:ca_path],
      voms: options[:auth] == 'x509-voms'
    },
    log: {
      level: options[:debug] ? ::Occi::Api::Log::DEBUG : ::Occi::Api::Log::ERROR,
      logger: nil,
      out: '/dev/null'
    }
  )
end