[#103] Add host_status method to Host

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-10-26 13:34:42 +03:00
parent b1a3d740e9
commit f4111a1374
4 changed files with 33 additions and 4 deletions

View file

@ -10,6 +10,7 @@ class ConfigAttributes:
ENDPOINT_DATA_0 = "endpoint_data0"
ENDPOINT_DATA_1 = "endpoint_data1"
ENDPOINT_INTERNAL = "endpoint_internal0"
ENDPOINT_PROMETHEUS = "endpoint_prometheus"
CONTROL_ENDPOINT = "control_endpoint"
UN_LOCODE = "un_locode"
HTTP_HOSTNAME = "http_hostname"

View file

@ -64,6 +64,9 @@ class NodeBase(HumanReadableABC):
def service_healthcheck(self) -> bool:
"""Service healthcheck."""
def get_metrics_endpoint(self) -> str:
return self._get_attribute(ConfigAttributes.ENDPOINT_PROMETHEUS)
def stop_service(self):
with reporter.step(f"Stop {self.name} service on {self.host.config.address}"):
self.host.stop_service(self.name)