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

Inherits:
Proxmox::Model 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

Methods inherited from Proxmox::Model

#initialize, #inspect

Constructor Details

This class inherits a constructor from Fog::Proxmox::Model

Instance Method Details

#create(attributes = {}) ⇒ Object


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

def create(attributes = {})
  requires :node
  path_params = { node: node }
  body_params = attributes
  service.create_network(path_params, body_params)
end

#destroyObject


74
75
76
77
78
# File 'lib/fog/network/proxmox/models/network.rb', line 74

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

#to_sObject


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

def to_s
  identity
end

#update(attributes = {}) ⇒ Object


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

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