linotp.controllers.reporting module¶
reporting controller - interfaces for Reporting
- class linotp.controllers.reporting.ReportingController(name, install_name='', **kwargs)¶
Bases:
BaseController
reporting
- delete_all()¶
POST /reporting/delete_all
- method:
reporting/delete_all
- description:
delete entries from the reporting database table
- Parameters
realms – takes realms, only the reporting entries from this realm are deleted
status – (optional) filters reporting entries by status like ‘assigned’ or ‘inactive’
returns: dict in which value is the number of deleted rows
- Raises
Exception – if an error occurs an exception is serialized and returned
- delete_before()¶
POST /reporting/delete_before
delete all entries from reporting database with respect to the arguments
Note
date must be given in format: ‘yyyy-mm-dd’
- Parameters
date – (optional) only delete entries which are older than date; date must be given in format ‘yyyy-mm-dd’ . if no date is given, all entries get deleted
realms – (optional) takes realms, only the reporting entries from this realm are deleted
status – (optional) filters reporting entries by status like ‘assigned’ or ‘inactive’
- Returns
dict in which value is the number of deleted rows
- Raises
Exception – if an error occurs an exception is serialized and returned
- maximum()¶
GET, POST /reporting/maximum
Deprecated since version 3.2: Requests using HTTP POST method (because it is only reading data). This endpoint will only be available via HTTP GET method in the future.
return the maximum of tokens in a given realm with given status
- Parameters
realms – (required) takes realms, only the reporting entries for this realms will be displayed
status – (optional) (default is ‘active’) takes assigned/unassigned/active/ etc. and shows max of lines in database with this characteristic
- Returns
a json result with: { “head”: [], “data”: [ [row1], [row2] .. ] }
- Raises
Exception – if an error occurs an exception is serialized and returned
- period()¶
GET, POST /reporting/period
Deprecated since version 3.2: Requests using HTTP POST method (because it is only reading data). This endpoint will only be available via HTTP GET method in the future.
return the maximum of tokens in a given realm with given status for a given period
- Parameters
realms – (required) takes realms, only the reporting entries for this realms will be displayed
status – (optional) (default is ‘active’) takes assigned/unassigned/active/ etc. and shows max of lines in database with this characteristic
from – (optional) (default is 1970-1-1) the start day for the reporting max lookup
to – (optional) (default is tomorrow 0:0:0) the end day for the reporting max lookup
- Returns
a json result with: { “status”: “true”, “value”: {
realms: [ {}, {}], period: {
’from’: ‘to’:
}
} with a realm entry {} as: { ‘realm’: ‘realmname’, ‘tokencount’: {
’active’: nn,
}
}
- Raises
Exception – if an error occurs an exception is serialized and returned
- show()¶
GET, POST /reporting/show
Deprecated since version 3.2: Requests using HTTP POST method (because it is only reading data). This endpoint will only be available via HTTP GET method in the future.
show entries from the reporting database table
- Parameters
date – (optional) only show entries which are newer than date; date must be given in format ‘yyyy-mm-dd’ if no date is given, all entries are shown
realms – (optional) takes realms, only the reporting entries from this realm are shown
status – (optional) filters reporting entries by status like ‘assigned’ or ‘inactive’
sortby – (optional) sort the output by column
sortdir – (optional) asc/desc
page – (optional) request a certain page
pagesize – (optional) limit the number of returned tokens
outform – (optional) if set to “csv”, the output will be a .csv file
- Returns
a json result with: { “head”: [], “data”: [ [row1] , [row2] , [row3] .. ] }
in case of csv: first line: header of columns other lines: column values
- Raises
Exception – if an error occurs an exception is serialized and returned