Class: Fog::HP::BlockStorageV2::Snapshot
- Inherits:
-
Model
- Object
- Model
- Fog::HP::BlockStorageV2::Snapshot
- Defined in:
- lib/fog/hp/models/block_storage_v2/snapshot.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #force=(new_force) ⇒ Object
-
#initialize(attributes = {}) ⇒ Snapshot
constructor
A new instance of Snapshot.
- #ready? ⇒ Boolean
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Snapshot
Returns a new instance of Snapshot.
17 18 19 20 21 |
# File 'lib/fog/hp/models/block_storage_v2/snapshot.rb', line 17 def initialize(attributes = {}) # assign these attributes first to prevent race condition with persisted? self.force = attributes.delete(:force) # force snapshotting of attached volumes super end |
Instance Method Details
#destroy ⇒ Object
23 24 25 26 27 |
# File 'lib/fog/hp/models/block_storage_v2/snapshot.rb', line 23 def destroy requires :id service.delete_snapshot(id) true end |
#force=(new_force) ⇒ Object
29 30 31 |
# File 'lib/fog/hp/models/block_storage_v2/snapshot.rb', line 29 def force=(new_force) @force = new_force end |
#ready? ⇒ Boolean
33 34 35 |
# File 'lib/fog/hp/models/block_storage_v2/snapshot.rb', line 33 def ready? self.status == 'available' end |
#save ⇒ Object
37 38 39 |
# File 'lib/fog/hp/models/block_storage_v2/snapshot.rb', line 37 def save identity ? update : create end |