Red Hat Bugzilla – Bug 867794
[RFE] print usage information to error page when API user calls POST action incorrectly
Last modified: 2016-02-10 14:14:53 EST
Description of problem:
This is an extension of bug 867772 to behave similarly to unix command line programs that print basic usage to stderr if they are called incorrectly.
This is mainly useful for people building stuff on top of rest API or people who have to use REST API for debugging because in such cases, typos or forgetting exact names are inevitable and this reduces times spent by digging in documentation greatly.
Version-Release number of selected component (if applicable):
3.1.0-18 / si19.1
Steps to Reproduce:
1. run curl ... -X POST "garbage" https://rhevm.example.org/api/vms/<vm_uuid>/ticket
generic HTTP error page is served
include correct usage information. Given that the reply is itself XML, it could include subtree like this (I may request too verbose answer but I can imagine that printing defaults could save considerable effort on debugging of some issues):
<!-- mandatory -->
<!-- integer, optional: number of seconds when password
is valid. Default: 7200, Default in Portal: 120 -->
*** Bug 913695 has been marked as a duplicate of this bug. ***
only use-case that makes sense is a formatting errors producing marshalling
exceptions, all other are covered by specific engine/api errors.
I don't get any detailed info for posting to /api/tags nor vms/<vm_uuid>/ticket.
I'm always getting <?xml version="1.0" encoding="UTF-8" standalone="yes"?><fault><reason>Bad Request</reason></fault>.
The change has been merged to the upstream 3.4 branch, so it will be available with the next rebase.
Verified in av7.
Closing as part of 3.4.0