Added method get s3 endpoint for namespace

This commit is contained in:
Ilyas Niyazov 2024-09-09 20:44:31 +03:00 committed by Ilyas Niyazov
parent 565fd4c72b
commit 36bfe385d5
2 changed files with 4 additions and 0 deletions

View file

@ -12,6 +12,7 @@ class ConfigAttributes:
REMOTE_WALLET_CONFIG = "remote_wallet_config_path" REMOTE_WALLET_CONFIG = "remote_wallet_config_path"
ENDPOINT_DATA_0 = "endpoint_data0" ENDPOINT_DATA_0 = "endpoint_data0"
ENDPOINT_DATA_1 = "endpoint_data1" ENDPOINT_DATA_1 = "endpoint_data1"
ENDPOINT_DATA_0_NS = "endpoint_data0_namespace"
ENDPOINT_INTERNAL = "endpoint_internal0" ENDPOINT_INTERNAL = "endpoint_internal0"
ENDPOINT_PROMETHEUS = "endpoint_prometheus" ENDPOINT_PROMETHEUS = "endpoint_prometheus"
CONTROL_ENDPOINT = "control_endpoint" CONTROL_ENDPOINT = "control_endpoint"

View file

@ -45,6 +45,9 @@ class S3Gate(NodeBase):
self._get_attribute(ConfigAttributes.ENDPOINT_DATA_1), self._get_attribute(ConfigAttributes.ENDPOINT_DATA_1),
] ]
def get_ns_endpoint(self, ns_name: str) -> str:
return self._get_attribute(ConfigAttributes.ENDPOINT_DATA_0_NS).format(namespace=ns_name)
def service_healthcheck(self) -> bool: def service_healthcheck(self) -> bool:
health_metric = "frostfs_s3_gw_state_health" health_metric = "frostfs_s3_gw_state_health"
output = self.host.get_shell().exec(f"curl -s localhost:8086 | grep {health_metric} | sed 1,2d").stdout output = self.host.get_shell().exec(f"curl -s localhost:8086 | grep {health_metric} | sed 1,2d").stdout