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

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

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Attribute Details

#rawObject

Returns the value of attribute raw.



9
10
11
# File 'lib/fog/ovirt/models/compute/template.rb', line 9

def raw
  @raw
end

Instance Method Details

#destroy(options = {}) ⇒ Object



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

def destroy(options = {})
  connection.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(
      :connection => connection,
      :vm => self
  )
end

#ready?Boolean

Returns:

  • (Boolean)


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

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

#saveObject

Raises:



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

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

#to_sObject



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

def to_s
  name
end