Class: Pvectl::Repositories::Syslog

Inherits:
Base
  • Object
show all
Defined in:
lib/pvectl/repositories/syslog.rb,
sig/pvectl/repositories/syslog.rbs

Overview

Repository for reading node syslog. Uses GET /nodes/node/syslog endpoint.

Instance Attribute Summary

Attributes inherited from Base

#connection

Instance Method Summary collapse

Methods inherited from Base

#build_model, #extract_data, #get, #initialize, #models_from, #unwrap

Constructor Details

This class inherits a constructor from Pvectl::Repositories::Base

Instance Method Details

#list(node:, limit: 50, since: nil, until_time: nil, service: nil) ⇒ Array<Models::SyslogEntry>

Parameters:

  • node name (required)

  • (defaults to: 50)

    max entries (default 50)

  • (defaults to: nil)

    start timestamp

  • (defaults to: nil)

    end timestamp

  • (defaults to: nil)

    filter by service name

  • (defaults to: 50)
  • (defaults to: nil)
  • (defaults to: nil)
  • (defaults to: nil)

Returns:



14
15
16
17
18
19
20
21
22
# File 'lib/pvectl/repositories/syslog.rb', line 14

def list(node:, limit: 50, since: nil, until_time: nil, service: nil)
  params = { limit: limit }
  params[:since] = since if since
  params[:until] = until_time if until_time
  params[:service] = service if service

  response = connection.client["nodes/#{node}/syslog"].get(params: params)
  models_from(response, Models::SyslogEntry)
end