Class: VCloudSdk::Xml::VApp

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/cloud/vcloud/xml/wrapper_classes/vapp.rb

Direct Known Subclasses

VAppTemplate

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute_with_ns, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #error, #get_nodes, #href, #href_id, #initialize, #name, #name=, #to_s, #type, #urn, #xpath

Constructor Details

This class inherits a constructor from VCloudSdk::Xml::Wrapper

Instance Method Details



25
26
27
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 25

def cancel_link
  get_nodes("Link", {"rel" => "task:cancel"}, true).first
end

#descriptionObject



5
6
7
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 5

def description
  get_nodes("Description").first.content
end

#discard_stateObject



58
59
60
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 58

def discard_state
  get_nodes("Link", {"rel" => "discardState"}, true).first
end

#network_config_sectionObject



9
10
11
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 9

def network_config_section
  get_nodes("NetworkConfigSection").first
end


17
18
19
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 17

def power_off_link
  get_nodes("Link", {"rel" => "power:powerOff"}, true).first
end


13
14
15
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 13

def power_on_link
  get_nodes("Link", {"rel" => "power:powerOn"}, true).first
end

#prerunning_tasksObject



36
37
38
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 36

def prerunning_tasks
  tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
end


21
22
23
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 21

def reboot_link
  get_nodes("Link", {"rel" => "power:reboot"}, true).first
end


62
63
64
65
66
67
68
69
70
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 62

def recompose_vapp_link(force = false)
  link = get_nodes("Link", {"rel" => "recompose"}, true).first
  return link if !force

  fix_if_invalid(link,
                 "recompose",
                 MEDIA_TYPE[:RECOMPOSE_VAPP_PARAMS],
                 "#{href}/action/recomposeVApp")
end


29
30
31
32
33
34
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 29

def remove_link(force = false)
  link = get_nodes("Link", {"rel" => "remove"}, true).first
  return link if !force

  fix_if_invalid(link, "remove", "", href)
end

#running_tasksObject



40
41
42
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 40

def running_tasks
  get_nodes("Task", {"status" => "running"})
end

#tasksObject



44
45
46
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 44

def tasks
  get_nodes("Task")
end


48
49
50
51
52
53
54
55
56
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 48

def undeploy_link(force = false)
  link = get_nodes("Link", {"rel" => "undeploy"}, true).first
  return link if !force

  fix_if_invalid(link,
                 "undeploy",
                 MEDIA_TYPE[:UNDEPLOY_VAPP_PARAMS],
                 "#{href}/action/undeploy")
end

#vm(name) ⇒ Object



76
77
78
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 76

def vm(name)
  get_nodes("Vm", {"name" => name}).first
end

#vmsObject



72
73
74
# File 'lib/cloud/vcloud/xml/wrapper_classes/vapp.rb', line 72

def vms
  get_nodes("Vm")
end