Class: Vcloud::Walker::Resource::Vm
- Defined in:
- lib/vcloud/walker/resource/vm.rb
Constant Summary collapse
- HARDWARE_RESOURCE_TYPES =
{ :cpu => '3', :memory => '4', :hard_disk => '17', :network_adapter => '10' }
Instance Attribute Summary collapse
-
#cpu ⇒ Object
readonly
Returns the value of attribute cpu.
-
#disks ⇒ Object
readonly
Returns the value of attribute disks.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#network_cards ⇒ Object
readonly
Returns the value of attribute network_cards.
-
#network_connections ⇒ Object
readonly
Returns the value of attribute network_connections.
-
#operating_system ⇒ Object
readonly
Returns the value of attribute operating_system.
-
#primary_network_connection_index ⇒ Object
readonly
Returns the value of attribute primary_network_connection_index.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#storage_profile ⇒ Object
readonly
Returns the value of attribute storage_profile.
-
#virtual_system_type ⇒ Object
readonly
Returns the value of attribute virtual_system_type.
-
#vmware_tools ⇒ Object
readonly
Returns the value of attribute vmware_tools.
Instance Method Summary collapse
-
#initialize(fog_vm) ⇒ Vm
constructor
A new instance of Vm.
Methods inherited from Entity
Constructor Details
#initialize(fog_vm) ⇒ Vm
Returns a new instance of Vm.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/vcloud/walker/resource/vm.rb', line 28 def initialize fog_vm @id = extract_id(fog_vm[:href]) @status = fog_vm[:status] @operating_system = fog_vm[:'ovf:OperatingSystemSection'][:'ovf:Description'] @network_connections = fog_vm[:NetworkConnectionSection][:NetworkConnection] if fog_vm[:NetworkConnectionSection] @primary_network_connection_index = fog_vm[:NetworkConnectionSection][:PrimaryNetworkConnectionIndex] extract_compute_capacity fog_vm[:'ovf:VirtualHardwareSection'][:'ovf:Item'] @vmware_tools = fog_vm[:RuntimeInfoSection][:VMWareTools] @virtual_system_type = extract_virtual_system_type(fog_vm[:'ovf:VirtualHardwareSection']) @storage_profile = { :id => fog_vm[:StorageProfile][:href].split('/').last, :name => fog_vm[:StorageProfile][:name], } @metadata = Vcloud::Core::Vm.(id) end |
Instance Attribute Details
#cpu ⇒ Object (readonly)
Returns the value of attribute cpu.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def cpu @cpu end |
#disks ⇒ Object (readonly)
Returns the value of attribute disks.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def disks @disks end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def id @id end |
#memory ⇒ Object (readonly)
Returns the value of attribute memory.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def memory @memory end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def @metadata end |
#network_cards ⇒ Object (readonly)
Returns the value of attribute network_cards.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def network_cards @network_cards end |
#network_connections ⇒ Object (readonly)
Returns the value of attribute network_connections.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def network_connections @network_connections end |
#operating_system ⇒ Object (readonly)
Returns the value of attribute operating_system.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def @operating_system end |
#primary_network_connection_index ⇒ Object (readonly)
Returns the value of attribute primary_network_connection_index.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def primary_network_connection_index @primary_network_connection_index end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def status @status end |
#storage_profile ⇒ Object (readonly)
Returns the value of attribute storage_profile.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def storage_profile @storage_profile end |
#virtual_system_type ⇒ Object (readonly)
Returns the value of attribute virtual_system_type.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def virtual_system_type @virtual_system_type end |
#vmware_tools ⇒ Object (readonly)
Returns the value of attribute vmware_tools.
16 17 18 |
# File 'lib/vcloud/walker/resource/vm.rb', line 16 def vmware_tools @vmware_tools end |