trolldb.api.fastapi_app module

The module which creates the main FastAPI app which will be used when running the API server.

trolldb.api.fastapi_app.API_INFO = {'description': 'The API allows you to perform CRUD operations as well as querying the databaseAt the moment only MongoDB is supported. It is based on the following Python packages\n * **PyMongo** (https://github.com/mongodb/mongo-python-driver)\n * **motor** (https://github.com/mongodb/motor)', 'license_info': {'name': 'The GNU General Public License v3.0', 'url': 'https://www.gnu.org/licenses/gpl-3.0.en.html'}, 'summary': 'The database API of Pytroll', 'title': 'pytroll-db'}

These will appear in the auto-generated documentation and are passed to the FastAPI class as keyword args.

async trolldb.api.fastapi_app.auto_handler_response_errors(_, exc: ResponseError) fastapi.responses.PlainTextResponse

Catches all the exceptions raised as a ResponseError, e.g. accessing non-existing databases/collections.

async trolldb.api.fastapi_app.auto_handler_pydantic_validation_errors(_, exc: pydantic.ValidationError) fastapi.responses.PlainTextResponse

Catches all the exceptions raised as a Pydantic ValidationError.