[one-users] Using Ruby API with OCA gem

KING LABS kinglabs.in at gmail.com
Sun Nov 28 23:49:27 PST 2010


I have installed ruby oca gem and tried using it with given example script
at http://www.opennebula.org/documentation:rel2.0:ruby , script executes
with out any results, it doesnt give me any error even when the user
credentials given wrong.

also i tried with little modified script based on example script is as
follows which is giving a error

--------------------------------------------------------------------------------------------------------------------------------------------------

#!/usr/bin/env ruby

##############################################################################
# Required libraries
##############################################################################
require 'rubygems'
require 'oca'

include OpenNebula

# OpenNebula credentials

CREDENTIALS = "oneadmin:7bc8559a8fe509e680562b85c337f170956fcb06"

# XML_RPC endpoint where OpenNebula is listening

ENDPOINT    = "http://192.168.138.230:2633/RPC2"

client = Client.new(CREDENTIALS, ENDPOINT)

vm_pool = VirtualMachinePool.new(client, -1)

puts vm_pool.info()

-------------------------------------------------------------------------------------------------------------------------

Output:

king at king-desktop:~$ ruby opennebula_ruby_api.rb
#<OpenNebula::Error:0x00000002050a80>
king at king-desktop:~$


Few working examples are welcomed.

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20101129/83a35f12/attachment.htm>


More information about the Users mailing list