Class: Fog::OpenStack::Volume::Backup
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::OpenStack::Volume::Backup
show all
- Defined in:
- lib/fog/openstack/volume/models/backup.rb
Instance Attribute Summary
Attributes inherited from Model
#project
Instance Method Summary
collapse
Methods inherited from Model
#initialize, #save, #update
Instance Method Details
#create ⇒ Object
20
21
22
23
24
25
|
# File 'lib/fog/openstack/volume/models/backup.rb', line 20
def create
requires :name, :volume_id
data = service.create_backup(attributes)
merge_attributes(data.body['backup'])
true
end
|
#destroy ⇒ Object
27
28
29
30
31
|
# File 'lib/fog/openstack/volume/models/backup.rb', line 27
def destroy
requires :id
service.delete_backup(id)
true
end
|
#restore(volume_id = nil, name = nil) ⇒ Object
33
34
35
36
37
|
# File 'lib/fog/openstack/volume/models/backup.rb', line 33
def restore(volume_id = nil, name = nil)
requires :id
service.restore_backup(id, volume_id, name)
true
end
|
#volume ⇒ Object
39
40
41
42
|
# File 'lib/fog/openstack/volume/models/backup.rb', line 39
def volume
requires :id
service.get_volume_details(volume_id).body['volume']
end
|