File name : create_index_pattern_wizards.js
to fetch all the indices
return es.search(params)
Now, I want to fetch aliases
so i wrote es.cat.aliases it did not work out
so i am trying to write an api
Code as follows
i wrote create_index_pattern_wizards.js
$http.get('../api/kibana/management/aliases').then((response) => {
this.aliases = response.data;
});
i have created a file management folder / index.js
export default function (server) {
const call = server.plugins.elasticsearch.getCluster('data').callWithRequest;
server.route({
path: '/api/kibana/management/aliases/',
method: ['GET'],
handler: (req, reply) => {
return call(req, 'cat.aliases', { format: 'json' })
.then(responseAliases => {
reply(responseAliases.map((a)=>{
return a.alias;
}));
});
}
});
}
API is getting called but returning 404
any help please