Class: Fog::Compute::XenServer::VDI
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::XenServer::VDI
- Defined in:
- lib/fog/xenserver/models/compute/vdi.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ VDI
constructor
Default VDI type is system Default size 8GB Sharable is false by default read_only is false by default.
- #parent ⇒ Object
- #save ⇒ Object
- #set_attribute(name, *val) ⇒ Object
- #snapshot_of ⇒ Object
- #snapshots ⇒ Object
- #sr ⇒ Object
- #storage_repository ⇒ Object
- #vbds ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ VDI
Default VDI type is system Default size 8GB Sharable is false by default read_only is false by default
49 50 51 52 53 54 55 56 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 49 def initialize(attributes = {}) self.virtual_size ||= '8589934592' unless attributes[:virtual_size] self.type ||= 'system' unless attributes[:type] self.read_only ||= false unless attributes[:read_only] self.sharable ||= false unless attributes[:sharable] self.other_config ||= {} unless attributes[:other_config] super end |
Instance Method Details
#destroy ⇒ Object
88 89 90 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 88 def destroy service.destroy_vdi reference end |
#parent ⇒ Object
66 67 68 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 66 def parent service.vdis.get __parent end |
#save ⇒ Object
82 83 84 85 86 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 82 def save requires :name, :storage_repository ref = service.create_vdi attributes merge_attributes service.vdis.get(ref).attributes end |
#set_attribute(name, *val) ⇒ Object
58 59 60 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 58 def set_attribute(name, *val) data = service.set_attribute( 'VDI', reference, name, *val ) end |
#snapshot_of ⇒ Object
62 63 64 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 62 def snapshot_of service.vdis.get __sr end |
#snapshots ⇒ Object
70 71 72 73 74 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 70 def snapshots __snapshots.map do |ref| service.vdis.get ref end end |
#sr ⇒ Object
96 97 98 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 96 def sr storage_repository end |
#storage_repository ⇒ Object
92 93 94 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 92 def storage_repository service.storage_repositories.get __sr end |
#vbds ⇒ Object
76 77 78 79 80 |
# File 'lib/fog/xenserver/models/compute/vdi.rb', line 76 def vbds __vbds.map do |ref| service.vbds.get ref end end |