linotp.lib.reporting module

class linotp.lib.reporting.ReportingIterator(page=None, psize=None, sort=None, sortdir=None, realms=None, status=None, date=None)[source]

Bases: object

support a smooth iterating through lines in reporting table

getResultSetInfo()[source]
iterate_reports()[source]
linotp.lib.reporting.delete(realms, status, date=None)[source]

delete all rows in reporting database before a given date, filtered by realm and status

Parameters:
  • realms – the ralm to filter
  • status – the status to filter
  • date (string in format: 'yyyy-mm-dd') – (optional) day until which all rows will be deleted
Returns:

number of deleted rows

linotp.lib.reporting.get_max(realm, status='active')[source]
get the maximum number of tokens (with given status) in a realm in the whole
reporting database; if no status is given, ‘active’ is default
Parameters:
  • realm – (required) the realm in which we are searching
  • status – (default: ‘active’) the status that the tokens have defaukt is active as this is relevant for license
Returns:

maximum number of reported tokens with given status in realm

linotp.lib.reporting.token_reporting(event, tokenrealms)[source]

log token events into reporting table

Parameters:
  • event – the event that happened, e.g. init token, delete token
  • tokenrealms – the realm on which the event happened
Returns:

nothing