Class: Dcmgr::Models::VolumeSnapshot
Constant Summary
collapse
- STATE_TYPE_REGISTERING =
"registering"
- STATE_TYPE_CREATING =
"creating"
- STATE_TYPE_AVAILABLE =
"available"
- STATE_TYPE_FAILED =
"failed"
- STATE_TYPE_DELETING =
"deleting"
- STATE_TYPE_DELETED =
"deleted"
Constants inherited
from BaseNew
BaseNew::LOCK_TABLES_KEY
Instance Method Summary
collapse
#account
Methods inherited from BaseNew
Proxy, dataset, install_data, install_data_hooks, lock!, unlock!
Instance Method Details
#create_volume(account_id) ⇒ Object
create volume inherite from this snapshot for the account. limitation: inherit volume is created on same storage_pool.
34
35
36
|
# File 'lib/dcmgr/models/volume_snapshot.rb', line 34
def create_volume(account_id)
storage_pool.create_volume(account_id, self.size, self.canonical_uuid)
end
|
#delete_snapshot ⇒ Object
42
43
44
45
|
# File 'lib/dcmgr/models/volume_snapshot.rb', line 42
def delete_snapshot
self.state = STATE_TYPE_DELETING
self.save_changes
end
|
#origin_volume ⇒ Object
38
39
40
|
# File 'lib/dcmgr/models/volume_snapshot.rb', line 38
def origin_volume
Volume[origin_volume_id]
end
|
#to_hash_document ⇒ Object
26
27
28
29
30
|
# File 'lib/dcmgr/models/volume_snapshot.rb', line 26
def to_hash_document
h = self.values.dup
h[:id] = h[:uuid] = self.canonical_uuid
h
end
|