from hawkeye_monitor.data import CheckResult class ElasticsearchCheck: def __init__(self, query): self.query = query def run_check(self, client, index) -> CheckResult: """ Runs checks on given using the query params: -client (Elastisearch Client): Elasticsearch Client -index (str) - index to run query returns: CheckResult """ response = client.search(index=index, query=self.query) return self.validate(response) def validate(self, response) -> CheckResult: """ Validates responses from search params: - response(dict) response object from the ES returns: - CheckResult """ return CheckResult(check_name=self.__class__.__name__, check_passed=True)