class OVIRT::Template

Attributes

cluster[R]
creation_time[R]
description[R]
display[R]
memory[R]
os[R]
profile[R]
status[R]
storage[R]

Public Class Methods

new(client, xml) click to toggle source
# File lib/ovirt/template.rb, line 5
def initialize(client, xml)
  super(client, xml[:id], xml[:href], (xml/'name').first.text)
  parse_xml_attributes!(xml)
  self
end
to_xml(opts={}) click to toggle source
# File lib/ovirt/template.rb, line 11
def self.to_xml(opts={})
  builder = Nokogiri::XML::Builder.new do
    template_ {
      name_ opts[:name] || "t-#{Time.now.to_i}"
      description opts[:description] || ''
      vm(:id => opts[:vm])
    }
  end
  Nokogiri::XML(builder.to_xml).root.to_s
end

Public Instance Methods

interfaces() click to toggle source
# File lib/ovirt/template.rb, line 22
def interfaces
  @interfaces ||= @client.template_interfaces(id)
end
volumes() click to toggle source
# File lib/ovirt/template.rb, line 26
def volumes
  @volumes ||= @client.send(:volumes, "/templates/%s/disks" % id)
end