Class: Fog::Compute::Ovirt::Template

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rawObject

Returns the value of attribute raw.



7
8
9
# File 'lib/fog/ovirt/models/compute/template.rb', line 7

def raw
  @raw
end

Instance Method Details

#destroy(_options = {}) ⇒ Object



43
44
45
# File 'lib/fog/ovirt/models/compute/template.rb', line 43

def destroy(_options = {})
  service.client.destroy_template(id)
end

#interfacesObject



25
26
27
28
29
30
# File 'lib/fog/ovirt/models/compute/template.rb', line 25

def interfaces
  attributes[:interfaces] ||= id.nil? ? [] : Fog::Compute::Ovirt::Interfaces.new(
    :service => service,
    :vm => self
  )
end

#ready?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/fog/ovirt/models/compute/template.rb', line 39

def ready?
  status !~ /down/i
end

#saveObject



47
48
49
50
# File 'lib/fog/ovirt/models/compute/template.rb', line 47

def save
  raise ::Fog::Ovirt::Errors::OvirtError, "Providing an existing object may create a duplicate object" if persisted?
  service.client.create_template(attributes)
end

#to_sObject



52
53
54
# File 'lib/fog/ovirt/models/compute/template.rb', line 52

def to_s
  name
end

#volumesObject



32
33
34
35
36
37
# File 'lib/fog/ovirt/models/compute/template.rb', line 32

def volumes
  attributes[:volumes] ||= id.nil? ? [] : Fog::Compute::Ovirt::Volumes.new(
    :service => service,
    :vm => self
  )
end