[one-users] How to create a new template using Ruby OCA API

Hector Sanjuan hsanjuan at opennebula.org
Wed Jan 18 01:27:10 PST 2012


Hi,

it could be something like

require 'OpenNebula'
include 'OpenNebula'

(...)

template = Template.new(Template.build_xml(), at client)
template.allocate(template_str)

where template_str is the contents of the template file containing the vm  
definition. You can read them from file yourself.with File.read().

Hope it helps,

Hector

En Wed, 18 Jan 2012 09:53:14 +0100, Tommy Aditya Lawanto  
<tommy at wowrack.com> escribió:

> Hi All,
>
>
> I read guide about adding a new template on  
> http://opennebula.org/documentation:rel3.2:vm_guide, which need a file  
> containing the vm definition.
>
> However, when i get to the Ruby OCA API on  
> http://opennebula.org/doc/3.0/oca/ruby/. I cannot find any method for  
> creating a new template which read from file. Could someone explain to  
> me how can i create a new template using Ruby OCA API?
>
>
> Any help is much appreaciated, as i completely new to Ruby and Open  
> Nebula.
>
>
> Best Regard,
>
>
> Tommy


-- 
Hector Sanjuan
OpenNebula Developer



More information about the Users mailing list