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

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

Overview

class Network model

Constant Summary collapse

TYPES =
%w[bridge bond eth alias vlan OVSBridge OVSBond OVSPort OVSIntPort any_bridge].freeze

Instance Method Summary collapse

Instance Method Details

#destroyObject



68
69
70
71
72
# File 'lib/fog/network/proxmox/models/network.rb', line 68

def destroy
  requires :node_id, :iface
  path_params = { node: node_id, iface: iface }
  service.delete_network(path_params)
end

#save(options = {}) ⇒ Object



54
55
56
57
58
59
# File 'lib/fog/network/proxmox/models/network.rb', line 54

def save(options = {})
  requires :node_id
  path_params = { node: node_id }
  body_params = options.merge(attributes.reject { |attribute| [:node_id].include? attribute })
  service.create_network(path_params, body_params)
end

#update(options = {}) ⇒ Object



61
62
63
64
65
66
# File 'lib/fog/network/proxmox/models/network.rb', line 61

def update(options = {})
  requires :node_id, :iface, :type
  path_params = { node: node_id, iface: iface }
  body_params = options.merge(type: type)
  service.update_network(path_params, body_params)
end