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

Inherits:
Proxmox::Model show all
Defined in:
lib/fog/network/proxmox/models/node.rb

Overview

class Node model of VMs

Instance Method Summary collapse

Methods inherited from Proxmox::Model

#create, #destroy, #initialize, #inspect, #update

Constructor Details

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

Instance Method Details

#networksObject


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

def networks
  @networks ||= Fog::Network::Proxmox::Networks.new(service: service,
                                                    node: self)
end

#power(action) ⇒ Object

Raises:

  • (Fog::Errors::Error)

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

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

#to_sObject


52
53
54
# File 'lib/fog/network/proxmox/models/node.rb', line 52

def to_s
  node
end