Class: Proxmox::Task

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

Defined Under Namespace

Classes: Status

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

#initializeTask

Returns a new instance of Task.



271
272
273
274
# File 'lib/pve/proxmox.rb', line 271

def initialize
  rest_prefix
  @sid = upid
end

Dynamic Method Handling

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

Instance Method Details

#inspectObject



276
277
278
# File 'lib/pve/proxmox.rb', line 276

def inspect
  "#<#{self.class.name} #{@upid}>"
end

#log(start: nil, limit: nil) ⇒ Object



284
285
286
# File 'lib/pve/proxmox.rb', line 284

def log start: nil, limit: nil
  rest_get( "#{@rest_prefix}/log", start: start, limit: limit)
end

#rest_prefixObject



267
268
269
# File 'lib/pve/proxmox.rb', line 267

def rest_prefix
  @rest_prefix = "/nodes/#{@node.node}/tasks/#{upid}"
end

#statusObject



280
281
282
# File 'lib/pve/proxmox.rb', line 280

def status
  Status.fetch node: @node, task: self, upid: @upid
end