# -*- coding: utf-8 -*- module Fog module Vcloud class Compute class Real def configure_vm_memory(vm_data) edit_uri = vm_data.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 = < byte * 2^20 Memory Size #{vm_data[:'rasd:VirtualQuantity']} MB of memory 5 0 4 #{vm_data[:'rasd:VirtualQuantity']} 0 EOF request( :body => body, :expects => 202, :headers => {'Content-Type' => vm_data[:"vcloud_type"] }, :method => 'PUT', :uri => edit_uri, :parse => true ) end end end end end