Hide Forgot
Description of problem: When trying to delete a storage domain using the REST API, the return code is 400 and the response body is: <fault> <reason>host parameter is missing</reason> </fault> The call is - DELETE ovirt-engine/api/storagedomains/3c0a32b7-0ec1-4dd5-a1e4-54156a4753b4 body: <storage_domain> <host id="724a18e4-bd69-42d9-a547-9f3aece0d0f4"/> <format>true</format> </storage_domain> * Same result even without <format>true</format> In rsdl, the parameter set is: <parameters_set> <parameter required="false" type="xs:boolean" context="matrix"> <name>force</name> <value>true|false</value> </parameter> <parameter required="true" type="xs:string" context="matrix"> <name>destroy</name> <value>the id or name of the host</value> </parameter> <parameter required="false" type="xs:boolean" context="matrix"> <name>async</name> <value>true|false</value> </parameter> </parameters_set> So it seems there is a problem here as well (the parameter name is 'destroy' instead of host), so I tried 'destroy' instead of 'host' just to check it that's the bug but the behavior is the same No logs attached because the request don't even get's to the engine Version-Release number of selected component (if applicable): ovirt-engine-4.0.0-0.7.master.el7ev.noarch How reproducible: 100% Steps to Reproduce: - Have a detached storage domain 1. Send DELETE request to ovirt-engine/api/storagedomains/<sd_id> with body: <storage_domain> <host id="724a18e4-bd69-42d9-a547-9f3aece0d0f4"/> <format>true</format> </storage_domain> 2. 3. Actual results: return code 400 <fault> <reason>host parameter is missing</reason> </fault> Expected results: Additional info:
These three parameters have been removed from version 4 of the API, and in general bodies are forbidden for DELETE operations. However, they should still be supported in version 3 of the API, so we are re-adding them to the backwards compatibility layer. Note that in the future you will need to use parameters instead of bodies, for example, to specify both "format" and "host": DELETE /ovirt-engine/api/storagedomains/123?format=true&host=myhost
I tested this in ovirt 4.1.0-0.0.master.20160613231338.git6e72c0b.el7.centos and it worked only DELETE /ovirt-engine/api/storagedomains/123?format=true&host=myhost when I use body (without url parameters) <storage_domain> <host id="724a18e4-bd69-42d9-a547-9f3aece0d0f4"/> <format>true</format> </storage_domain> I get the same error as described in bug (host parameter is missing)
Was that using version 3 of the API? In version 4 of the API request body for DELETE requests is just ignored.
Use api/v3/.. solved it (for using API version 3) verified in 4.1.0-0.0.master.20160613231338.git6e72c0b.el7.centos
oVirt 4.0.0 has been released, closing current release.