class OpenStack::Nova::Compute::Image
Attributes¶ ↑
-
name
- Name of this image -
tenant_id
- Tenant id to which this image belongs to (if applicable) -
server_id
-Server
id to which this image belongs to (if applicable) -
user_id
- User id to which this image belongs to (if applicable) -
status
- Status of image (e.g. ACTIVE) -
progress
- Progress of image -
min_disk
- Minimal amount of storage needed by this image (GBytes) -
min_ram
- Minimal amount of RAM needed by this image (MBytes) -
updated_at
- Modification date -
created_at
- Creation date
Public Class Methods
find_all_by_name(name)
click to toggle source
Public Instance Methods
image_type()
click to toggle source
Returns the type of image: image or snapshot
# File lib/open_stack/nova/compute/image.rb, line 91 def image_type metadata.image_type rescue NoMethodError 'image' end
server()
click to toggle source
Returns the Server
instance to which this image belongs to (if applicable)
# File lib/open_stack/nova/compute/image.rb, line 86 def server Server.find(server_id) if server_id.present? end
snapshot?()
click to toggle source
True if this image is a snapshot
# File lib/open_stack/nova/compute/image.rb, line 98 def snapshot? image_type != 'image' end
Protected Instance Methods
initialize(attributes = {}, persisted = false)
click to toggle source
Calls superclass method
# File lib/open_stack/nova/compute/image.rb, line 49 def initialize(attributes = {}, persisted = false) # :notnew: attributes = attributes.with_indifferent_access new_attributes = { :id => attributes[:id], :name => attributes[:name], :min_ram => attributes[:minRam], :min_disk => attributes[:minDisk], :progress => attributes[:progress], :status => attributes[:status], :metadata => attributes[:metadata], :user_id => attributes[:user_id], :tenant_id => attributes[:tenant_id], :server_id => attributes[:server].present? ? attributes[:server][:id] : nil, :updated_at => attributes[:updated].present? ? DateTime.strptime(attributes[:updated], OpenStack::DATETIME_FORMAT) : nil, :created_at => attributes[:created].present? ? DateTime.strptime(attributes[:created], OpenStack::DATETIME_FORMAT) : nil } super(new_attributes, persisted) end