Mailing List Archive

Few Questions About Xen management API
Hi Folks :

After going through this mailing list , reading u guys' discusstion
about the xen management API .
I'v got a few questions about this.

1) What's the benifit of using xml-rpc to implement the APIS? It seems
that soap has more powerful function comparing
with xml-rpc (wsdl support etc), and it is also very popular .

2) I saw that APIs were implemented by c bindings, so do u guys have
some plan for the othe lanaguage ? ( python etc .)
I think using python implementation will be good at compatible with
xm and current xend tools

3) Can I use the lateast verison of these bindings, and integrate
with our own products right now?
Is there a simple demo to show how to use this lib?

4) How can I get the API source code? Is there a CVS server or something
?

Thanks in advance !
Re: Few Questions About Xen management API [ In reply to ]
On Sat, Aug 12, 2006 at 04:02:28PM +0800, rickey berkeley wrote:

> Hi Folks :
>
> After going through this mailing list , reading u guys' discusstion
> about the xen management API .
> I'v got a few questions about this.
>
> 1) What's the benifit of using xml-rpc to implement the APIS? It seems
> that soap has more powerful function comparing
> with xml-rpc (wsdl support etc), and it is also very popular .

We have a separate project to create a DMTF CIM provider for Xen. CIM is a
very comprehensive specification and includes amongst other things, bindings
to SOAP. The idea is that the Xen-API project will provide something
lightweight and simple (so that we can get it stabilised right away) and then
the Xen-CIM project would sit on top providing the additional protocols,
better interoperability, and so on.

If you just want bare-bones access to a Xen-based system, you can use the Xen
API, but in an enterprise environment where SOAP's benefits come into play,
you would choose to use the CIM providers. CIM has a large number of
advantages in that environment, a binding to SOAP being just one of them, and
by the time you're working at that kind of scale, you may choose not to use
SOAP in any case.

In summary, the Xen API is the simple bare-bones management, and other
facilities would be built on top. XML-RPC has the advantage of being very
simple, and well supported across many languages.


> 2) I saw that APIs were implemented by c bindings, so do u guys have
> some plan for the othe lanaguage ? ( python etc .)
> I think using python implementation will be good at compatible
> with xm and current xend tools

Python definitely. The plan is to move xm and xend to the new API for the
Xen 3.0.4 release, and of course we will get Python bindings out of that.

If there are any other languages that you are interested in, please shout, and
we'll see what we can do.

> 3) Can I use the lateast verison of these bindings, and integrate
> with our own products right now?

You can use them, certainly, but they aren't going to be stable or supported
until the 3.0.4 release (early November, at a guess).

Obviously, we would like to see people start to use them now so that we can
test whether they are offering the right facilities in the right way, and then
when 3.0.4 comes out, your products would be ready to go out of the door
immediately. You would also have plenty of influence over the API, so we
would hopefully end up with something that's a very good fit for your
products.

Expect plenty of change until then though, so resource your project
appropriately ;-)


> Is there a simple demo to show how to use this lib?

See test/test_bindings.c.

> 4) How can I get the API source code? Is there a CVS server or
> something ?

There's just the tarball kicking around for now. The code will drop into the
xen-unstable tree once Xen 3.0.3 is released (within a week or two,
hopefully). I'll go put that tarball on the XenApi wiki page.

Cheers,

Ewan.

_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
Re: Few Questions About Xen management API [ In reply to ]
Hi Ewan:
**
*Thanks so much for your particular explaination ! That's really helpful !*
*And I try the c-bings from the wiki page, but seems that there are lot of
unexpected *
*problems. I konw this is not a stable version API, but can u help me find
what's the reason cause these problems? I just wanna see the snap-shot of
these test_bings. *
*I list the my install steps for investigation.*
*Thanks in advance! *
**
*============*
Softwate Env
*============*

Fedora Core release 5 (Bordeaux)

gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)
libxml2 libxml2-2.6.23-1.2
libxml2-python-2.6.23-1.2
libxml2-devel-2.6.23-1.2
curl curl-devel-7.15.1-1.2.1
curl-7.15.1-1.2.1
xen 3.0.2
*============*
Steps
*============*
*1 make*
*
*there are a lot of *warnnings* and make error
*
-----------------------------------------------------------------------------------------
*
cc -Iinclude -I/usr/include/libxml2 -W -Wall -Werror -std=c99 -O2 -fPIC
-c -o src/xen_common.o src/xen_common.c
cc1: warnings being treated as errors
src/xen_common.c: In function ¡(r)xen_init¡¯:
src/xen_common.c:102: warning: pointer targets in passing argument 1 of
¡(r)xmlXPathCompile¡¯ differ in signedness
src/xen_common.c:105: warning: pointer targets in passing argument 1 of
¡(r)xmlXPathCompile¡¯ differ in signedness
src/xen_common.c: In function ¡(r)call_raw¡¯:
src/xen_common.c:243: warning: pointer targets in passing argument 2 of
¡(r)parse_result¡¯ differ in signedness
src/xen_common.c: In function ¡(r)is_container_node¡¯:
src/xen_common.c:293: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:293: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:293: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:293: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:293: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:293: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c: In function ¡(r)string_from_value¡¯:
src/xen_common.c:308: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:308: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:308: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:308: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:308: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:308: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c: In function ¡(r)string_from_name¡¯:
src/xen_common.c:327: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:327: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:327: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:327: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:327: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:327: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c: In function ¡(r)count_children¡¯:
src/xen_common.c:345: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:345: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:345: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:345: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:345: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:345: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c: In function ¡(r)parse_into¡¯:
src/xen_common.c:386: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:386: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:386: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:386: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:386: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:386: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:506: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:506: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:506: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:506: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:506: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:506: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:523: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:523: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:523: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:523: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:523: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:523: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:547: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:547: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:547: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:547: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:547: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:547: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:598: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:598: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:598: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:598: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:598: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:598: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:619: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:619: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:619: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:619: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:619: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:619: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c: In function ¡(r)parse_structmap_value¡¯:
src/xen_common.c:754: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:754: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:754: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:754: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:754: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:754: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c: In function ¡(r)parse_fault¡¯:
src/xen_common.c:810: warning: pointer targets in passing argument 1 of
¡(r)xen_strdup_¡¯ differ in signedness
src/xen_common.c:811: warning: pointer targets in passing argument 1 of
¡(r)xen_strdup_¡¯ differ in signedness
src/xen_common.c: In function ¡(r)parse_result¡¯:
src/xen_common.c:912: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:912: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:912: warning: pointer targets in passing argument 1 of
¡(r)strlen¡¯ differ in signedness
src/xen_common.c:912: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:912: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
src/xen_common.c:912: warning: pointer targets in passing argument 1 of
¡(r)__builtin_strcmp¡¯ differ in signedness
make: *** [src/xen_common.o] Error 1
*
-----------------------------------------------------------------------------------------
*
2 * Waring*
gcc version cause these waring message
delete -Werror in the Makefile will ignore these warnnings and
compile successfully

3 *cp
* cp hacked-XMLRPCServer.py
/usr/lib/python/xen/xend/server/XMLRPCServer.py
4 *start xend*

5 *test_bindings failed *
**
export LD_LIBRARY_PATH=src
./test/test_bindings localhost:8005/RPC2 root 123456

*
-----------------------------------------------------------------------------------------
*

:5: parser error : Opening and ending tag mismatch: META line 2 and HEAD
</HEAD><BODY>
^
:8: parser error : Specification mandate value for attribute noshade
<HR noshade size="1px">
^
:8: parser error : attributes construct error
<HR noshade size="1px">
^
:8: parser error : Couldn't find end of Start Tag HR line 8
<HR noshade size="1px">
^
:19: parser error : Opening and ending tag mismatch: LI line 15 and UL
</UL>
^
:28: parser error : Opening and ending tag mismatch: LI line 27 and UL
</UL>
^
:32: parser error : Specification mandate value for attribute noshade
<HR noshade size="1px">
^
:32: parser error : attributes construct error
<HR noshade size="1px">
^
:32: parser error : Couldn't find end of Start Tag HR line 32
<HR noshade size="1px">
^
:36: parser error : Opening and ending tag mismatch: BR line 31 and BODY
</BODY></HTML>
^
:36: parser error : Opening and ending tag mismatch: P line 29 and HTML
</BODY></HTML>
^
:37: parser error : Premature end of data in tag LI line 26

