Class: Vcloud::NetLauncher::NetLaunch
- Inherits:
- 
      Object
      
        - Object
- Vcloud::NetLauncher::NetLaunch
 
- Defined in:
- lib/vcloud/net_launcher/net_launch.rb
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ void 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initializes instance variables. 
- 
  
    
      #run(config_file = nil)  ⇒ void 
    
    
  
  
  
  
  
  
  
  
  
    Parses a configuration file and provisions the networks it defines. 
Constructor Details
#initialize ⇒ void
Initializes instance variables.
| 8 9 10 | # File 'lib/vcloud/net_launcher/net_launch.rb', line 8 def initialize @config_loader = Vcloud::Core::ConfigLoader.new end | 
Instance Method Details
#run(config_file = nil) ⇒ void
This method returns an undefined value.
Parses a configuration file and provisions the networks it defines.
| 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # File 'lib/vcloud/net_launcher/net_launch.rb', line 16 def run(config_file = nil) config = @config_loader.load_config(config_file, Vcloud::NetLauncher::Schema::NET_LAUNCH) config[:org_vdc_networks].each do |net_config| net_config[:fence_mode] ||= 'isolated' Vcloud::Core.logger.info("Provisioning orgVdcNetwork #{net_config[:name]}.") begin Vcloud::Core::OrgVdcNetwork.provision(net_config) rescue RuntimeError => e Vcloud::Core.logger.error("Could not provision orgVdcNetwork: #{e.}") raise end end end |