Skip to content

Commit

Permalink
Send :force flag in Snapshot payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Darby committed Jun 30, 2015
1 parent 9b8e8e6 commit cf79e2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fog/rackspace/models/block_storage/snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Snapshot < Fog::Model
# @return [String] region of the snapshot
attribute :availability_zone

# @!attribute [r] force
# @return [Boolean] `force` creation flag
attribute :force

# Returns true if the snapshot is in a ready state
# @return [Boolean] returns true if snapshot is in a ready state
def ready?
Expand All @@ -59,7 +63,7 @@ def ready?
# @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 http://docs.rackspace.com/cbs/api/v1.0/cbs-devguide/content/POST_createSnapshot__v1__tenant_id__snapshots.html
def save(force = false)
def save
requires :volume_id
raise IdentifierTaken.new('Resaving may cause a duplicate snapshot to be created') if persisted?
data = service.create_snapshot(volume_id, {
Expand Down

0 comments on commit cf79e2a

Please sign in to comment.