Class: Fog::OpenStack::Compute::Snapshot

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

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#create, #initialize, #update

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#destroyObject



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

def destroy
  requires :id
  service.delete_snapshot(id)
  true
end

#save(force = false) ⇒ Object



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

def save(force = false)
  requires :volume_id, :name, :description
  data = service.create_snapshot(volume_id, name, description, force)
  merge_attributes(data.body['snapshot'])
  true
end