diff --git a/html5/_main_toc.html.slim b/html5/_main_toc.html.slim index b717263ce..dca03ea7a 100644 --- a/html5/_main_toc.html.slim +++ b/html5/_main_toc.html.slim @@ -104,6 +104,19 @@ nav.sidebar-nav li a.nav-link href="/latest/errors-sentry.html" | Error Tracking with Sentry + li + .icon-title + a.bd-toc-link.main-link role="button" Aviate + + + + ul.nav.navbar-nav + li.bd-sidenav-active + a.nav-link href="/latest/aviate-catalog-plugin.html" + | Aviate Catalog Plugin + li.bd-sidenav-active + a.nav-link href="/latest/how-to-install-the-aviate-plugin.html" + | Aviate Plugin Installation li .icon-title a.bd-toc-link.main-link role="button" Manuals diff --git a/userguide/aviate/aviate-catalog-plugin.adoc b/userguide/aviate/aviate-catalog-plugin.adoc new file mode 100644 index 000000000..0f7a27f58 --- /dev/null +++ b/userguide/aviate/aviate-catalog-plugin.adoc @@ -0,0 +1,65 @@ += Aviate Catalog Plugin + +include::{sourcedir}/aviate/includes/aviate-card.adoc[] + +== Introduction + +The Aviate plugin can be used as a catalog plugin. The Aviate catalog plugin serves as an alternative to the XML catalog managed within Kill Bill core. It provides APIs that operate at the plan/product/pricelist level, offering greater flexibility and granularity compared to the catalog version level. These APIs enable users to create individual catalog entries such as plans, products, and pricelists without the need to manage entire catalog versions. The catalog data created through the plugin is stored in tables managed by the Aviate plugin. + +When the Aviate catalog plugin features are enabled, the catalog served by the plugin takes priority over any _existing catalog entries_ created from regular KB catalog APIs (`/1.0/kb/catalog`) documented https://apidocs.killbill.io/catalog#upload-a-catalog-as-xml[here]. + +== Getting Started with the Aviate Catalog Plugin + +This section provides a step-by-step approach to get started with the Aviate Catalog plugin. + +=== Installing the Plugin + +The Aviate plugin can be installed as documented in the https://docs.killbill.io/latest/how-to-install-the-aviate-plugin.html[How to Install the Aviate Plugin] doc. + +=== Enabling Catalog APIs + +To use the catalog API capabilities provided by the Aviate plugin, ensure that KB is started with the following properties: + +[source,bash] +---- +com.killbill.billing.plugin.aviate.enableCatalogApis=true +---- + +=== Using Catalog Plugin APIs + +Once the plugin is installed and enabled, you can start using the Catalog Plugin APIs. As mentioned earlier, the Aviate catalog plugin exposes endpoints that operate at a plan/product/pricelist level. These endpoints allow plan/product/pricelist creation/modification and deletion. At the time of writing, only plan-level endpoints are supported. The catalog API endpoints are documented in our https://apidocs.killbill.io/aviate-catalog-apis[slate docs]. + +== Catalog Versioning + +Since the Kill Bill system internally manages catalog versions, the plugin will construct such multi-version catalog based on the entries that need to be returned. + +Each plan stored within the Aviate catalog plugn has an associated `effectiveDate`. The catalog versions and what they each include is based on the `plan#effectiveDate`: A new version will be created every time there is a set of changes associated with an existing Plan (e.g. price change). When this happens, a new version is created, which also includes all the previous Plans. + +Assuming we have the following plans, Pa, Pb, Pc, and we create those at different times and modify those to allow for price changes, we get the following: + +[source,bash] +---- +* T1: Create Pa -> 1 catalog version v1={Pa} +* T2: Create Pb -> 1 catalog version v1={Pa, Pb} +* T3: Modify Pa -> 2 catalog versions v1={Pa, Pb}, v2={Pa', Pb} // Pa' with the new price +* T4: Create Pc -> 2 catalog versions v1={Pa, Pb}, v2={Pa', Pb, Pc} // Pa' with the new price +* T5: Modify Pb -> 3 catalog versions v1={Pa, Pb}, v2={Pa', Pb, Pc}, v3={Pa', Pb', Pc} // Pa' and Pb' with the new price +... +---- + +== FAQ + +*Is it possible to use the KB catalog APIs when the Aviate catalog plugin is enabled?* + +When the Aviate catalog plugin is enabled, the catalog state is managed by the Aviate plugin. So, while it is possible to use the `GET` https://apidocs.killbill.io/catalog[KB Catalog APIs] for catalog retrieval, it is not possible to use the upload/delete https://apidocs.killbill.io/catalog[KB Catalog APIs] endpoints. + +*Is it possible to use the KB price overrides feature when the Aviate catalog plugin is enabled?* + +Yes, it is possible to use the KB price overrides feature. In other words, even if the Aviate catalog plugin is enabled, it is still possible to create a subscription with price overrides. + +// TODO - Add Further Reading section once we have more documentation on Aviate plugin + + + + + diff --git a/userguide/aviate/aviate-catalog.adoc b/userguide/aviate/aviate-catalog.adoc deleted file mode 100644 index 98739fada..000000000 --- a/userguide/aviate/aviate-catalog.adoc +++ /dev/null @@ -1,5 +0,0 @@ -= Aviate Catalog - -include::{sourcedir}/aviate/includes/aviate-card.adoc[] - -== Introduction diff --git a/userguide/aviate/how-to-install-the-aviate-plugin.adoc b/userguide/aviate/how-to-install-the-aviate-plugin.adoc new file mode 100644 index 000000000..88cba6da0 --- /dev/null +++ b/userguide/aviate/how-to-install-the-aviate-plugin.adoc @@ -0,0 +1,136 @@ += How to Install the Aviate Plugin + +include::{sourcedir}/aviate/includes/aviate-card.adoc[] + +//TODO - Add some introduction about Aviate plugin + +== Prerequisites + +* Ensure that you have Kill Bill, Kaui, and the database set up as explained in the https://docs.killbill.io/latest/getting_started.html[__Getting Started Guide__]. + +* Ensure that you have https://curl.haxx.se/[_cURL_] installed. If you are on Windows, we recommend that you use https://git-scm.com/download/win[_Git Bash_] to run the `cURL` commands. + +== Plugin Installation + +This section lists the steps to be followed for the Aviate plugin installation. + +//TODO - Steps to create the DB tables are not mentioned here, I'm assuming that com.killbill.billing.plugin.aviate.enableMigrations=true will automatically create the tables? + +*Step 1 - Install Plugin* + +The aviate plugin can be installed by running the following curl command: + +[source,bash] +---- +curl -v \ + -u admin:password \ + -H "Content-Type: application/json" \ + -H 'X-Killbill-CreatedBy: admin' \ + -X POST \ + --data-binary '{ + "nodeCommandProperties": [ + { + "key": "pluginKey", + "value": "aviate" + }, + { + "key": "pluginVersion", + "value": "" + }, + { + "key": "pluginArtifactId", + "value": "aviate-plugin" + }, + { + "key": "pluginGroupId", + "value": "com.kill-bill.billing.plugin.java" + }, + { + "key": "pluginType", + "value": "java" + }, + { + "key": "pluginUri", + "value": "https://dl.cloudsmith.io//killbill/aviate/maven/com/kill-bill/billing/plugin/java/aviate-plugin//aviate-plugin-.jar" + } + ], + "nodeCommandType": "INSTALL_PLUGIN", + "isSystemCommandType": "true" + }' \ + "http://127.0.0.1:8080/1.0/kb/nodesInfo" +---- + +Replace `` with your cloudsmith token. Replace `` with the plugin version to be installed. This should be something like `1.0.12`. + +*Step 2 - Start the Plugin* + +In order to start the plugin, run the following `curl` command: + +[source,bash] +---- +curl -v \ + -u admin:password \ + -H "Content-Type: application/json" \ + -H 'X-Killbill-CreatedBy: admin' \ + -X POST \ + --data-binary '{ + "nodeCommandProperties": [ + { + "key": "pluginKey", + "value": "aviate" + } + ], + "nodeCommandType": "START_PLUGIN", + "isSystemCommandType": true + }' \ + "http://127.0.0.1:8080/1.0/kb/nodesInfo" +---- + +*Step 3 - Verify that the plugin is running* + +Run the following `curl` command: + +[source,bash] +---- +curl -v \ +-u admin:password \ +http://127.0.0.1:8080/1.0/kb/nodesInfo +---- + +The output should contain an entry similar to the following: + +[source,bash] +---- + { + "bundleSymbolicName": "com.kill-bill.billing.plugin.java.aviate-plugin", + "pluginKey": "aviate-plugin", + "pluginName": "aviate-plugin", + "version": "1.0.12-SNAPSHOT", + "state": "RUNNING", + "isSelectedForStart": true, + "services": [ + { + "serviceTypeName": "javax.servlet.Servlet", + "registrationName": "aviate-plugin" + }, + { + "serviceTypeName": "org.killbill.billing.catalog.plugin.api.CatalogPluginApi", + "registrationName": "aviate-plugin" + }, + { + "serviceTypeName": "org.killbill.billing.osgi.api.Healthcheck", + "registrationName": "aviate-plugin" + } + ] + } +---- +Alternatively, you can verify this via Kaui. To do this, click on the plug icon and the kpm link. Verify that the Aviate plugin is displayed in green color in RUNNING status. + +== Further Reading + +* Aviate Overview +* Aviate Catalog Plugin + + + +