Template information with Ruby API


I’mdeveloping an app which, among others, has to create a template whose data is the same as another one but changing some fields. Thus I want to get the xml description of the template, change the fields and create the new template.

The problem is that the information which the method “template_xml” from OpenNebula::XMLElement retrieves is an XML which doesn’t contain all the information of the template (as an example, the name lacks). On the other hand, the command “onetemplate show -x id” retrieves all the information of the template.

Any ideas? Thank you very much.

Best regards

To get the same information as show -x use template.to_xml.

Thank you very much, it works :slight_smile: