lib/yao/resources/hypervisor.rb in yao-0.7.0 vs lib/yao/resources/hypervisor.rb in yao-0.8.0
- old
+ new
@@ -20,29 +20,23 @@
alias version hypervisor_version
self.service = "compute"
self.resource_name = "os-hypervisor"
self.resources_name = "os-hypervisors"
+ self.resources_detail_available = true
class << self
- def list_detail(query={})
- return_resources(
- resources_from_json(
- GET([resources_path, "detail"].join("/"), query).body
- )
- )
- end
-
+ # @return [Yao::Resources::Hypervisor::Statistics]
def statistics
json = GET([resources_path, "statistics"].join("/")).body
Yao::Resources::Hypervisor::Statistics.new(json["hypervisor_statistics"])
end
+ # @param id [String]
+ # @return [Yao::Resources::Hypervisor::Uptime]
def uptime(id)
- res = resource_from_json(
- GET([resources_path, id, "uptime"].join("/")).body
- )
- Yao::Resources::Hypervisor::Uptime.new(res)
+ json = GET([resources_path, id, "uptime"].join("/")).body
+ Yao::Resources::Hypervisor::Uptime.new(json["hypervisor"])
end
end
class Statistics < OpenStruct; end
class Uptime < OpenStruct; end