Class: Fog::Proxmox::Identity::Pools

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

Overview

class Pools Collection of pools of VMs

Instance Method Summary collapse

Instance Method Details

#allObject



29
30
31
32
33
# File 'lib/fog/proxmox/identity/models/pools.rb', line 29

def all
  pools_with_members = []
  service.list_pools.each { |pool| pools_with_members.push(pool.merge(service.get_pool(pool['poolid']))) }
  load pools_with_members
end

#destroy(id) ⇒ Object



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

def destroy(id)
  pool = get(id)
  pool.destroy
end

#get(id) ⇒ Object



35
36
37
# File 'lib/fog/proxmox/identity/models/pools.rb', line 35

def get(id)
  all.find { |pool| pool.identity == id }
end