Class: Fog::Compute::VcloudDirector::TemplateVm

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vcloud_director/models/compute/template_vm.rb

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #lazy_load_attrs, #make_attr_loaded_method, #make_lazy_load_method

Constructor Details

This class inherits a constructor from Fog::Compute::VcloudDirector::Model

Instance Method Details

#customizationObject



28
29
30
31
32
# File 'lib/fog/vcloud_director/models/compute/template_vm.rb', line 28

def customization
  requires :id
  data = service.get_vm_customization(id).body
  service.vm_customizations.new(data)
end

#disksObject



40
41
42
43
# File 'lib/fog/vcloud_director/models/compute/template_vm.rb', line 40

def disks
  requires :id
  service.disks(:vm => self)
end

#networkObject



34
35
36
37
38
# File 'lib/fog/vcloud_director/models/compute/template_vm.rb', line 34

def network
  requires :id
  data = service.get_vm_network(id).body
  service.vm_networks.new(data)
end

#reloadObject



16
17
18
19
20
# File 'lib/fog/vcloud_director/models/compute/template_vm.rb', line 16

def reload
  #Parent vapp_name & id are nil on a template_vm. Adding them from the collection parent
  self.vapp_template_id = collection.vapp_template.id
  self.vapp_template_name = collection.vapp_template.name
end

#tagsObject



23
24
25
26
# File 'lib/fog/vcloud_director/models/compute/template_vm.rb', line 23

def tags
  requires :id
  service.tags(:vm => self)
end

#vapp_templateObject



46
47
48
# File 'lib/fog/vcloud_director/models/compute/template_vm.rb', line 46

def vapp_template
  service.vapp_templates.get(vapp_template_id)
end