Class: ForemanFogProxmox::NodeDashboard::Data
- Inherits:
-
Object
- Object
- ForemanFogProxmox::NodeDashboard::Data
- Defined in:
- app/services/foreman_fog_proxmox/node_dashboard/data.rb
Instance Method Summary collapse
-
#initialize(filter = '') ⇒ Data
constructor
A new instance of Data.
- #node ⇒ Object
- #node_id ⇒ Object
- #statistics ⇒ Object
Constructor Details
#initialize(filter = '') ⇒ Data
Returns a new instance of Data.
23 24 25 |
# File 'app/services/foreman_fog_proxmox/node_dashboard/data.rb', line 23 def initialize(filter = '') @filter = filter end |
Instance Method Details
#node ⇒ Object
27 28 29 30 |
# File 'app/services/foreman_fog_proxmox/node_dashboard/data.rb', line 27 def node @compute_resource = ComputeResource.where(type: 'ForemanFogProxmox::Proxmox').first @compute_resource.nodes.first end |
#node_id ⇒ Object
32 33 34 |
# File 'app/services/foreman_fog_proxmox/node_dashboard/data.rb', line 32 def node_id node&.identity end |
#statistics ⇒ Object
36 37 38 |
# File 'app/services/foreman_fog_proxmox/node_dashboard/data.rb', line 36 def statistics node.statistics('rrddata', timeframe: 'hour', cf: 'AVERAGE') if node_id end |