Class: Fog::Compute::Packet::Snapshot

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/packet/models/snapshot.rb

Overview

Snapshot

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Snapshot

Returns a new instance of Snapshot.



14
15
16
# File 'lib/fog/compute/packet/models/snapshot.rb', line 14

def initialize(attributes = {})
  super
end

Instance Method Details

#destroy(volume_id) ⇒ Object



24
25
26
27
28
29
# File 'lib/fog/compute/packet/models/snapshot.rb', line 24

def destroy(volume_id)
  requires :id

  response = service.delete_snapshot(volume_id, id)
  true if response.status == 204
end

#saveObject



18
19
20
21
22
# File 'lib/fog/compute/packet/models/snapshot.rb', line 18

def save
  requires :storage_id
  response = service.create_snapshot(storage_id)
  true if response.status == 202
end