Class: Fog::Volume::OpenStack::Backup

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/volume/openstack/models/backup.rb

Direct Known Subclasses

V1::Backup, V2::Backup

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save, #update

Constructor Details

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

Instance Method Details

#createObject


20
21
22
23
24
25
# File 'lib/fog/volume/openstack/models/backup.rb', line 20

def create
  requires :name, :volume_id
  data = service.create_backup(attributes)
  merge_attributes(data.body['backup'])
  true
end

#destroyObject


27
28
29
30
31
# File 'lib/fog/volume/openstack/models/backup.rb', line 27

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

#restore(volume_id) ⇒ Object


33
34
35
36
37
# File 'lib/fog/volume/openstack/models/backup.rb', line 33

def restore(volume_id)
  requires :id
  service.restore_backup(id, volume_id)
  true
end

#volumeObject


39
40
41
42
# File 'lib/fog/volume/openstack/models/backup.rb', line 39

def volume
  requires :id
  service.get_volume_details(volume_id).body['volume']
end