# -*- encoding: utf-8 -*- module Fog module Vcloud class Compute class Real def configure_vm_network(network_info) edit_uri = network_info.select {|k,v| k == :Link && v[:rel] == 'edit'} edit_uri = edit_uri.kind_of?(Array) ? edit_uri.flatten[1][:href] : edit_uri[:Link][:href] body = < Specifies the available VM network connections 0 0 true #{network_info[:NetworkConnection][:IpAddressAllocationMode]} EOF print "Request: #{body}" request( :body => body, :expects => 202, :headers => {'Content-Type' => network_info[:"vcloud_type"] }, :method => 'PUT', :uri => "#{edit_uri}", :parse => true ) end end end end end