Class: VCloudSdk::Xml::InstantiateVAppTemplateParams

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #edit_link, #get_nodes, #href, #href=, #href_id, #initialize, #power_off_link, #power_on_link, #remove_link, #running_tasks, #to_s, #type, #type=, #undeploy_link, #urn, #xpath

Constructor Details

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

Instance Method Details

#all_eulas_accepted=(value) ⇒ Object



13
14
15
16
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 13

def all_eulas_accepted=(value)
  eulas_node = get_nodes("AllEULAsAccepted").first
  eulas_node.content = value
end

#descriptionObject



9
10
11
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 9

def description
  get_nodes("Description").first
end

#description=(desc) ⇒ Object



22
23
24
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 22

def description=(desc)
  description.content = desc
end

#linked_clone=(value) ⇒ Object



26
27
28
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 26

def linked_clone=(value)
  @root["linkedClone"] = value.to_s
end

#nameObject



5
6
7
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 5

def name
  @root["name"]
end

#name=(name) ⇒ Object



18
19
20
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 18

def name=(name)
  @root["name"] = name
end

#set_locality=(locality) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 38

def set_locality=(locality)
  return unless locality

  raise "vApp locality already set." if @local_exists
  @local_exists = true

  locality.each do |k,v|
    node_sp = create_child("SourcedVmInstantiationParams",
                           namespace.prefix,
                           namespace.href)
    is_source_delete.node.after(node_sp)

    node_sv = add_child("Source",
                        namespace.prefix,
                        namespace.href,
                        node_sp)
    node_sv["type"] = k.type
    node_sv["name"] = k.name
    node_sv["href"] = k.href

    node_lp = create_child("LocalityParams",
                           namespace.prefix,
                           namespace.href)
    node_sv.after(node_lp)

    node_re = add_child("ResourceEntity",
                        namespace.prefix,
                        namespace.href,
                        node_lp)
    node_re["type"] = v.type
    node_re["name"] = v.name
    node_re["href"] = v.href
  end
end

#set_network_config(vapp_network_name, vdc_netowrk_href, fence_mode) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 73

def set_network_config(vapp_network_name, vdc_netowrk_href, fence_mode)
  instantiation_param = get_nodes("InstantiationParams").first

  net_config_section = add_child("NetworkConfigSection",
                                 namespace.prefix,
                                 namespace.href,
                                 instantiation_param.node)

  ovf_info = add_child("Info", "ovf", OVF, net_config_section)
  ovf_info.content = "Configuration parameters for logical networks"

  network_config = create_child("NetworkConfig",
                                namespace.prefix,
                                namespace.href)
  ovf_info.after(network_config)
  network_config["networkName"] = vapp_network_name

  configuration = add_child("Configuration",
                            namespace.prefix,
                            namespace.href,
                            network_config)

  parent_network = add_child("ParentNetwork",
                             namespace.prefix,
                             namespace.href,
                             configuration)
  parent_network["href"] = vdc_netowrk_href

  fence_node = create_child("FenceMode",
                            namespace.prefix,
                            namespace.href)
  parent_network.after(fence_node)
  fence_node.content = fence_mode
end

#source=(src) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb', line 30

def source=(src)
  source_node = get_nodes("Source").first
  source_node["href"] = src["href"]
  source_node["id"] = src["id"]
  source_node["type"] = src["type"]
  source_node["id"] = src["id"]
end