Class: VCloudSdk::Xml::NetworkConfigSection

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/ruby_vcloud_sdk/xml/wrapper_classes/network_config_section.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

#add_network_config(config) ⇒ Object



9
10
11
12
13
14
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_config_section.rb', line 9

def add_network_config(config)
  unless config.is_a? NetworkConfig
    raise CloudError, "Only NetworkConfig can be added to #{self.class}"
  end
  add_child(config)
end

#delete_network_config(net_name) ⇒ Object



16
17
18
19
20
21
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/network_config_section.rb', line 16

def delete_network_config(net_name)
  net_config = network_configs.find {|n| n.network_name == net_name }
  raise ObjectNotFoundError,
    "Cannot delete network #{net_name}: not found" unless net_config
  net_config.node.remove
end

#network_configsObject



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

def network_configs
  get_nodes("NetworkConfig")
end