Class: Fog::Compute::Proxmox::Disks

Inherits:
Proxmox::Collection show all
Defined in:
lib/fog/compute/proxmox/models/disks.rb

Overview

class Disks Collection of disk

Instance Attribute Summary

Attributes inherited from Proxmox::Collection

#response

Instance Method Summary collapse

Methods inherited from Proxmox::Collection

#clear_ignored_attributes, #create, #destroy, #find_by_id, #load_response, #not_implemented, #read, #summary

Instance Method Details

#all(_options = {}) ⇒ Object


30
31
32
# File 'lib/fog/compute/proxmox/models/disks.rb', line 30

def all(_options = {})
  self
end

#cdromObject


43
44
45
# File 'lib/fog/compute/proxmox/models/disks.rb', line 43

def cdrom
  find(&:cdrom?)
end

#get(id) ⇒ Object


34
35
36
37
# File 'lib/fog/compute/proxmox/models/disks.rb', line 34

def get(id)
  cached_disk = find { |disk| disk.id == id }
  return cached_disk if cached_disk
end

#next_device(controller) ⇒ Object


39
40
41
# File 'lib/fog/compute/proxmox/models/disks.rb', line 39

def next_device(controller)
  Fog::Proxmox::ControllerHelper.last_index(controller, self) + 1
end

#rootfsObject


47
48
49
# File 'lib/fog/compute/proxmox/models/disks.rb', line 47

def rootfs
  find(&:rootfs?)
end