6 Commits

Author SHA1 Message Date
b429f1772a remove unecessary files
All checks were successful
Run Tox Check / tox-py312 (pull_request) Successful in 16s
Run Tox Check / tox-pep8 (pull_request) Successful in 16s
2025-08-08 09:46:40 +00:00
be1e678038 fix pep8
All checks were successful
Run Tox Check / tox-py312 (pull_request) Successful in 20s
Run Tox Check / tox-pep8 (pull_request) Successful in 16s
2025-08-08 09:40:10 +00:00
95c38587fe refactor variables
Some checks failed
Run Tox Check / tox-py312 (pull_request) Successful in 15s
Run Tox Check / tox-pep8 (pull_request) Failing after 14s
2025-08-04 10:37:37 +00:00
50a11560c1 rm test file
Some checks failed
Run Tox Check / tox-py312 (pull_request) Successful in 15s
Run Tox Check / tox-pep8 (pull_request) Failing after 14s
2025-08-04 10:30:10 +00:00
d98c5b61cb add collect_statistics tool
Some checks failed
Run Tox Check / tox-py312 (pull_request) Successful in 16s
Run Tox Check / tox-pep8 (pull_request) Failing after 14s
2025-08-04 10:28:59 +00:00
71b820ebf5 New service function (#36)
Reviewed-on: #36
Reviewed-by: Tino Schreiber <tino.schreiber@t-systems.com>
Co-authored-by: Sebastian Gode <sebastian.gode@telekom.de>
Co-committed-by: Sebastian Gode <sebastian.gode@telekom.de>
2025-08-04 09:36:23 +00:00
3 changed files with 210 additions and 1 deletions

View File

@ -52,4 +52,3 @@ the key is :code:`service_type` which has the foreign key in the
document can only be linked to one service.
The key :code:`service_category` table is :code:`name` of the service category
which is then used in the :code:`services` table as foreign key.

View File

@ -453,3 +453,25 @@ class Services(object):
res.sort(key=lambda x: x.get("name", "").lower())
return res
def all_services_by_cloud_environment(self, cloud_environment, environments):
"""Retrieve all services filtered by cloud_environment
"""
res = []
for srv in self.all_services:
if environments and cloud_environment:
for srv_cloud_environment in srv["cloud_environments"]:
if srv_cloud_environment["name"] == cloud_environment:
for environment in environments:
if srv_cloud_environment["visibility"] == environment:
res.append(srv)
else:
continue
else:
raise Exception("No cloud_environment or environments "
"specified in function all_services_by_cloud_environment.")
# Sort services
res.sort(key=lambda x: x.get("service_title", "").lower())
return res

188
tools/collect_statistics.py Normal file

File diff suppressed because it is too large Load Diff