|
|
@@ -97,6 +97,13 @@ class ElasticsearchDelegator {
|
|
|
return this.normalizeIndices();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * return Nodes Info
|
|
|
+ * `cluster:monitor/nodes/info` privilege is required on ES
|
|
|
+ * @return {object} `{ esVersion, esNodeInfos }`
|
|
|
+ *
|
|
|
+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-info.html
|
|
|
+ */
|
|
|
async getInfo() {
|
|
|
const info = await this.client.nodes.info();
|
|
|
if (!info._nodes || !info.nodes) {
|
|
|
@@ -126,8 +133,16 @@ class ElasticsearchDelegator {
|
|
|
return { esVersion, esNodeInfos };
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * return Cluster Health
|
|
|
+ * `cluster:monitor/health` privilege is required on ES
|
|
|
+ * @return {object} `{ esClusterHealth }`
|
|
|
+ *
|
|
|
+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-health.html
|
|
|
+ */
|
|
|
async getInfoForHealth() {
|
|
|
- return this.client.cluster.health();
|
|
|
+ const esClusterHealth = await this.client.cluster.health();
|
|
|
+ return { esClusterHealth };
|
|
|
}
|
|
|
|
|
|
/**
|