Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::RackspaceV2::Image

Public Class Methods

new(attributes={}) click to toggle source
# File lib/fog/rackspace/models/compute_v2/image.rb, line 66
def initialize(attributes={})
  @service = attributes[:service]
  super
end

Public Instance Methods

destroy() click to toggle source

Destroy image @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404 @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400 @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500 @raise [Fog::Compute::RackspaceV2::ServiceError]

# File lib/fog/rackspace/models/compute_v2/image.rb, line 111
def destroy
  requires :identity
  service.delete_image(identity)
end
metadata() click to toggle source

Image metadata @return [Fog::Compute::RackspaceV2::Metadata] Collection of Fog::Compute::RackspaceV2::Metadatum objects containing metadata key value pairs.

# File lib/fog/rackspace/models/compute_v2/image.rb, line 73
def metadata
  @metadata ||= begin
    Fog::Compute::RackspaceV2::Metadata.new({
      :service => service,
      :parent => self
    })
  end
end
metadata=(hash={}) click to toggle source

Set server metadata @param [Hash] hash contains key value pairs

# File lib/fog/rackspace/models/compute_v2/image.rb, line 84
def metadata=(hash={})
  metadata.from_hash(hash)
end
ready?(ready_state = ACTIVE, error_states=[ERROR]) click to toggle source

Is image is in ready state @param [String] ready_state By default state is ACTIVE @param [Array,String] error_states By default state is ERROR @return [Boolean] returns true if server is in a ready state @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404 @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400 @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500 @raise [Fog::Compute::RackspaceV2::ServiceError] @raise [Fog::Compute::RackspaceV2::InvalidImageStateException] if server state is an error state

# File lib/fog/rackspace/models/compute_v2/image.rb, line 97
def ready?(ready_state = ACTIVE, error_states=[ERROR])
  if error_states
    error_states = Array(error_states)
    raise InvalidImageStateException.new(ready_state, state) if error_states.include?(state)
  end
  state == ready_state
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.