According to the Kibana documentation I can access elasticsearch as a service and run custom queries.
I tried to do this in my own plugin (generated with the template kibana plugin service), but angularjs does not recognize 'es' or 'esAdmin' as a valid service.
The exception looks like:
Uncaught Error: [$injector:modulerr] Failed to instantiate module kibana due to:
Error: [$injector:modulerr] Failed to instantiate module esAdmin due to:
Error: [$injector:nomod] Module 'esAdmin' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.4.7/$injector/nomod?p0=esAdmin
What I try to do is the following:
uiModules.get('kibana', ['esAdmin', 'es'])
.run(function (esAdmin, es) {
es.ping()
.then(
() => {console.log("es pinged");}
).catch(err => {
console.log(err);
});
});
What should I import or do to be able to use this service?