class Fog::Proxmox::Network::Node

class Node model of VMs

Public Class Methods

new(new_attributes = {}) click to toggle source
Calls superclass method
# File lib/fog/proxmox/network/models/node.rb, line 50
def initialize(new_attributes = {})
  prepare_service_value(new_attributes)
  attributes[:node] = new_attributes['node'] unless new_attributes['node'].nil?
  attributes[:node] = new_attributes[:node] unless new_attributes[:node].nil?
  requires :node
  initialize_networks
  super(new_attributes)
end

Public Instance Methods

power(action) click to toggle source
# File lib/fog/proxmox/network/models/node.rb, line 59
def power(action)
  action_known = %w[reboot shutdown].include? action
  message = "Action #{action} not implemented"
  raise Fog::Errors::Error, message unless action_known
  service.power_node({ node: node }, command: action)
end

Private Instance Methods

initialize_networks() click to toggle source
# File lib/fog/proxmox/network/models/node.rb, line 68
def initialize_networks
  attributes[:networks] = Fog::Proxmox::Network::Networks.new(service: service, node_id: node)
end