pytbox 0.0.6__tar.gz → 0.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pytbox might be problematic. Click here for more details.
- {pytbox-0.0.6 → pytbox-0.0.7}/PKG-INFO +1 -1
- {pytbox-0.0.6 → pytbox-0.0.7}/pyproject.toml +1 -1
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/categraf/build_config.py +31 -4
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox.egg-info/PKG-INFO +1 -1
- {pytbox-0.0.6 → pytbox-0.0.7}/README.md +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/setup.cfg +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/alert/alert_handler.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/alert/ping.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/alicloud/sls.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/base.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/__init__.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/categraf/__init__.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/categraf/commands.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/common/__init__.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/common/options.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/common/utils.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/formatters/__init__.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/formatters/output.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli/main.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/cli.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/common/__init__.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/database/mongo.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/database/victoriametrics.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/dida365.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/feishu/client.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/feishu/endpoints.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/feishu/errors.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/feishu/helpers.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/feishu/typing.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/log/logger.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/log/victorialog.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/onepassword_connect.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/onepassword_sa.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/utils/env.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/utils/load_config.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/utils/ping_checker.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/utils/response.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/utils/richutils.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox/utils/timeutils.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox.egg-info/SOURCES.txt +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox.egg-info/dependency_links.txt +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox.egg-info/entry_points.txt +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox.egg-info/requires.txt +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/src/pytbox.egg-info/top_level.txt +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/tests/test_base.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/tests/test_feishu.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/tests/test_logger.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/tests/test_onepassword_connect.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/tests/test_onepassword_sa.py +0 -0
- {pytbox-0.0.6 → pytbox-0.0.7}/tests/test_victoriametrics.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pytbox"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.7"
|
|
8
8
|
description = "A collection of Python integrations and utilities (Feishu, Dida365, VictoriaMetrics, ...)"
|
|
9
9
|
authors = [{ name = "mingming hou", email = "houm01@foxmail.com" }]
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -26,8 +26,19 @@ class BuildConfig:
|
|
|
26
26
|
self.instances = load_config_by_file(instances)
|
|
27
27
|
self.output_dir = output_dir
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
def _get_template(self, template_name):
|
|
30
|
+
return env.get_template(template_name)
|
|
31
|
+
|
|
32
|
+
def common(self, input_name):
|
|
33
|
+
template = self._get_template(f'input.{input_name}/{input_name}.toml.j2')
|
|
34
|
+
render_data = template.render()
|
|
35
|
+
target_dir = Path(self.output_dir) / f'input.{input_name}'
|
|
36
|
+
if not target_dir.exists():
|
|
37
|
+
target_dir.mkdir(parents=True, exist_ok=True)
|
|
38
|
+
|
|
39
|
+
with open(Path(self.output_dir) / f'input.{input_name}' / f'{input_name}.toml', 'w', encoding='utf-8') as f:
|
|
40
|
+
f.write(render_data)
|
|
41
|
+
|
|
31
42
|
def ping(self):
|
|
32
43
|
instances = self.instances['ping']['instance']
|
|
33
44
|
render_data = ping_template.render(instances=instances)
|
|
@@ -44,10 +55,26 @@ class BuildConfig:
|
|
|
44
55
|
target_dir = Path(self.output_dir) / 'input.prometheus'
|
|
45
56
|
if not target_dir.exists():
|
|
46
57
|
target_dir.mkdir(parents=True, exist_ok=True)
|
|
47
|
-
|
|
48
58
|
with open(Path(self.output_dir) / 'input.prometheus' / 'prometheus.toml', 'w', encoding='utf-8') as f:
|
|
49
59
|
f.write(render_data)
|
|
50
60
|
|
|
61
|
+
def vsphere(self):
|
|
62
|
+
template = self._get_template('input.vsphere/vsphere.toml.j2')
|
|
63
|
+
instances = self.instances['vsphere']['instance']
|
|
64
|
+
print(instances)
|
|
65
|
+
render_data = template.render(instances=instances)
|
|
66
|
+
target_dir = Path(self.output_dir) / 'input.vsphere'
|
|
67
|
+
if not target_dir.exists():
|
|
68
|
+
target_dir.mkdir(parents=True, exist_ok=True)
|
|
69
|
+
with open(Path(self.output_dir) / 'input.vsphere' / 'vsphere.toml', 'w', encoding='utf-8') as f:
|
|
70
|
+
f.write(render_data)
|
|
71
|
+
|
|
51
72
|
def run(self):
|
|
73
|
+
# self.common('cpu')
|
|
74
|
+
# self.common('mem')
|
|
75
|
+
# self.common('net')
|
|
76
|
+
# self.common('disk')
|
|
77
|
+
# self.common('diskio')
|
|
78
|
+
self.vsphere()
|
|
52
79
|
# self.ping()
|
|
53
|
-
self.prometheus()
|
|
80
|
+
# self.prometheus()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|