Class: Fog::Compute::Ecloud::ComputePool
- Inherits:
-
Ecloud::Model
- Object
- Model
- Ecloud::Model
- Fog::Compute::Ecloud::ComputePool
- Defined in:
- lib/fog/compute/ecloud/models/compute_pool.rb
Instance Attribute Summary
Attributes inherited from Ecloud::Model
Instance Method Summary collapse
- #cpu_usage ⇒ Object
- #detached_disks ⇒ Object
- #edit(options) ⇒ Object
- #environment ⇒ Object
- #id ⇒ Object
- #layout ⇒ Object
- #memory_usage ⇒ Object
- #operating_system_families ⇒ Object
- #reload ⇒ Object
- #servers ⇒ Object
- #storage_usage ⇒ Object
- #templates ⇒ Object
Methods inherited from Ecloud::Model
Instance Method Details
#cpu_usage ⇒ Object
24 25 26 27 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 24 def cpu_usage # time ? query = "/details?time=#{Time.parse(time).utc.strftime("%Y-%m-%dT%H:%M:%SZ")}" : query = "" @cpu_usage ||= Fog::Compute::Ecloud::CpuUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/cpu") end |
#detached_disks ⇒ Object
46 47 48 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 46 def detached_disks @detached_disks ||= self.service.detached_disks(:href => "#{service.base_path}/detacheddisks/computepools/#{id}") end |
#edit(options) ⇒ Object
58 59 60 61 62 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 58 def edit() [:uri] = href data = service.compute_pool_edit().body pool = collection.from_data(data) end |
#environment ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 50 def environment @environment ||= begin reload unless other_links environment_link = other_links.find{|l| l[:type] == "application/vnd.tmrk.cloud.environment"} self.service.environments.get(environment_link[:href]) end end |
#id ⇒ Object
64 65 66 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 64 def id href.scan(/\d+/)[0] end |
#layout ⇒ Object
20 21 22 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 20 def layout @layout ||= Fog::Compute::Ecloud::Layouts.new(:service => service, :href => "#{service.base_path}/layout/computePools/#{id}").first end |
#memory_usage ⇒ Object
29 30 31 32 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 29 def memory_usage # time ? query = "/details?time=#{Time.parse(time).utc.strftime("%Y-%m-%dT%H:%M:%SZ")}" : query = "" @memory_usage ||= Fog::Compute::Ecloud::MemoryUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/memory") end |
#operating_system_families ⇒ Object
38 39 40 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 38 def @operating_system_families ||= Fog::Compute::Ecloud::OperatingSystemFamilies.new(:service => service, :href => "#{service.base_path}/operatingSystemFamilies/computePools/#{id}") end |
#reload ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 68 def reload @servers = nil @layout = nil @cpu_usage = nil @memory_usage = nil @storage_usage = nil @operating_system_families = nil @templates = nil @detached_disks = nil @environment = nil super end |
#servers ⇒ Object
16 17 18 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 16 def servers @servers ||= Fog::Compute::Ecloud::Servers.new( :service => service, :href => "#{service.base_path}/virtualMachines/computePools/#{id}" ) end |
#storage_usage ⇒ Object
34 35 36 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 34 def storage_usage @storage_usage ||= Fog::Compute::Ecloud::StorageUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/storage") end |
#templates ⇒ Object
42 43 44 |
# File 'lib/fog/compute/ecloud/models/compute_pool.rb', line 42 def templates @templates ||= self.service.templates(:href => "#{service.base_path}/templates/computePools/#{id}") end |