Description of problem: When using v4 rest api with request, which is valid for v3 compatibility requests, incorrect suggestion how request should look like is offered by system I removed certain field from DataCenter resource and moved it to V3DataCenter and initialize it using it's adapters. If I use this field from non-v3 api, error is produced, but in suggestion there's mention of this inexisting field: <parameter required="false" type="xs:string"> <name>datacenter.mac_pool.id</name> </parameter> How reproducible: 100% Expected results: Given suggestion should not be made.
There same problem occurns in: api/openstacknetworkproviders/ The type property is missing from the descriptions
The problem here is that there isn't a RSDL for version 4 of the API, we have a description of the model instead, available in the following URLs: /ovirt-engine/api/model.xml /ovirt-engine/api/model.json /ovirt-engine/api/model.html (this isn't available yet) Most probably we will fix this bug changing the way we report errors. Instead of returning the RSDL for the operation we will return a link to the relevant section of the documentation, where all the details of the operation and the types used will be available.
I'm requesting flags for 4.0.1, as I think we won't be able to fix this for 4.0.0.
Better description of the problem for openstacknetworkproviders: Issuing a syntactically incorrect request, for example POST: http://localhost:8080/ovirt-engine/api/openstacknetworkproviders/ <garbage> results in: 400 Bad Request with the body containing a description on how the request should be formated, for example: <usage_message> <message>Request syntactically incorrect. See the description below for the correct usage:</message> <detailedLink href="/ovirt-engine/api/openstacknetworkproviders" rel="add"><description>add a new OpenStack network provider to the system</description> <request><http_method>POST</http_method> <headers> <header required="false"> <name>Correlation-Id</name><value>any string</value> </header> <header required="true"> <name>Content-Type</name> <value>application/xml|json</value> </header> </headers> <body> <type>OpenStackNetworkProvider</type> <parameters_set> <description>add a new OpenStack network provider to the system</description> <parameter required="true" type="xs:string"> <name>openstack_network_provider.name</name> </parameter> <parameter required="false" type="collection"><name>openstack_network_provider.properties.property</name></parameter> <parameter required="false" type="xs:string"><name>openstack_network_provider.tenant_name</name> </parameter> ... The problem is that this reply does not list the full set of parameters. For example, in case of /ovirt-engine/api/openstacknetworkproviders we are missing the "type" parameter.
In version 4 of the API the returned for incorrect results will be a link to the documentation. For example, the following request: POST: https://engine.example.com/ovirt-engine/api/openstacknetworkproviders <garbage> Will produce the following response: <fault> <reason>Request syntactically incorrect.</reason> <detail>For correct usage, see: https://engine.example.com/ovirt-engine/api/model#services/openstack-network-providers/methods/add</detail> </fault>
*** Bug 1361079 has been marked as a duplicate of this bug. ***
verified in ovirt-engine-restapi-4.0.2.1-0.1.el7ev.noarch [lsvaty@nope ~]$ curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin@internal:*password* --cacert ca.crt -d "<test></test>" https://*hostname*:443/ovirt-engine/api/vms <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <detail>For correct usage, see: https://*hostname*/ovirt-engine/api/v4/model#services/vms/methods/add</detail> <reason>Request syntactically incorrect.</reason> </fault>