<div dir="ltr">2013/6/5 wlbleaboy@126 <span dir="ltr"><<a href="mailto:wlbleaboy@126.com" target="_blank">wlbleaboy@126.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div link="blue" vlink="purple" lang="ZH-CN">
<div>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">Hi, Jarod. W:<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"> I got your demo, and a build libcurl, but I can’t get
any info<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">from https://{ovirt-engine }/api .<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">my code like this:</span></p></div></div></blockquote><div>Please try to run the below command:<br>
--<br>curl <a href="https://YOURIP/api">https://YOURIP/api</a> -u YOURNAME:YOURPASSWD --cacert /root/ca.crt<br>--<br></div><div>After, please parse the result.<br><br></div><div>ps, I run the program on centos 6.4, and it works.<br>
<br></div><div>thanks.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div link="blue" vlink="purple" lang="ZH-CN"><div><p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"><u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">int
main(void)<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">{<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
CURL *curl;<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
CURLcode res;<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl = curl_easy_init();<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
if (curl)<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
{<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
printf("enter....\n");<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl_easy_setopt(curl, CURLOPT_URL, "<b><a href="https://192.168.1.201/api" target="_blank">https://192.168.1.201/api</a></b>");<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback_func);<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl_easy_setopt(curl, CURLOPT_USERPWD, "<b>admin@internal:111111</b>");<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl_easy_setopt(curl, CURLOPT_CAINFO,"<b>/tmp/ca.crt</b>");<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl_easy_perform(curl);<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
printf("exit.....\n");<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
curl_easy_cleanup(curl);<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
}<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">
return 0;<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">}<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">And
when I run it, just outpu :<u></u><u></u></span></p>
<p class=""><b><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">enter....<u></u><u></u></span></b></p>
<p class=""><b><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">exit.....<u></u><u></u></span></b></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">I
got the libcurl from <a href="http://curl.haxx.se/download.html%20and%20chosed%20curl-7.30.0.tar.gz" target="_blank">http://curl.haxx.se/download.html
and chosed curl-7.30.0.tar.gz</a><u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">and
I use make and make install without any other options . I just guess maybe it
need<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"" lang="EN-US">other
SSL library supported, but I don’t know how and which .<u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"><u></u> <u></u></span></p>
<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) -moz-use-text-color -moz-use-text-color;padding:3pt 0cm 0cm">
<p class=""></p><div class="im"><b><span style="font-size:10pt">发件人<span lang="EN-US">:</span></span></b><span style="font-size:10pt" lang="EN-US"> Jarod. w [mailto:<a href="mailto:work.iec23801@gmail.com" target="_blank">work.iec23801@gmail.com</a>] <br>
</span></div><b><span style="font-size:10pt">发送时间<span lang="EN-US">:</span></span></b><span style="font-size:10pt" lang="EN-US"> 2013</span><span style="font-size:10pt">年<span lang="EN-US">6</span>月<span lang="EN-US">4</span>日<span lang="EN-US"> 18:14<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> wlbleaboy@126<br>
</span><b>抄送<span lang="EN-US">:</span></b><span lang="EN-US">
<a href="mailto:engine-devel@ovirt.org" target="_blank">engine-devel@ovirt.org</a><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: </span>答复<span lang="EN-US">: [Engine-devel] ovirt-engine-sdk with C<u></u><u></u></span></span><p></p>
</div><div><div class="h5">
<p class=""><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<p class=""><span lang="EN-US">2013/6/4 wlbleaboy@126 <<a href="mailto:wlbleaboy@126.com" target="_blank">wlbleaboy@126.com</a>><u></u><u></u></span></p>
<div>
<div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class=""><span style="font-size:10pt" lang="EN-US">Hi, Jarod. W:</span><span lang="EN-US"><u></u><u></u></span></p>
<p class=""><span style="font-size:10pt" lang="EN-US"> Yes, I just want to </span><span lang="EN-US">use c to invoke ovirt engine RestAPI,<u></u><u></u></span></p>
<p class=""><span lang="EN-US">Just get vm</span>’<span lang="EN-US">s id, host, port, secur-port,
and ticket,<u></u><u></u></span></p>
<p class=""><span lang="EN-US"> How can I use libcurl to connect https, could
give me<u></u><u></u></span></p>
<p class=""><span lang="EN-US">a simple demo to connect <a href="https://%7bovirt-engine%7d/api" target="_blank">https://{ovirt-engine}/api</a> with <u></u><u></u></span></p>
<p class=""><span lang="EN-US">--cafile, the ca.crt I get from <a href="http://%7bovirt-engine%7d/ca.crt" target="_blank">http://{ovirt-engine}/ca.crt</a><u></u><u></u></span></p>
</div>
</div>
</blockquote>
<div>
<p class=""><span lang="EN-US">Please download the demo from the above
url:<br>
<a href="https://github.com/jarod-w/hglibraries/blob/master/demo/restapi.c" target="_blank">https://github.com/jarod-w/hglibraries/blob/master/demo/restapi.c</a><br>
<u></u><u></u></span></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class=""><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0cm 0cm;border-color:-moz-use-text-color">
<p class=""><b><span style="font-size:10pt">发件人<span lang="EN-US">:</span></span></b><span style="font-size:10pt" lang="EN-US"> Jarod. w [mailto:<a href="mailto:work.iec23801@gmail.com" target="_blank">work.iec23801@gmail.com</a>]
<br>
</span><b><span style="font-size:10pt">发送时间<span lang="EN-US">:</span></span></b><span style="font-size:10pt" lang="EN-US"> 2013</span><span style="font-size:10pt">年<span lang="EN-US">5</span>月<span lang="EN-US">14</span>日<span lang="EN-US"> 10:27<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> leaboy@126<br>
</span><b>抄送<span lang="EN-US">:</span></b><span lang="EN-US"> <a href="mailto:engine-devel@ovirt.org" target="_blank">engine-devel@ovirt.org</a><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: [Engine-devel]
ovirt-engine-sdk with C</span></span><span lang="EN-US"><u></u><u></u></span></p>
</div>
<div>
<div>
<p class=""><span lang="EN-US"> <u></u><u></u></span></p>
<div>
<p class=""><span lang="EN-US">2013/5/13 leaboy@126 <<a href="mailto:wlbleaboy@126.com" target="_blank">wlbleaboy@126.com</a>><u></u><u></u></span></p>
<div>
<div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204,204,204)">
<div>
<div>
<p class=""><span lang="EN-US">Hi</span>,<span lang="EN-US">All<u></u><u></u></span></p>
<p class=""><span lang="EN-US"> I felt
oivrt-engine-sdk coded with Python is slowly to connect<u></u><u></u></span></p>
<p class=""><span lang="EN-US">ovirt-engine and console vm when a user have many vms, So, I just<u></u><u></u></span></p>
<p class=""><span lang="EN-US">want to rewrite the sdk with C(ANSI C Language). Just rewrite a sdk<u></u><u></u></span></p>
<p class=""><span lang="EN-US">with C to connect overt-engine and console vm, would anyone give <u></u><u></u></span></p>
<p class=""><span lang="EN-US">me some suggestion.<u></u><u></u></span></p>
</div>
</div>
</blockquote>
<div>
<p class=""><span lang="EN-US">Do you want to use c to invoke ovirt engine RestAPI, right?<u></u><u></u></span></p>
</div>
<div>
<p class="" style="margin-bottom:12pt"><span lang="EN-US">If yes, you can use libcurl to do the thing, and it'll make you
happy.<u></u><u></u></span></p>
</div>
<div>
<p class=""><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204,204,204)">
<div>
<div>
<p class=""><span lang="EN-US"> <u></u><u></u></span></p>
<p class=""><span lang="EN-US"> Now, the problem is
how can I connect to ovit-engine with C, and<u></u><u></u></span></p>
<p class=""><span lang="EN-US">how can I get some information of vms, and how ovirrt-engine can <u></u><u></u></span></p>
<p class=""><span lang="EN-US">respond my action(start,stop, .eg)<u></u><u></u></span></p>
</div>
</div>
</blockquote>
<p class=""><span lang="EN-US">Agree with Michael Pasternak.<u></u><u></u></span></p>
</div>
<div>
<p class=""><span lang="EN-US">You should parse your code into the mail list, or someone can't help<u></u><u></u></span></p>
</div>
<div>
<p class=""><span lang="EN-US">you.<u></u><u></u></span></p>
</div>
<div>
<div>
<p class=""><span lang="EN-US"> <u></u><u></u></span></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204,204,204)">
<div>
<div>
<p class=""><span lang="EN-US"> <u></u><u></u></span></p>
<p class=""><span lang="EN-US">
Leaboy@beijing<u></u><u></u></span></p>
<p class=""><span lang="EN-US">
Thinks<u></u><u></u></span></p>
</div>
</div>
<p class="" style="margin-bottom:12pt"><span lang="EN-US"><br>
_______________________________________________<br>
Engine-devel mailing list<br>
<a href="mailto:Engine-devel@ovirt.org" target="_blank">Engine-devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/engine-devel" target="_blank">http://lists.ovirt.org/mailman/listinfo/engine-devel</a><u></u><u></u></span></p>
</blockquote>
</div>
<p class=""><span lang="EN-US"><br>
<br clear="all">
<br>
-- <br>
---<br>
Best Regards<br>
Jarod.W<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class=""><span lang="EN-US"><br>
<br clear="all">
<br>
-- <br>
---<br>
Best Regards<br>
Jarod.W<u></u><u></u></span></p>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>---<br>Best Regards<br>Jarod.W<br>
</div></div>