^
:37: parser error : Premature end of data in tag LI line 25

^
:37: parser error : Premature end of data in tag LI line 24

^
:37: parser error : Premature end of data in tag UL line 23

^
:37: parser error : Premature end of data in tag P line 21

^
:37: parser error : Premature end of data in tag UL line 14

^
:37: parser error : Premature end of data in tag P line 12

^
:37: parser error : Premature end of data in tag P line 9

^
:37: parser error : Premature end of data in tag BODY line 5

^
:37: parser error : Premature end of data in tag HEAD line 2

^
:37: parser error : Premature end of data in tag HTML line 2

^
Error: 2SERVER_FAULT Couldn't parse the server response

*
-----------------------------------------------------------------------------------------
*
*can you show me which steps I got mistake ? Thanks.*
Re: Few Questions About Xen management API [ In reply to ]
On Sun, Aug 13, 2006 at 07:41:56PM +0800, rickey berkeley wrote:

> Hi Ewan:
>
> Thanks so much for your particular explaination ! That's really helpful !
> And I try the c-bings from the wiki page, but seems that there are lot of
> unexpected
> problems. I konw this is not a stable version API, but can u help me find
> what's the reason cause these problems? I just wanna see the snap-shot of
> these test_bings.
> I list the my install steps for investigation.
> Thanks in advance!
>
> ============
> Softwate Env
> ============
>
> Fedora Core release 5 (Bordeaux)
>
> gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)
> libxml2 libxml2-2.6.23-1.2
> libxml2-python-2.6.23-1.2
> libxml2-devel-2.6.23-1.2
> curl curl-devel-7.15.1-1.2.1
> curl-7.15.1-1.2.1
> xen 3.0.2
> ============
> Steps
> ============
> 1 make
> there are a lot of warnnings and make error

Yes, someone reported these on the list the other day. They don't show up in
my older GCC, but they are bugs, none-the-less, and will be fixed in the next
release. Just compile without the -Werror for now.

> 3 cp
> cp hacked-XMLRPCServer.py
> /usr/lib/python/xen/xend/server/XMLRPCServer.py
> 4 start xend

I forgot to mention that you need to change your /etc/xen/xend-config.sxp, to
have the line

(xend-tcp-xmlrpc-server yes)

if it doesn't already. You'll need to restart xend after changing that.

> 5 test_bindings failed
>
> export LD_LIBRARY_PATH=src
> ./test/test_bindings localhost:8005/RPC2 root 123456
>
> -----------------------------------------------------------------------------------------
>
> :5: parser error : Opening and ending tag mismatch: META line 2 and HEAD
> </HEAD><BODY>

This isn't an XML-RPC response at all, it's HTML. Either you're talking to
the Xend web-server, which normally runs on port 8000, not 8005, so you've
changed xend-port in the config file, or you're picking HTTP proxy settings
from your environment, and your proxy is sending back an error page.

Change back to (xend-port 8000) if you changed that, set
(xend-tcp-xmlrpc-server yes) if you haven't changed that, and try
export http_proxy= to get rid of the proxy settings.

HTH,

Ewan.

_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
Re: Few Questions About Xen management API [ In reply to ]
>
>
> or you're picking HTTP proxy settings
> from your environment, and your proxy is sending back an error page.
>
> Change back to (xend-port 8000) if you changed that, set
> (xend-tcp-xmlrpc-server yes) if you haven't changed that, and try
> export http_proxy= to get rid of the proxy settings.
>
> HTH,
>
> Ewan.
>

this really help ,and right now, it can work on my xen box.
It's very cool ! :D