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.



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

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



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

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



657
658
659
# File 'lib/pve/proxmox.rb', line 657

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

#to_sObject



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

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