HomePhabricator

api_db: Add code to enable database connection, add API to obtain recent…

Description

api_db: Add code to enable database connection, add API to obtain recent backups data and freshness, load config from alerting yaml file, add tests

Added code to connect to an SQL database, added skeleton for unit tests, cleaned up main.py file and
added a singleton class to keep database configuration the same throughout the program.
Added DB query functionality for the readiness probe.
Added code to support loading of alerting hosts through yaml file, potentially supplied by puppet in the future
Created APIs to send configuration data such as sections, datacenters, and backup types through API
Also created API to perform freshness check based on YAML file through API. Added unit tests to validate loading of YAML file,
DB operations, and APIs using SQLite as the database, which is loaded with a test.db file containing test data.

Bug: T285142
Change-Id: Icad8c0363814f0d0a726cd2dc589c417f5e13af3

Details