1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/google/helpers/disk_helper.rb
Ferran Rodenas 0a9884adfd [google|compute] Improve Disks support
- Add missing "Disk" properties
- Remove unnecessary property aliases
- Use "Operation" instead of the "backoff_if_unfound" method when
  inserting a "Disk" or "Snapshot"
- When destroying a "Disk" asyncronous return the "Operation" model instead
  of the raw operation response
- Add "list_aggregatted_disks" request
- If zone is not set on "all" and "get" methods, use the list aggregated
  disks request (1 API call) instead of fetching all zones
- Fix a bug when inserting a snapshot (description was not merged at the
  body request)
- Fix tests
2014-04-20 21:42:46 -07:00

12 lines
298 B
Ruby

# create a disk to be used in tests
def create_test_disk(connection, zone)
zone = 'us-central1-a'
disk = connection.disks.create({
:name => "fogservername",
:size_gb => "2",
:zone => zone,
:source_image => "debian-7-wheezy-v20140408",
})
disk.wait_for { ready? }
disk
end