Skip to content

Commit 5c70486

Browse files
Merge pull request killbill#630 from reshmabidikar/analytics-doc-changes
Analytics documentation update
2 parents 462c13e + 2879eab commit 5c70486

16 files changed

+110
-31
lines changed

userguide/analytics/userguide_analytics.adoc

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,16 @@ The analytics plugin supports three types of reports as explained below:
159159
[[installing_canned_reports]]
160160
=== Installing Canned Reports
161161
162-
As explained earlier, we provide a set of canned reports that can be useful as a starting point. On non-Windows machines, these can be installed by running the https://github.com/killbill/killbill-analytics-plugin/blob/59c282f97960dc59b944ca33e17353bc19d7c842/src/main/resources/seed_reports.sh[seed_reports.sh] script. On Windows machines, you can install a report by opening the desired report sub-directory from the https://github.com/killbill/killbill-analytics-plugin/tree/master/src/main/resources/reports[reports] directory and creating the _view_, _stored procedure_ and _report_ as explained in the next section.
162+
As explained earlier, we provide a set of canned reports that can be useful as a starting point. These reports are present in the https://github.com/killbill/killbill-analytics-plugin/tree/master/reports[reports] directory. The https://github.com/killbill/killbill-analytics-plugin/tree/master/reports/README.md#report_creation[README] provides further details and instructions on creating the reports.
163163
164-
[NOTE]
165-
*Note:* The default views will use the converted amount columns when applicable, which require the `analytics_currency_conversion` table to be populated with currency conversion rates as explained in the <<currency_conversion, "Currency Conversion">> section. If you are only using one currency, use the non-converted columns instead (`next_mrr` instead of `converted_next_mrr` for example).
164+
In addition, we also provide a https://github.com/killbill/killbill-analytics-plugin/tree/master/reports/reports_setup.sh[reports_setup.sh] script that installs all these reports. This script can be installed as follows:
165+
166+
[source, bash]
167+
----
168+
./setup_reports.sh
169+
----
170+
171+
The https://github.com/killbill/killbill-analytics-plugin/blob/master/reports/README.md#report-script[README] provides further details about this script.
166172
167173
[[create_custom_reports]]
168174
=== Creating Custom Reports
@@ -347,9 +353,9 @@ The following table lists all the report creation options. A subset of these opt
347353
|refreshHourOfDayGmt |Hour of the day when the procedure will be executed.
348354
|===
349355
350-
=== Other Report Operations
356+
=== Report APIs
351357
352-
Once a report is created, you can perform several operations on it as explained below.
358+
The Analytics plugin provides some APIs that can be used to perform report CRUD operations.
353359
354360
==== Retrieve Report Configuration
355361
@@ -365,6 +371,28 @@ curl -u admin:password \
365371
366372
This returns the report configuration (`reportName`, `reportPrettyName`, etc. fields) for the `new_accounts_per_day` report.
367373
374+
==== Create a Report
375+
376+
You can create a report as follows:
377+
378+
[source,bash]
379+
----
380+
curl -v \
381+
-X POST \
382+
-u admin:password \
383+
-H "X-Killbill-ApiKey:bob" \
384+
-H "X-Killbill-ApiSecret:lazar" \
385+
-H 'Content-Type: application/json' \
386+
-d '{"reportName": "new_accounts_per_day",
387+
"reportPrettyName": "New accounts created (per day)",
388+
"sourceTableName": "new_accounts_per_day",
389+
"refreshProcedureName": "refresh_new_accounts_per_day",
390+
"refreshFrequency": "HOURLY"}' \
391+
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
392+
----
393+
394+
This creates a report called `new_accounts_per_day`.
395+
368396
==== Update a Report
369397
370398
You can update a report (edit all fields except `reportName`):
143 KB
Loading
148 KB
Loading
88.3 KB
Loading
201 KB
Loading
76.4 KB
Loading
199 KB
Loading
229 KB
Loading
229 KB
Loading
124 KB
Loading

0 commit comments

Comments
 (0)