Sha256: d18667693c53d3f904cd807fa5ce91946e37afe524534c5df73c5d7cd56488e7

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 Bytes

Contents

module Yao::Resources
  class Hypervisor < Base
    friendly_attributes :hypervisor_hostname, :hypervisor_type, :hypervisor_version, :running_vms, :current_workload,
                        :vcpus, :vcpus_used,
                        :memory_mb, :memory_mb_used, :free_disk_gb,
                        :local_gb, :local_gb_used, :free_disk_gb, :status

    def cpu_info
      JSON.parse self["cpu_info"]
    end

    def enabled?
      self['status'] == 'enabled'
    end

    alias hostname hypervisor_hostname
    alias type     hypervisor_hostname
    alias version  hypervisor_version

    self.service        = "compute"
    self.resource_name  = "os-hypervisor"
    self.resources_name = "os-hypervisors"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yao-0.3.8 lib/yao/resources/hypervisor.rb
yao-0.3.7 lib/yao/resources/hypervisor.rb