mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[google|compute] allow user to set disk description
This commit is contained in:
parent
fef4d12e20
commit
3834726134
1 changed files with 6 additions and 0 deletions
|
@ -25,11 +25,17 @@ module Fog
|
|||
requires :zone_name
|
||||
|
||||
options = {}
|
||||
my_description = "Created with fog"
|
||||
if !source_image.nil?
|
||||
my_description = "Created from image: #{source_image}"
|
||||
end
|
||||
if source_image.nil? && !source_snapshot.nil?
|
||||
options['sourceSnapshot'] = source_snapshot
|
||||
my_description = "Created from snapshot: #{source_snapshot}"
|
||||
end
|
||||
|
||||
options['sizeGb'] = size_gb
|
||||
options['description'] = description || my_description
|
||||
|
||||
data = service.insert_disk(name, zone_name, source_image, options).body
|
||||
data = service.backoff_if_unfound {service.get_disk(name, zone_name).body}
|
||||
|
|
Loading…
Reference in a new issue