Class: Fog::Proxmox::Compute::Disk
- Inherits:
-
Model
- Object
- Model
- Fog::Proxmox::Compute::Disk
- Defined in:
- lib/fog/proxmox/compute/models/disk.rb
Overview
class Disk model: pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/node/qemu|lxc/vmid/config size is in Gb
Instance Method Summary collapse
- #cdrom? ⇒ Boolean
- #cloud_init? ⇒ Boolean
- #controller ⇒ Object
- #controller? ⇒ Boolean
- #device ⇒ Object
- #flatten ⇒ Object
- #hard_disk? ⇒ Boolean
- #has_volume? ⇒ Boolean
- #mount_point? ⇒ Boolean
- #rootfs? ⇒ Boolean
- #template? ⇒ Boolean
- #to_s ⇒ Object
Instance Method Details
#cdrom? ⇒ Boolean
52 53 54 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 52 def cdrom? id == 'ide2' && media == 'cdrom' end |
#cloud_init? ⇒ Boolean
68 69 70 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 68 def cloud_init? id != 'ide2' && media == 'cdrom' end |
#controller ⇒ Object
44 45 46 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 44 def controller Fog::Proxmox::DiskHelper.extract_controller(id) end |
#controller? ⇒ Boolean
64 65 66 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 64 def controller? Fog::Proxmox::DiskHelper.server_disk?(id) end |
#device ⇒ Object
48 49 50 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 48 def device Fog::Proxmox::DiskHelper.extract_device(id) end |
#flatten ⇒ Object
80 81 82 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 80 def flatten Fog::Proxmox::DiskHelper.flatten(attributes) end |
#hard_disk? ⇒ Boolean
72 73 74 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 72 def hard_disk? controller? && !cdrom? && !cloud_init? end |
#has_volume? ⇒ Boolean
88 89 90 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 88 def has_volume? !volid.empty? end |
#mount_point? ⇒ Boolean
60 61 62 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 60 def mount_point? Fog::Proxmox::DiskHelper.mount_point?(id) end |
#rootfs? ⇒ Boolean
56 57 58 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 56 def rootfs? id == 'rootfs' end |
#template? ⇒ Boolean
76 77 78 |
# File 'lib/fog/proxmox/compute/models/disk.rb', line 76 def template? Fog::Proxmox::DiskHelper.template?(volid) end |