Class CloudServers::Image
In: lib/cloudservers/image.rb
Parent: Object

Methods

delete!   new   populate   refresh  

Attributes

created  [R] 
id  [R] 
name  [R] 
progress  [R] 
serverId  [R] 
status  [R] 
updated  [R] 

Public Class methods

This class provides an object for the "Image" of a server. The Image refers to the Operating System type and version.

Returns the Image object identifed by the supplied ID number. Called from the get_image instance method of CloudServers::Connection, it will likely not be called directly from user code.

  >> cs = CloudServers::Connection.new(USERNAME,API_KEY)
  >> image = cs.get_image(2)
  => #<CloudServers::Image:0x1015371c0 ...>
  >> image.name
  => "CentOS 5.2"

Public Instance methods

Delete an image. This should be returning invalid permissions when attempting to delete system images, but it‘s not. Returns true if the deletion succeeds.

  >> image.delete!
  => true

Makes the HTTP call to load information about the provided image. Can also be called directly on the Image object to refresh data. Returns true if the refresh call succeeds.

  >> image.populate
  => true
refresh()

Alias for populate

[Validate]