Class: Yao::Resources::Hypervisor
- Inherits:
-
Base
- Object
- Base
- Yao::Resources::Hypervisor
show all
- Defined in:
- lib/yao/resources/hypervisor.rb
Defined Under Namespace
Classes: Statistics, Uptime
Class Method Summary
collapse
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, #to_hash, #updated
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update
Class Method Details
41
42
43
44
|
# File 'lib/yao/resources/hypervisor.rb', line 41
def statistics
json = GET([resources_path, "statistics"].join("/")).body
Yao::Resources::Hypervisor::Statistics.new(json["hypervisor_statistics"])
end
|
48
49
50
51
|
# File 'lib/yao/resources/hypervisor.rb', line 48
def uptime(id)
json = GET([resources_path, id, "uptime"].join("/")).body
Yao::Resources::Hypervisor::Uptime.new(json["hypervisor"])
end
|
Instance Method Details
#cpu_info ⇒ Hash
11
12
13
|
# File 'lib/yao/resources/hypervisor.rb', line 11
def cpu_info
JSON.parse self["cpu_info"]
end
|
#disabled? ⇒ Bool
21
22
23
|
# File 'lib/yao/resources/hypervisor.rb', line 21
def disabled?
self['status'] == 'disabled'
end
|
#enabled? ⇒ Bool
16
17
18
|
# File 'lib/yao/resources/hypervisor.rb', line 16
def enabled?
self['status'] == 'enabled'
end
|
#service ⇒ Yao::ComputeServices
26
27
28
|
# File 'lib/yao/resources/hypervisor.rb', line 26
def service
Yao::ComputeServices.new(self['service'])
end
|