Class: Fog::Compute::HP::Image

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#architectureObject (readonly)

Returns the value of attribute architecture.



23
24
25
# File 'lib/fog/hp/models/compute/image.rb', line 23

def architecture
  @architecture
end

#image_typeObject (readonly)

Returns the value of attribute image_type.



22
23
24
# File 'lib/fog/hp/models/compute/image.rb', line 22

def image_type
  @image_type
end

#min_diskObject (readonly)

these values are extracted from metadata



20
21
22
# File 'lib/fog/hp/models/compute/image.rb', line 20

def min_disk
  @min_disk
end

#min_ramObject (readonly)

Returns the value of attribute min_ram.



21
22
23
# File 'lib/fog/hp/models/compute/image.rb', line 21

def min_ram
  @min_ram
end

Instance Method Details

#destroyObject



60
61
62
63
64
# File 'lib/fog/hp/models/compute/image.rb', line 60

def destroy
  requires :id
  service.delete_image(id)
  true
end

#metadataObject



25
26
27
28
29
30
31
32
# File 'lib/fog/hp/models/compute/image.rb', line 25

def 
  @metadata ||= begin
    Fog::Compute::HP::Metadata.new({
      :service => service,
      :parent => self
    })
  end
end

#metadata=(new_metadata = {}) ⇒ Object



34
35
36
37
38
# File 'lib/fog/hp/models/compute/image.rb', line 34

def metadata=(={})
  metas = []
  .each_pair {|k,v| metas << {"key" => k, "value" => v} }
  .load(metas)
end

#ready?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/fog/hp/models/compute/image.rb', line 66

def ready?
  status == 'ACTIVE'
end