Class: Dcmgr::Models::InstanceSpec
Constant Summary
Constants inherited
from BaseNew
BaseNew::LOCK_TABLES_KEY
Instance Method Summary
collapse
#account
Methods inherited from BaseNew
Proxy, dataset, default_row_lock_mode=, install_data, install_data_hooks, lock!, unlock!, #with_timestamps?
Instance Method Details
#before_validate ⇒ Object
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/dcmgr/models/instance_spec.rb', line 34
def before_validate
default_config =
case self.hypervisor
when HostPool::HYPERVISOR_KVM
{:block_driver=>'virtio', :nic_driver=>'virtio'}
end
self.config = default_config.merge(self.config || {})
super
end
|
#to_api_document ⇒ Object
51
52
53
54
55
|
# File 'lib/dcmgr/models/instance_spec.rb', line 51
def to_api_document
doc = to_hash
doc.delete(:config)
doc
end
|
#to_hash ⇒ Object
45
46
47
48
49
|
# File 'lib/dcmgr/models/instance_spec.rb', line 45
def to_hash
super.merge({:config=>self.config, :storage => self.storage, })
end
|