WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] Diferences in Xen API languages bindings ou implementation

To: Erick Gomes <eag0911@xxxxxxxxx>
Subject: Re: [Xen-API] Diferences in Xen API languages bindings ou implementations?
From: Jonathan Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>
Date: Thu, 16 Sep 2010 10:42:05 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 16 Sep 2010 02:42:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=Frh4gQAw8J_dDpwGvneoJcYZYMZBT1DYS5o-e@xxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTi=Frh4gQAw8J_dDpwGvneoJcYZYMZBT1DYS5o-e@xxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: ActVg2ZltELiFVeVTLOfTKSJNdDFbQ==
Thread-topic: [Xen-API] Diferences in Xen API languages bindings ou implementations?
Hi Erick,

XenAPI.py is a thin layer on top of the raw XMLRPC which hides some aspects of 
the session handling and error checking. I don't think it's documented anywhere 
as far as I know, so figuring out how to get some things to work involves 
looking at the source. I often use the standard 'xmlrpclib' module instead, 
which you might find is closer to the documented API.

For reference, here's how to call session.get_this_host using both libraries:

First, using XenAPI.py:

import XenAPI
session = XenAPI.Session("http://localhost/";)
session.login_with_password("root","myultrasecurepassword")
session.xenapi.session.get_this_host(session._session)


Secondly, using xmlrpclib:

import xmlrpclib
s=xmlrpclib.Server("http://localhost/";)
session_ref=s.session.login_with_password("root","myultrasecurepassword")['Value']
s.session.get_this_host(session_ref,session_ref)['Value']

Hope this helps!

Jon

On 15 Sep 2010, at 22:17, Erick Gomes wrote:

> Hi,
> 
> I'm new in Xen and here.
> 
> I have studied the Xen API and some questions happened, but i will try 
> to resume all in one question:
> 
> I understood that the xenapi is like an set of XML-RPC's that can be 
> used as libraries for some languages, like XenAPI.py, etc. My question 
> is, there are any possibility that the implementation of those libraries 
> doesn't implement the full capabilities of Xen Management API? Or there 
> are diferentes APIs implementations?
> 
> I sad this because i am try to execute "session.get_this_host(session 
> id, session ref)" using XenAPI.py or directly using xmlrpclib for 
> python, and only with the xmlrpc i can execute with sucess.
> 
> 
> Thank's
> Erick
> 
> <ATT00001..txt>


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>