Parent

Class/Module Index [+]

Quicksearch

Fog::Rackspace::BlockStorage::Snapshot

Public Instance Methods

destroy() click to toggle source

Destroys snapshot @return [Boolean] returns true if snapshot was deleted @raise [Fog::Rackspace::BlockStorage::NotFound] - HTTP 404 @raise [Fog::Rackspace::BlockStorage::BadRequest] - HTTP 400 @raise [Fog::Rackspace::BlockStorage::InternalServerError] - HTTP 500 @raise [Fog::Rackspace::BlockStorage::ServiceError] @see docs.rackspace.com/cbs/api/v1.0/cbs-devguide/content/DELETE_deleteSnapshot__v1__tenant_id__snapshots.html

# File lib/fog/rackspace/models/block_storage/snapshot.rb, line 81
def destroy
  requires :identity
  service.delete_snapshot(identity)
  true
end
ready?() click to toggle source

Returns true if the snapshot is in a ready state @return [Boolean] returns true if snapshot is in a ready state

# File lib/fog/rackspace/models/block_storage/snapshot.rb, line 47
def ready?
  state == AVAILABLE
end
save(force = false) click to toggle source

Creates the snapshot @param force [Boolean] Set to true to force service to create snapshot @raise [Fog::Rackspace::BlockStorage::IdentifierTaken] if the snapshot has been previously saved. @return [Boolean] returns true if snapshot is being created @raise [Fog::Rackspace::BlockStorage::NotFound] - HTTP 404 @raise [Fog::Rackspace::BlockStorage::BadRequest] - HTTP 400 @raise [Fog::Rackspace::BlockStorage::InternalServerError] - HTTP 500 @raise [Fog::Rackspace::BlockStorage::ServiceError] @note A snapshot object cannot be updated @note All writes to the volume should be flushed before creating the snapshot, either by un-mounting any file systems on the volume or by detaching the volume. @see docs.rackspace.com/cbs/api/v1.0/cbs-devguide/content/POST_createSnapshot__v1__tenant_id__snapshots.html

# File lib/fog/rackspace/models/block_storage/snapshot.rb, line 62
def save(force = false)
  requires :volume_id
  raise IdentifierTaken.new('Resaving may cause a duplicate snapshot to be created') if persisted?
  data = service.create_snapshot(volume_id, {
    :display_name => display_name,
    :display_description => display_description,
    :force => force
  })
  merge_attributes(data.body['snapshot'])
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.