Class: ResourceIn::UCSDriver

Inherits:
Driver
  • Object
show all
Defined in:
lib/resource_in/driver_ucs.rb

Constant Summary

Constants inherited from Driver

Driver::DETAIL_FORMAT, Driver::FORMAT, Driver::VALID_PATTERN

Instance Method Summary collapse

Methods inherited from Driver

#invoke, #validate_condition

Constructor Details

#initializeUCSDriver

Returns a new instance of UCSDriver.



5
6
7
8
# File 'lib/resource_in/driver_ucs.rb', line 5

def initialize
  @cmd_list = '/usr/local/bin/ucs_list_servers'
  @cachepath = '/tmp/ucs_servers.cache'
end

Instance Method Details

#get(_) ⇒ Object



22
23
24
25
# File 'lib/resource_in/driver_ucs.rb', line 22

def get(_)
  # Not implemented yet
  []
end

#listObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/resource_in/driver_ucs.rb', line 9

def list
  invoke(@cmd_list, @cachepath).each do |d|
    d['status'] = case d['status']
    when 'ok'
      'ok'
    else
      'warning'
    end
    d['address'] = []
    d['boottime'] = ''
    d['created_by'] = ''
  end
end