[one-users] XML-RPC API 2.0 host.delete return value

Daniel Molina Aranda danmolin at fdi.ucm.es
Fri Nov 26 06:44:15 PST 2010


Hi,

You are right, there is a typo in the documentation, because when the call
succeeds the second component of the array is not returned. The
documentation should be:

"OUT     Boolean         true or false whenever is successful or not
OUT      String  if an error occurs this is error message, otherwise it does
not exist."

instead of,

"OUT     Boolean         true or false whenever is successful or not
OUT      String  if an error occurs this is error message, otherwise it is
null."

We have already modified it in the documentation [1]

BTW, we are thinking about modifying it to return null, so that all the
calls return the same number of components in the array. But we would like
to know the opinion of the community about this issue, specially those ones
that are developing tools using this API. If the community aproves this
change we can include it in the 2.2 release.

Any comment or feedback would be appreciated.


[1] http://www.opennebula.org/documentation:rel2.0:api

On 24 November 2010 00:53, Łukasz Oleś <lukaszoles at gmail.com> wrote:

> Hi,
>
> I'm working on Python bindings for XML-RPC Api and I found some
> incompatibility between documentation and rpc server behavior.
>
> When I'm running rpc.one.host.delete(1) it returns [True], but according to
> documentation:
>
> "OUT     Boolean         true or false whenever is successful or not
> OUT      String  if an error occurs this is error message, otherwise it is
> null."
>
> it should return something like [True, None] and when I'm running this code
> ret=rpc.one.host.delete(1)
> ret[1]
> it raises IndexError Exception
>
> I checked ruby implementation but in ruby when I'm accessing list outside
> scope it returns nil and accidentally it works fine.
>
>
> Is it bug or maybe I misunderstood documentation?
>
> Regards,
> Łukasz Oleś
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Daniel Molina, Cloud Technology Engineer/Researcher
DSA Research Group: web http://dsa-research.org and blog
http://blog.dsa-research.org
OpenNebula Open Source Toolkit for Cloud Computing:
http://www.OpenNebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20101126/e3cf74fa/attachment-0003.htm>


More information about the Users mailing list