class RbVmomi::VIM::HostSystem

Public Instance Methods

cli_info_fetcher() click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 33
def cli_info_fetcher
  # XXX there can be more than one
  return @cached_cli_info_fetcher if @cached_cli_info_fetcher
  inst = dtm.DynamicTypeMgrQueryMoInstances.find { |x| x.moType == 'vim.CLIInfo' }
  @cached_cli_info_fetcher = create_dynamic_managed_object inst
end
create_dynamic_managed_object(inst) click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 28
def create_dynamic_managed_object inst
  wsdlName = dti.managedTypeInfo.find { |x| x.name == inst.moType }.wsdlName
  _connection.type(wsdlName).new(_connection, inst.id)
end
direct?() click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 44
def direct?
  @ref == 'ha-host'
end
dti() click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 24
def dti
  @cached_dti ||= dtm.DynamicTypeMgrQueryTypeInfo
end
dtm() click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 8
def dtm
  @cached_dtm ||= begin
      RetrieveDynamicTypeManager()
    rescue VIM::MethodNotFound
      if summary.config.product.version >= '4.1.0'
        if summary.config.product.version < '5.0.0' and direct?
          VIM::InternalDynamicTypeManager(_connection, 'ha-dynamic-type-manager')
        else
          raise "esxcli not supported through VC before 5.0.0"
        end
      else
        raise "esxcli not supported before 4.1.0"
      end
    end
end
esxcli() click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 4
def esxcli
  @cached_esxcli ||= VIM::EsxcliNamespace.root(self)
end
mme() click to toggle source
# File lib/rbvmomi/vim/HostSystem.rb, line 40
def mme
  @cached_mme ||= RetrieveManagedMethodExecuter()
end