Class: Fog::Proxmox::Compute::Disk

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/proxmox/models/disk.rb

Overview

class Disk model

Instance Method Summary collapse

Instance Method Details

#cdrom?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/fog/compute/proxmox/models/disk.rb', line 50

def cdrom?
  id == 'ide2' && media == 'cdrom'
end

#controllerObject



42
43
44
# File 'lib/fog/compute/proxmox/models/disk.rb', line 42

def controller
  Fog::Proxmox::DiskHelper.extract_controller(id)
end

#controller?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/fog/compute/proxmox/models/disk.rb', line 62

def controller?
  id.match(/(scsi|ide|sata|virtio)(\d+)/)
end

#deviceObject



46
47
48
# File 'lib/fog/compute/proxmox/models/disk.rb', line 46

def device
  Fog::Proxmox::DiskHelper.extract_device(id)
end

#flattenObject



66
67
68
# File 'lib/fog/compute/proxmox/models/disk.rb', line 66

def flatten
  Fog::Proxmox::DiskHelper.flatten(attributes)
end

#mount_point?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/fog/compute/proxmox/models/disk.rb', line 58

def mount_point?
  id.match(/(mp)(\d+)/)
end

#rootfs?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/fog/compute/proxmox/models/disk.rb', line 54

def rootfs?
  id == 'rootfs'
end

#to_sObject



70
71
72
# File 'lib/fog/compute/proxmox/models/disk.rb', line 70

def to_s
  Fog::Proxmox::Hash.flatten(flatten)
end