mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
added create_snapshot method to Fog::Rackspace::BlockStorage::Volume
This commit is contained in:
parent
140f09472d
commit
21d5892d44
2 changed files with 12 additions and 5 deletions
|
@ -35,6 +35,11 @@ module Fog
|
||||||
connection.snapshots.select { |s| s.volume_id == identity }
|
connection.snapshots.select { |s| s.volume_id == identity }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_snapshot(options={})
|
||||||
|
requires :identity
|
||||||
|
connection.snapshots.create(options.merge(:volume_id => identity))
|
||||||
|
end
|
||||||
|
|
||||||
def save
|
def save
|
||||||
requires :size
|
requires :size
|
||||||
data = connection.create_volume(size, {
|
data = connection.create_volume(size, {
|
||||||
|
|
|
@ -14,13 +14,15 @@ Shindo.tests('Fog::Rackspace::BlockStorage | volume', ['rackspace']) do
|
||||||
end
|
end
|
||||||
|
|
||||||
tests('#snapshots').succeeds do
|
tests('#snapshots').succeeds do
|
||||||
snapshot = service.snapshots.create({ :volume_id => @instance.id })
|
begin
|
||||||
snapshot.wait_for { ready? }
|
snapshot = @instance.create_snapshot
|
||||||
|
snapshot.wait_for(timeout=1200) { ready? }
|
||||||
|
|
||||||
returns(true) { @instance.snapshots.first.id == snapshot.id }
|
returns(true) { @instance.snapshots.first.id == snapshot.id }
|
||||||
|
ensure
|
||||||
snapshot.destroy
|
snapshot.destroy
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@instance.wait_for { snapshots.empty? }
|
@instance.wait_for { snapshots.empty? }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue