lib/rbovirt.rb in rbovirt-0.0.32 vs lib/rbovirt.rb in rbovirt-0.0.33
- old
+ new
@@ -17,14 +17,16 @@
require "client/cluster_api"
require "client/host_api"
require "client/datacenter_api"
require "client/storage_domain_api"
require "client/quota_api"
+require "client/disk_api"
require "nokogiri"
require "rest_client"
require "restclient_ext/request"
+require "restclient_ext/resource"
module OVIRT
class OvirtVersionUnsupportedException < StandardError; end
class OvirtException < StandardError
@@ -129,13 +131,14 @@
rescue
handle_fault $!
end
end
- def http_delete(suburl)
+ def http_delete(suburl, body=nil, headers={})
begin
- headers = {:accept => 'application/xml'}.merge(auth_header).merge(filter_header)
- res = rest_client(suburl).delete(headers)
+ headers = body ? http_headers(headers) :
+ {:accept => 'application/xml'}.merge(auth_header).merge(filter_header)
+ res = rest_client(suburl).delete(body, headers)
puts "#{res}\n" if ENV['RBOVIRT_LOG_RESPONSE']
Nokogiri::XML(res)
rescue
handle_fault $!
end