Class: Fog::Proxmox::Network::Network
- Inherits:
-
Model
- Object
- Model
- Fog::Proxmox::Network::Network
- 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
#destroy ⇒ Object
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( = {}) requires :node_id path_params = { node: node_id } body_params = .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( = {}) requires :node_id, :iface, :type path_params = { node: node_id, iface: iface } body_params = .merge(type: type) service.update_network(path_params, body_params) end |