Class: Fog::OpenStack::SharedFileSystem::Snapshots

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/openstack/shared_file_system/models/snapshots.rb

Instance Attribute Summary

Attributes inherited from Collection

#response

Instance Method Summary collapse

Methods inherited from Collection

#load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/shared_file_system/models/snapshots.rb', line 10

def all(options = {})
  load_response(service.list_snapshots_detail(options), 'snapshots')
end

#destroy(id) ⇒ Object



21
22
23
24
# File 'lib/fog/openstack/shared_file_system/models/snapshots.rb', line 21

def destroy(id)
  snapshot = find_by_id(id)
  snapshot.destroy
end

#find_by_id(id) ⇒ Object Also known as: get



14
15
16
17
# File 'lib/fog/openstack/shared_file_system/models/snapshots.rb', line 14

def find_by_id(id)
  snapshot_hash = service.get_snapshot(id).body['snapshot']
  new(snapshot_hash.merge(:service => service))
end