2013-08-12 14:27:22 -04:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Google
|
|
|
|
|
|
|
|
class Snapshot < Fog::Model
|
|
|
|
|
|
|
|
identity :name
|
|
|
|
|
|
|
|
attribute :kind
|
|
|
|
attribute :self_link , :aliases => 'selfLink'
|
|
|
|
attribute :creation_timestamp, :aliases => 'creationTimestamp'
|
|
|
|
attribute :disk_size_gb , :aliases => 'diskSizeGb'
|
|
|
|
attribute :source_disk , :aliases => 'sourceDisk'
|
|
|
|
attribute :source_disk_id , :aliases => 'sourceDiskId'
|
|
|
|
attribute :description
|
2013-08-14 21:47:06 -04:00
|
|
|
attribute :status
|
2013-08-12 14:27:22 -04:00
|
|
|
|
|
|
|
def reload
|
|
|
|
requires :name
|
|
|
|
|
|
|
|
data = service.get_snapshot(name, self.service.project).body
|
|
|
|
|
|
|
|
self.merge_attributes(data)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def resource_url
|
2013-08-13 16:53:01 -04:00
|
|
|
"#{self.service.project}/global/snapshots/#{name}"
|
2013-08-12 14:27:22 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|