Class: Fog::OpenStack::SharedFileSystem::Snapshot
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::OpenStack::SharedFileSystem::Snapshot
show all
- Defined in:
- lib/fog/openstack/shared_file_system/models/snapshot.rb
Instance Attribute Summary
Attributes inherited from Model
#project
Instance Method Summary
collapse
Methods inherited from Model
#create, #initialize
Instance Method Details
#destroy ⇒ Object
33
34
35
36
37
|
# File 'lib/fog/openstack/shared_file_system/models/snapshot.rb', line 33
def destroy
requires :id
service.delete_snapshot(id)
true
end
|
#ready? ⇒ Boolean
39
40
41
|
# File 'lib/fog/openstack/shared_file_system/models/snapshot.rb', line 39
def ready?
status == 'available'
end
|
#save ⇒ Object
20
21
22
23
24
25
|
# File 'lib/fog/openstack/shared_file_system/models/snapshot.rb', line 20
def save
raise Fog::Errors::Error, 'Resaving an existing object may create a duplicate' if persisted?
requires :share_id
merge_attributes(service.create_snapshot(share_id, attributes).body['snapshot'])
true
end
|
#update(options = nil) ⇒ Object
27
28
29
30
31
|
# File 'lib/fog/openstack/shared_file_system/models/snapshot.rb', line 27
def update(options = nil)
requires :id
merge_attributes(service.update_snapshot(id, options || attributes).body['snapshot'])
self
end
|