mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[cloudstack] add list_snapshots request mock
This commit is contained in:
parent
6e2bc6d6c3
commit
e85f6688b1
1 changed files with 21 additions and 0 deletions
|
@ -15,6 +15,27 @@ module Fog
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def list_snapshots(options={})
|
||||
snapshot_id = options.delete('id')
|
||||
if snapshot_id
|
||||
snapshots = [self.data[:snapshots][snapshot_id]]
|
||||
else
|
||||
snapshots = self.data[:snapshots].values
|
||||
end
|
||||
|
||||
{
|
||||
'listsnapshotsresponse' => {
|
||||
'count' => snapshots.size,
|
||||
'snapshot' => snapshots
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue