async getSettings(index) { const response = await this.client .indices .getSettings({ index: index, includeDefaults: true, human: true }); return response; }
async getKBVer() { let index; try { index = await this.getAlias((this.env.KB_INDEX || '.kibana')); } catch (err) { if (err) index = '.kibana'; } if (typeof index === 'object') index = Object.keys(index)[0]; const exists = await this.client .indices .exists({ index: index }); if (exists) { const settings = await this.client .indices .getSettings({ index: index, includeDefaults: true, human: true }); return (settings[index].settings.index.version.created_string || '0'); } return '0'; }