用于从其他源(如django设置)生成conn check yaml配置的实用程序
conn-check-configs的Python项目详细描述
这是一组python模块和实用程序,用于生成conn-check 从其他来源配置YAML,例如Django设置模块
支持的源
- Django settings modules
用法
django
您可以使用conn check django命令行从django应用程序导出公共设置 实用程序,它接受以下参数:
- ^{tt1}$, ^{tt2}$: the Python module for Django to import.
- ^{tt3}$, ^{tt4}$: the database schema name if not set as NAME in the Django settings.
- ^{tt5}$: Optional string to send with statsd checks (defaults to a conn-check specific metric).
- ^{tt6}$: Optional response string to expect from a statsd check.
- ^{tt7}$, ^{tt8}$: Optionally output to a file rather than ^{tt9}$.
Followed by a path to the generated YAML file, for example:
$ conn-check-django -m myapp.settings -f /tmp/myapp-conncheck.yaml $ conn-check /tmp/myapp-conncheck.yaml
扩展配置生成
您可能希望使用自定义(或不支持的)设置扩展生成的检查, 这可以通过创建自己的脚本并导入所有函数/变量来完成 从相关的连接检查配置子模块(例如,django),然后扩展 带有自己的检查函数的EXTRA_CHECK_MAKERS列表,它必须 2个参数:django设置模块和来自cli的选项(通常是一个argparse.Namespace实例)。
建筑车轮
为了使这个工具更容易/更便于移植,您可以构建 conn check配置及其所有依赖项为Python wheels:
make clean-wheels make build-wheels
生成控制盘make target将生成conn check configs及其基本依赖项。
默认情况下,所有控制盘都将放置在/wheels中。