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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::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/compute/openstack/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/compute/openstack/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