Class: Pvectl::Commands::Logs::Handlers::Syslog
- Inherits:
-
Object
- Object
- Pvectl::Commands::Logs::Handlers::Syslog
- Includes:
- ResourceHandler
- Defined in:
- lib/pvectl/commands/logs/handlers/syslog.rb,
sig/pvectl/commands/logs/handlers/syslog.rbs
Overview
Handler for node syslog output.
Fetches syslog entries from a node via Repositories::Syslog. Supports filtering by service name and time range.
Instance Method Summary collapse
-
#initialize(repository: nil) ⇒ Syslog
constructor
A new instance of Syslog.
- #list(node:, limit: 50, since: nil, until_time: nil, service: nil, **_) ⇒ Array[Models::SyslogEntry]
- #presenter ⇒ Presenters::SyslogEntry
- #repository ⇒ Repositories::Syslog
Constructor Details
#initialize(repository: nil) ⇒ Syslog
Returns a new instance of Syslog.
22 23 24 |
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 22 def initialize(repository: nil) @repository = repository end |
Instance Method Details
#list(node:, limit: 50, since: nil, until_time: nil, service: nil, **_) ⇒ Array[Models::SyslogEntry]
26 27 28 29 |
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 26 def list(node:, limit: 50, since: nil, until_time: nil, service: nil, **_) repository.list(node: node, limit: limit, since: since, until_time: until_time, service: service) end |
#presenter ⇒ Presenters::SyslogEntry
31 32 33 |
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 31 def presenter Presenters::SyslogEntry.new end |
#repository ⇒ Repositories::Syslog
37 38 39 40 41 42 43 44 |
# File 'lib/pvectl/commands/logs/handlers/syslog.rb', line 37 def repository @repository ||= begin config_service = Pvectl::Config::Service.new config_service.load connection = Pvectl::Connection.new(config_service.current_config) Repositories::Syslog.new(connection) end end |