[docs] Init es client section

This commit is contained in:
Jonathan Budzenski 2016-12-29 11:15:55 -06:00
parent 42e59dbbe8
commit 92ee7e12a5
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292
3 changed files with 41 additions and 2 deletions

View file

@ -8,6 +8,8 @@ The Kibana plugin interfaces are in a state of constant development. We cannot
* <<development-plugin-resources>>
* <<development-uiexports>>
* <<development-elasticsearch>>
include::plugin/development-plugin-resources.asciidoc[]

View file

@ -1,4 +1,41 @@
[[development-elasticsearch]]
=== Communicating with elasticsearch
Kibana exposes clients for communicating with elasticsearch on the server passed into each plugin.
Kibana exposes two clients on the server and browser for communicating with elasticsearch.
There is an 'admin' client which is used for managing Kibana's state, and a 'data' client for all
other requests. The clients use the elasticsearch.js library.
[float]
[[client-server]]
=== Server clients
Server clients are exposed through the elasticsearch plugin.
[source,javascript]
----
const adminCluster = server.plugins.elasticsearch.getCluster('admin);
const dataCluster = server.plugins.elasticsearch.getCluster('data);
//ping as the configured elasticsearch.user in kibana.yml
adminCluster.callWithInternalUser('ping');
//ping as the user specified in the current requests header
adminCluster.callWithRequest(req, 'ping');
----
[float]
[[client-browser]]
=== Browser clients
Browser clients are exposed through AngularJS services.
[source,javascript]
----
uiModules.get('kibana')
.run(function (esAdmin, es) {
es.ping()
.then(() => esAdmin.ping())
.catch(err => {
console.log('error pinging servers);
});
});
----

View file

@ -23,7 +23,7 @@ The full list of configurations can be found at <<settings>>.
[[tribe-limitations]]
=== Limitations
Due to the ambiguity of which cluster is being used, certain features are disabled in Kibana:
Due to the ambiguity of which cluster is being used, certain features are disabled in Kibana:
* Console
* Managing users and roles with the x-pack plugin