On Thu, Apr 6, 2017 at 5:02 PM, Fabrice Bacchella <fabrice.bacchella@orange.fr> wrote:

> Le 6 avr. 2017 à 15:47, Yaniv Kaul <ykaul@redhat.com> a écrit :
>
>

> Perhaps in your case. Here[1] is an example of the ovirt system tests, which were only partially converted (work in progress...) to v4 API.

yes that really related to my use case.

Another problem that I have with lack of documentation, that REST API documentation or samples don't provide.

In python, what does vms_service.list(search='name=NotExistingVM') will return ? It's not stated in the REST documentation, but it's even worst in python.

You could file a bug for documentation, or better yet, contribute a patch to it.
A patch to a basic example for negative cases would be very helpful as well.
An example of a patch[1] for the SDK examples from someone who found it is lacking.

Let me know if I can help you with contributing the example. Start here[2]
TIA,
Y.

[1] https://gerrit.ovirt.org/#/c/75076/
[2] http://www.ovirt.org/develop/dev-process/working-with-gerrit/


It could throw an exception, return None, or return an empty list ?

If I'm using a sdk instead of direct HTTP call is not to be bothered my xml versus json representation, but instead find an answer to that kind of questions easily.
In the sample I just find:

vm = vms_service.list(search='name=myvm')[0]

Not really helpfull.

Is there any documentation about python exception thrown ? Or must I dig throw all the examples ?