Configuration hints |
Database setup:
. /app/ckan/default/bin/activate
ckan datavic_reporting initdb –config=/app/ckan/default/production.ini
Creates two tables: report_schedule (config) and report (instances)
Configuration:
Configure scheduled report frequencies on /ckan-admin/config page
Comma-separated list of frequencies
ckan.datavic_reporting.scheduled_reports_path = /app/filestore/reports
Create scheduled report job:
. /app/ckan/default/bin/activate
ckan datavic_reporting createjob {frequency} –config=/app/ckan/default/production.ini
Replace {frequency} with ‘monthly’ or ‘yearly’
Reports saved to: {path}/org_id/{yyyy}/{mm}/general_report_{timestamp}.csv
API Endpoints:
POST /api/action/report_schedule_create - params: report_type, org_id, sub_org_ids, frequency, user_roles, emails
POST /api/action/report_schedule_update - params: id + create params
GET /api/action/report_schedule_delete - params: id
GET /api/action/report_schedule_list - params: state (active|deleted)
GET /api/action/reports_list - params: id (report_schedule.id)
|