Method: Mu::Ddt#set_hosts

Defined in:
lib/mu/api/ddt.rb

#set_hosts(roles = [], names = [], type = "v4") ⇒ Object

sets the hosts in the loaded scenario

* roles = an array of the host roles defined in the scenario
* names = an array of host names to be mapped to the roles
* type = network layer type (v4, v6 or l2) matching the defined hosts


115
116
117
118
119
120
121
122
123
124
# File 'lib/mu/api/ddt.rb', line 115

def set_hosts(roles=[], names=[], type="v4")
  responses = Array.new
  hosts = roles.length.to_i
  hosts.times do | i |
     response = @http.post("session/scenario/hosts/#{roles[i]}/#{names[i]}/#{type}")
     responses << response
  end
  msg responses, Logger::DEBUG
  return responses
end