f base.rb (backingservice)

This commit is contained in:
Glenn Sarti 2017-01-26 19:37:14 -08:00
parent 00971c8655
commit 24c043c506

View file

@ -5,6 +5,13 @@ module Vmpooler
# These defs must be overidden in child classes # These defs must be overidden in child classes
def initialize(options) def initialize(options)
@options = options
end
# returns
# [String] Name of the backing service
def name
'base'
end end
#def validate_config(config) #def validate_config(config)
@ -15,7 +22,7 @@ module Vmpooler
# pool : hashtable from config file # pool : hashtable from config file
# returns # returns
# hashtable # hashtable
# name : name of the device # name : name of the device <---- TODO is this all?
def vms_in_pool(pool) def vms_in_pool(pool)
fail "#{self.class.name} does not implement vms_in_pool" fail "#{self.class.name} does not implement vms_in_pool"
end end
@ -51,6 +58,7 @@ module Vmpooler
# returns # returns
# nil if it doesn't exist # nil if it doesn't exist
# Hastable of the VM # Hastable of the VM
# [String] name = Name of the VM
# [String] hostname = Name reported by Vmware tools (host.summary.guest.hostName) # [String] hostname = Name reported by Vmware tools (host.summary.guest.hostName)
# [String] template = This is the name of template exposed by the API. It must _match_ the poolname # [String] template = This is the name of template exposed by the API. It must _match_ the poolname
# [String] poolname = Name of the pool the VM is located # [String] poolname = Name of the pool the VM is located
@ -93,7 +101,7 @@ module Vmpooler
# returns # returns
# result: boolean # result: boolean
def vm_exists?(vm) def vm_exists?(vm)
fail "#{self.class.name} does not implement vm_exists?" !get_vm(vm).nil?
end end
end end