Class: Fog::Kubevirt::Compute::Template

Inherits:
Model
  • Object
show all
Includes:
Shared
Defined in:
lib/fog/kubevirt/compute/models/template.rb

Constant Summary

Constants included from Shared

Shared::OS_LABEL, Shared::OS_LABEL_SYMBOL

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Shared

#deep_merge!, #object_to_hash

Class Method Details

.parse(object) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fog/kubevirt/compute/models/template.rb', line 28

def self.parse(object)
   = object[:metadata]
  annotations = [:annotations]
  {
    :namespace        => [:namespace],
    :annotations      => [:annotations],
    :name             => [:name],
    :labels           => [:labels],
    :resource_version => [:resourceVersion],
    :uid              => [:uid],
    :objects          => object[:objects],
    :parameters       => object[:parameters],
    :description      => annotations && annotations[:description],
    :tags             => annotations && annotations[:tags]
  }
end

Instance Method Details

#clone(options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/fog/kubevirt/compute/models/template.rb', line 18

def clone(options = {})
  params = values(options)

  # use persistent volume claims if any from a template and send
  create_persistent_volume_claims(persistent_volume_claims_from_objects(objects), params, namespace)

  # use vm definition from a template and send
  create_vm(vm_from_objects(objects), params, namespace)
end