Class: Fog::Proxmox::Compute::Storages

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

Overview

class Storages Collection of storages

Instance Method Summary collapse

Instance Method Details

#all(filters = {}) ⇒ Object



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

def all(filters = {})
  requires :node_id
  load service.list_storages(node_id, filters)
end

#get(id) ⇒ Object



44
45
46
47
# File 'lib/fog/compute/proxmox/models/storages.rb', line 44

def get(id)
  requires :node_id
  all.find { |storage| storage.identity === id }
end

#list_by_content_type(content) ⇒ Object



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

def list_by_content_type(content)
  requires :node_id
  all.select { |storage| storage.content.include? content }
end

#new(new_attributes = {}) ⇒ Object



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

def new(new_attributes = {})
  super({ node_id: node_id }.merge(new_attributes))
end