def METHOD_NAME(self):
    self._es = Elasticsearch(hosts=self.es_hosts)
    self._es_version = [int(i) for i in self._es.info()["version"]["number"].split(".")]
    if self._es_version < [7]:
        raise ValueError("Inventory exporter {} not compatible with ES < 7.0")
    # lifecycle
    _esilm = IlmClient(self._es)
    _esilm.put_lifecycle(ES_LIFECYCLE_POLICY_NAME, ES_LIFECYCLE_POLICY)
    # template
    self._es.indices.put_template(ES_TEMPLATE_NAME, ES_TEMPLATE)
    # create index
    for i in range(10):
        existing_indices = self._es.indices.get(ES_INDEX_PATTERN).keys()
        if not len(existing_indices):
            current_index_name = ES_INDEX_PATTERN.replace("*", "000001")
            try:
                self._es.indices.create(current_index_name, {"aliases": {ES_ALIAS: {"is_write_index": True}}})
            except RequestError:
                # probably race
                pass
            else:
                break
    return ES_ALIAS