Class: Fog::Proxmox::Network::Node
- Inherits:
-
Model
- Object
- Model
- Fog::Proxmox::Network::Node
- Defined in:
- lib/fog/network/proxmox/models/node.rb
Overview
class Node model of VMs
Instance Method Summary collapse
-
#initialize(new_attributes = {}) ⇒ Node
constructor
A new instance of Node.
- #power(action) ⇒ Object
Constructor Details
#initialize(new_attributes = {}) ⇒ Node
Returns a new instance of Node.
50 51 52 53 54 55 56 57 |
# File 'lib/fog/network/proxmox/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 |
Instance Method Details
#power(action) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/fog/network/proxmox/models/node.rb', line 59 def power(action) action_known = %w[reboot shutdown].include? action = "Action #{action} not implemented" raise Fog::Errors::Error, unless action_known service.power_node({ node: node }, command: action) end |