Class: Fog::Proxmox::Compute::Node

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/proxmox/models/node.rb

Overview

class Node model of VMs

Instance Method Summary collapse

Constructor Details

#initialize(new_attributes = {}) ⇒ Node

Returns a new instance of Node.



52
53
54
55
56
57
58
59
60
61
# File 'lib/fog/compute/proxmox/models/node.rb', line 52

def initialize(new_attributes = {})
  prepare_service_value(new_attributes)
  Fog::Proxmox::Attributes.set_attr_and_sym('node', attributes, new_attributes)
  requires :node
  initialize_tasks
  initialize_servers
  initialize_containers
  initialize_storages
  super(new_attributes)
end

Instance Method Details

#backup(options = {}) ⇒ Object



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

def backup(options = {})
  task_upid = service.backup({ node: node }, options)
  task_upid
end

#statistics(output = 'rrddata', options = { timeframe: 'hour', cf: 'AVERAGE'}) ⇒ Object



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

def statistics(output = 'rrddata', options = { timeframe: 'hour', cf: 'AVERAGE'})
  path_params = { node: node, output: output }
  query_params = options
  service.get_node_statistics(path_params,query_params)
end