Class: Yao::Resources::Hypervisor
- Defined in:
- lib/yao/resources/hypervisor.rb
Defined Under Namespace
Classes: Statistics, Uptime
Instance Attribute Summary
Attributes included from RestfullyAccessible
Class Method Summary collapse
- .statistics ⇒ Yao::Resources::Hypervisor::Statistics
- .uptime(id) ⇒ Yao::Resources::Hypervisor::Uptime
Instance Method Summary collapse
Methods inherited from Base
#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #updated
Methods included from RestfullyAccessible
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update
Constructor Details
This class inherits a constructor from Yao::Resources::Base
Class Method Details
.statistics ⇒ Yao::Resources::Hypervisor::Statistics
29 30 31 32 |
# File 'lib/yao/resources/hypervisor.rb', line 29 def statistics json = GET([resources_path, "statistics"].join("/")).body Yao::Resources::Hypervisor::Statistics.new(json["hypervisor_statistics"]) end |
.uptime(id) ⇒ Yao::Resources::Hypervisor::Uptime
36 37 38 39 |
# File 'lib/yao/resources/hypervisor.rb', line 36 def uptime(id) json = GET([resources_path, id, "uptime"].join("/")).body Yao::Resources::Hypervisor::Uptime.new(json["hypervisor"]) end |
Instance Method Details
#cpu_info ⇒ Object
10 11 12 |
# File 'lib/yao/resources/hypervisor.rb', line 10 def cpu_info JSON.parse self["cpu_info"] end |
#enabled? ⇒ Boolean
14 15 16 |
# File 'lib/yao/resources/hypervisor.rb', line 14 def enabled? self['status'] == 'enabled' end |