class Fog::Compute::XenServer::VDI

Public Class Methods

new(attributes = {}) click to toggle source

Default VDI type is system Default size 8GB Sharable is false by default read_only is false by default

Calls superclass method
# 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

Public Instance Methods

destroy() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 88
def destroy
  service.destroy_vdi reference
end
parent() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 66
def parent
  service.vdis.get __parent
end
save() click to toggle source
# 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) click to toggle source
# 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() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 62
def snapshot_of
  service.vdis.get __sr
end
snapshots() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 70
def snapshots
  __snapshots.map do |ref|
    service.vdis.get ref
  end
end
sr() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 96
def sr
  storage_repository
end
storage_repository() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 92
def storage_repository
  service.storage_repositories.get __sr
end
vbds() click to toggle source
# File lib/fog/xenserver/models/compute/vdi.rb, line 76
def vbds
  __vbds.map do |ref|
    service.vbds.get ref
  end
end