lib/yao/resources/hypervisor.rb in yao-0.8.0 vs lib/yao/resources/hypervisor.rb in yao-0.9.0
- old
+ new
@@ -5,19 +5,31 @@
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
+ # @return [Hash]
def cpu_info
JSON.parse self["cpu_info"]
end
+ # @return [Bool]
def enabled?
self['status'] == 'enabled'
end
+ # @return [Bool]
+ def disabled?
+ self['status'] == 'disabled'
+ end
+
+ # @return [Yao::ComputeServices]
+ def service
+ Yao::ComputeServices.new(self['service'])
+ end
+
alias hostname hypervisor_hostname
- alias type hypervisor_hostname
+ alias type hypervisor_type
alias version hypervisor_version
self.service = "compute"
self.resource_name = "os-hypervisor"
self.resources_name = "os-hypervisors"