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



41
42
43
# File 'lib/fog/ovirt/models/compute/template.rb', line 41

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

#interfacesObject



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

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

#ready?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/fog/ovirt/models/compute/template.rb', line 37

def ready?
  !(status =~ /down/i)
end

#saveObject

Raises:

  • (Fog::Errors::Error)


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

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  service.client.create_template(attributes)
end

#to_sObject



50
51
52
# File 'lib/fog/ovirt/models/compute/template.rb', line 50

def to_s
  name
end

#volumesObject



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

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