Sha256: 24e1f11cd46e0b55f5aedfebe4fee9c8bdd6ea0393b6980b4495fd9313bdeab5

Contents?: true

Size: 1.05 KB

Versions: 34

Compression:

Stored size: 1.05 KB

Contents

module OVIRT
  class Client
    def templates(opts={})
      path = "/templates"
      path += search_url(opts) unless filtered_api
      http_get(path).xpath('/templates/template').collect do |t|
        OVIRT::Template::new(self, t)
      end.compact
    end

    def template(template_id, opts={})
      results = http_get("/templates/%s" % template_id)
      template = OVIRT::Template::new(self, results.root)
      template
    end

    def create_template(opts)
      template = http_post("/templates", Template.to_xml(opts))
      OVIRT::Template::new(self, template.root)
    end

    def destroy_template(id)
      http_delete("/templates/%s" % id)
    end

    def template_interfaces template_id
      http_get("/templates/%s/nics" % template_id, http_headers).xpath('/nics/nic').collect do |nic|
        OVIRT::Interface::new(self, nic)
      end
    end

    def template_volumes template_id
      http_get("/templates/%s/disks" % template_id, http_headers).xpath('/disks/disk').collect do |disk|
        OVIRT::Volume::new(self, disk)
      end
    end
  end
end

Version data entries

34 entries across 32 versions & 2 rubygems

Version Path
rbovirt-0.1.7 lib/client/template_api.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/rbovirt-0.1.6/lib/client/template_api.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rbovirt-0.1.6/lib/client/template_api.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/rbovirt-0.1.6/lib/client/template_api.rb
rbovirt-0.1.6 lib/client/template_api.rb
rbovirt-0.1.5 lib/client/template_api.rb
rbovirt-0.1.4 lib/client/template_api.rb
rbovirt-0.1.3 lib/client/template_api.rb
rbovirt-0.1.2 lib/client/template_api.rb
rbovirt-0.0.38 lib/client/template_api.rb
rbovirt-0.1.1 lib/client/template_api.rb
rbovirt-0.0.37 lib/client/template_api.rb
rbovirt-0.0.36 lib/client/template_api.rb
rbovirt-0.1.0 lib/client/template_api.rb
rbovirt-0.0.35 lib/client/template_api.rb
rbovirt-0.0.34 lib/client/template_api.rb
rbovirt-0.0.33 lib/client/template_api.rb
rbovirt-0.0.32 lib/client/template_api.rb
rbovirt-0.0.31 lib/client/template_api.rb
rbovirt-0.0.30 lib/client/template_api.rb