Class: ProxmoxRb::ClusterResources

Inherits:
Object
  • Object
show all
Defined in:
lib/proxmox-rb/cluster_resources.rb

Class Method Summary collapse

Class Method Details

.get(ticket) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/proxmox-rb/cluster_resources.rb', line 3

def self.get(ticket)
  http = Net::HTTP.new(ticket.host, '8006')
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  headers = { 'Cookie' => "PVEAuthCookie=#{ticket.ticket}" }
  cluster_resources = http.get('/api2/json/cluster/resources', headers).body
  nodes = JSON.parse( cluster_resources )['data'][1..-1]
end