Class: Fog::Proxmox::Network::Networks

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

Overview

class Networks Collection of nodes of cluster

Instance Method Summary collapse

Instance Method Details

#all(filters = {}) ⇒ Object



35
36
37
38
39
40
# File 'lib/fog/network/proxmox/models/networks.rb', line 35

def all(filters = {})
  requires :node_id
  path_params = { node: node_id }
  query_params = filters
  load service.list_networks(path_params, query_params)
end

#get(id) ⇒ Object



42
43
44
# File 'lib/fog/network/proxmox/models/networks.rb', line 42

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

#new(attributes = {}) ⇒ Object



30
31
32
33
# File 'lib/fog/network/proxmox/models/networks.rb', line 30

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