# -*- encoding: utf-8 -*- module Fog module Vcloud class Compute class Real def configure_vm_cpus(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 = < hertz * 10^6 Number of Virtual CPUs #{vm_data[:'rasd:VirtualQuantity']} virtual CPU(s) 4 0 3 #{vm_data[:'rasd:VirtualQuantity']} 0 EOF request( :body => body, :expects => 202, :headers => { 'Content-Type' => vm_data[:"vcloud_type"] || 'application/vnd.vmware.vcloud.rasdItem+xml' }, :method => 'PUT', :uri => "#{edit_uri}", :parse => true ) end end end end end