Class: Fog::Compute::Ecloud::ComputePool

Inherits:
Ecloud::Model show all
Defined in:
lib/fog/ecloud/models/compute/compute_pool.rb

Instance Attribute Summary

Attributes inherited from Ecloud::Model

#loaded

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#cpu_usageObject



25
26
27
28
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 25

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(:connection => connection, :href => "/cloudapi/ecloud/computePools/#{id}/usage/cpu")
end

#edit(options) ⇒ Object



47
48
49
50
51
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 47

def edit(options)
  options[:uri] = href
  data = connection.compute_pool_edit(options).body
  pool = collection.from_data(data)
end

#idObject



53
54
55
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 53

def id
  href.scan(/\d+/)[0]
end

#layoutObject



21
22
23
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 21

def layout
  @layout ||= Fog::Compute::Ecloud::Layouts.new(:connection => connection, :href => "/cloudapi/ecloud/layout/computePools/#{id}").first
end

#memory_usageObject



30
31
32
33
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 30

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(:connection => connection, :href => "/cloudapi/ecloud/computePools/#{id}/usage/memory")
end

#operating_system_familiesObject



39
40
41
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 39

def operating_system_families
  @operating_system_families ||= Fog::Compute::Ecloud::OperatingSystemFamilies.new(:connection => connection, :href => "/cloudapi/ecloud/operatingSystemFamilies/computePools/#{id}")
end

#serversObject



17
18
19
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 17

def servers
  @servers ||= Fog::Compute::Ecloud::Servers.new( :connection => connection, :href => "/cloudapi/ecloud/virtualMachines/computePools/#{id}" )
end

#storage_usageObject



35
36
37
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 35

def storage_usage
  @storage_usage ||= Fog::Compute::Ecloud::StorageUsageDetailSummary.new(:connection => connection, :href => "/cloudapi/ecloud/computePools/#{id}/usage/storage")
end

#templatesObject



43
44
45
# File 'lib/fog/ecloud/models/compute/compute_pool.rb', line 43

def templates
  @templates ||= Fog::Compute::Ecloud::Templates.new(:connection => connection, :href => "/cloudapi/ecloud/templates/computePools/#{id}")
end