Class: Pvectl::Commands::Logs::Handlers::TaskDetail

Inherits:
Object
  • Object
show all
Includes:
ResourceHandler
Defined in:
lib/pvectl/commands/logs/handlers/task_detail.rb,
sig/pvectl/commands/logs/handlers/task_detail.rbs

Overview

Handler for task log drill-down by UPID.

Fetches individual task log lines from the Proxmox API. Extracts the node name from the UPID for API routing.

Examples:

Using via registry

handler = Logs::ResourceRegistry.for("task")
lines = handler.list(upid: "UPID:pve1:000ABC:...")

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(repository: nil) ⇒ TaskDetail



22
23
24
# File 'lib/pvectl/commands/logs/handlers/task_detail.rb', line 22

def initialize(repository: nil)
  @repository = repository
end

Instance Method Details

#list(upid:, start: 0, limit: 512, **_) ⇒ Array[Models::TaskLogLine]



26
27
28
# File 'lib/pvectl/commands/logs/handlers/task_detail.rb', line 26

def list(upid:, start: 0, limit: 512, **_)
  repository.list(upid: upid, start: start, limit: limit)
end

#presenterPresenters::TaskLogLine



30
31
32
# File 'lib/pvectl/commands/logs/handlers/task_detail.rb', line 30

def presenter
  Presenters::TaskLogLine.new
end

#repositoryRepositories::TaskLog



36
37
38
39
40
41
42
43
# File 'lib/pvectl/commands/logs/handlers/task_detail.rb', line 36

def repository
  @repository ||= begin
    config_service = Pvectl::Config::Service.new
    config_service.load
    connection = Pvectl::Connection.new(config_service.current_config)
    Repositories::TaskLog.new(connection)
  end
end