Class: VCloudSdk::Xml::NetworkConnection

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.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, #name, #name=, #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

#ip_addressObject



26
27
28
29
30
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 26

def ip_address
  ip_address_node = get_nodes("IpAddress").first
  return if ip_address_node.nil?
  ip_address_node.content
end

#ip_address=(value) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 32

def ip_address=(value)
  # When addressing mode is other than MANUAL this node does not exist.
  unless get_nodes("IpAddress").first
    # must be after network connection index
    index_node = get_nodes("NetworkConnectionIndex").first
    ip_node = create_child("IpAddress")
    index_node.node.after(ip_node)
  end
  get_nodes("IpAddress").first.content = value
end

#ip_address_allocation_modeObject



59
60
61
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 59

def ip_address_allocation_mode
  get_nodes("IpAddressAllocationMode").first.content
end

#ip_address_allocation_mode=(value) ⇒ Object



63
64
65
66
67
68
69
70
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 63

def ip_address_allocation_mode=(value)
  unless IP_ADDRESSING_MODE.values.include?(value)
    fail ArgumentError,
         "Invalid IP addressing mode.  Valid modes " +
         "are: #{IP_ADDRESSING_MODE.values.join(" ")}"
  end
  get_nodes("IpAddressAllocationMode").first.content = value
end

#is_connectedObject



43
44
45
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 43

def is_connected
  get_nodes("IsConnected").first.content
end

#is_connected=(value) ⇒ Object



47
48
49
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 47

def is_connected=(value)
  get_nodes("IsConnected").first.content = value
end

#mac_addressObject



51
52
53
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 51

def mac_address
  get_nodes("MACAddress").first.content
end

#mac_address=(value) ⇒ Object



55
56
57
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 55

def mac_address=(value)
  get_nodes("MACAddress").first.content = value
end

#networkObject



4
5
6
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 4

def network
  @root["network"]
end

#network=(value) ⇒ Object

Value should be the name of the vApp network to connect to



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

def network=(value)
  @root["network"] = value
end

#network_connection_indexObject



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

def network_connection_index
  get_nodes("NetworkConnectionIndex").first.content
end

#network_connection_index=(value) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb', line 17

def network_connection_index=(value)
  index_node = get_nodes("NetworkConnectionIndex").first
  if index_node.nil?
    index_node = create_child("NetworkConnectionIndex")
    add_child(index_node)
  end
  index_node.content = value
end