Class: Proxmox::Storage

Inherits:
Base
  • Object
show all
Defined in:
lib/pve/proxmox.rb

Defined Under Namespace

Classes: Content

Instance Attribute Summary

Attributes inherited from Base

#sid

Instance Method Summary collapse

Methods inherited from Base

__new__, fetch, #method_missing, #refresh!, #respond_to?

Methods included from RestConnection

#bench, #rest_del, #rest_get, #rest_post, #rest_put

Constructor Details

#initializeStorage

Returns a new instance of Storage.



671
# File 'lib/pve/proxmox.rb', line 671

def initialize() rest_prefix end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Proxmox::Base

Instance Method Details

#contentObject



665
666
667
668
669
# File 'lib/pve/proxmox.rb', line 665

def content
  rest_get( "#{@rest_prefix}/content").map do |c|
    Content.send :__new__, c.merge( node: @node, storage: self, t: 'smc')
  end
end

#rest_prefixObject



661
662
663
# File 'lib/pve/proxmox.rb', line 661

def rest_prefix
  @rest_prefix ||= "/nodes/#{@node.node}/storage/#{@storage}"
end

#to_sObject



673
# File 'lib/pve/proxmox.rb', line 673

def to_s() "#{@node.node}:#{@storage}" end