Module licenseware.app_builder
In the licenseware.app_builder.app_builder
package we define the app
and build the api.
Make sure to decorate each route with failsafe
decorator that way app will not crash
and will log the error in app.log
There are 2 ways we can add new endpoints to the main Api:
-
The first one is to pass instantiated
api
object fromlicenseware.app_builder.app_builder
to a function, use thatapi
object then pass it back toAppBuilder
class. Seelicenseware.app_builder.app_activation_route
for a full example; -
The second one is to create a new package (folder) just like we did with
licenseware.app_builder.uploads_namespace
, declare theNamespace
in the init.py file and the functions needed. The functions and the namespace created will be imported in theAppBuilder
class and invoked. Seelicenseware.app_builder.uploads_namespace
for a full example.
All default routes should be created in this package
Expand source code
"""
In the `app_builder` package we define the `app` and build the api.
Make sure to decorate each route with `failsafe` decorator that way app will not crash
and will log the error in app.log
There are 2 ways we can add new endpoints to the main Api:
- The first one is to pass instantiated `api` object from `app_builder` to a function, use that `api` object then pass it back to `AppBuilder` class. See `app_activation_route` for a full example;
- The second one is to create a new package (folder) just like we did with `uploads_namespace`, declare the `Namespace` in the __init__.py file and the functions needed. The functions and the namespace created will be imported in the `AppBuilder` class and invoked. See `uploads_namespace` for a full example.
All default routes should be created in this package
"""
from .app_builder import AppBuilder
Sub-modules
licenseware.app_builder.app_activation_route
-
When this endpoint is called the
Quota
for this tenant_id must be created and theApp
must be registered. licenseware.app_builder.app_builder
-
AppBuilder
is reponsible for creating the Api from theX_namespace
packages andX_route
modules. Authenticates theApp
and sends the … licenseware.app_builder.app_registration_route
-
When this endpoint is called the registration information for this
App
is sent to registry-service. licenseware.app_builder.data_sync_namespace
licenseware.app_builder.decrypt_namespace
-
Here we are creating the
licenseware.app_builder.decrypt_namespace
that will be imported inlicenseware.app_builder.app_builder
along with the route creation functions from this package … licenseware.app_builder.download_as_route
licenseware.app_builder.editable_tables_route
-
When this endpoint is called the generated metadata from marshmallow schemas provided in
AppBuilder
ateditable_tables_schemas
parameter will be … licenseware.app_builder.endpoint_builder_namespace
-
Here we are creating the
licenseware.app_builder.endpoint_builder_namespace
that will be imported inlicenseware.app_builder.app_builder
along with the route creation functions from this package … licenseware.app_builder.features_namespace
-
Here we are creating the
licenseware.app_builder.features_namespace
that will be imported inlicenseware.app_builder.app_builder
along with the route creation functions from this package … licenseware.app_builder.features_route
-
When this endpoint is called the generated metadata from marshmallow schemas provided in
AppBuilder
ateditable_tables_schemas
parameter will be … licenseware.app_builder.refresh_registration_route
-
When this endpoint is called the registration information from all
App
entities (uploaders, reports etc) are sent to registry service. licenseware.app_builder.report_components_namespace
-
Here we are creating the
licenseware.app_builder.report_components_namespace
that will be imported inlicenseware.app_builder.app_builder
along with the route creation functions from this package … licenseware.app_builder.reports_namespace
-
Here we are creating the
licenseware.app_builder.reports_namespace
that will be imported inlicenseware.app_builder.app_builder
along with the route creation functions from this package … licenseware.app_builder.tenant_registration_route
-
When this endpoint is called info about Tenant
App
activation and utilization will be returned. licenseware.app_builder.terms_and_conditions_route
licenseware.app_builder.uploads_namespace
-
Here we are creating the
licenseware.app_builder.uploads_namespace
that will be imported inlicenseware.app_builder.app_builder
along with the route creation functions from this package …