Hi,<div><br></div><div>The problem is that the info method returns an OpenNebula error when it fails. You should change the return statement to:</div><div><br></div><div><meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">--8<------</span></div>
<div>rc = <a href="http://vm_pool.info/" target="_blank">vm_pool.info</a>()</div><div><br></div><div>if OpenNebula.is_error?(rc)</div><div> return rc.message</div><div>else</div><div> return rc</div><div>end<br><meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">------>8--</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">I have updated the documentation script [1], if you want to check it.</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Hope this helps.</span></div>
<div><br></div><div>[1] <a href="http://www.opennebula.org/documentation:rel2.0:ruby">http://www.opennebula.org/documentation:rel2.0:ruby</a></div><div><br><div class="gmail_quote">On 29 November 2010 08:49, KING LABS <span dir="ltr"><<a href="http://kinglabs.in">kinglabs.in</a>@<a href="http://gmail.com">gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have installed ruby oca gem and tried using it with given example script at <a href="http://www.opennebula.org/documentation:rel2.0:ruby" target="_blank">http://www.opennebula.org/documentation:rel2.0:ruby</a> , script executes with out any results, it doesnt give me any error even when the user credentials given wrong.<br>
<br>also i tried with little modified script based on example script is as follows which is giving a error<br><br>--------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>#!/usr/bin/env ruby<br> <br>##############################################################################<br># Required libraries<br>##############################################################################<br>
require 'rubygems'<br>
require 'oca'<br> <br>include OpenNebula<br> <br># OpenNebula credentials<br><br>CREDENTIALS = "oneadmin:7bc8559a8fe509e680562b85c337f170956fcb06"<br><br># XML_RPC endpoint where OpenNebula is listening<br>
<br>ENDPOINT = "<a href="http://192.168.138.230:2633/RPC2" target="_blank">http://192.168.138.230:2633/RPC2</a>"<br> <br>client = Client.new(CREDENTIALS, ENDPOINT)<br> <br>vm_pool = VirtualMachinePool.new(client, -1)<br>
<br>
puts <a href="http://vm_pool.info" target="_blank">vm_pool.info</a>()<br><br>-------------------------------------------------------------------------------------------------------------------------<br><br>Output:<br><br>
king@king-desktop:~$ ruby opennebula_ruby_api.rb <br>
#<OpenNebula::Error:0x00000002050a80><br>king@king-desktop:~$ <br><br><br>Few working examples are welcomed.<br><br>Regards.<br>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Daniel Molina, Cloud Technology Engineer/Researcher<br>DSA Research Group: web <a href="http://dsa-research.org" target="_blank">http://dsa-research.org</a> and blog <a href="http://blog.dsa-research.org" target="_blank">http://blog.dsa-research.org</a><br>
OpenNebula Open Source Toolkit for Cloud Computing: <a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a><br>
</div>