Dowser. Elasticsearch. XPack
(Dowser.Elasticsearch v0.4.1)
View Source
The Elasticsearch X-Pack APIs — every endpoint tagged xpack in the
Elasticsearch OpenAPI specification:
which features the cluster's build ships and licenses (info/1), and how
much each one is actually used (usage/1).
Built on Dowser.Client. Neither endpoint requires an attribute, so both
signatures are opts-only.
All options are forwarded to Dowser.Client.request/4, e.g. :context,
:params (query-string parameters), :format, :keys and :http_opts
(including :headers).
On a 2xx response every function returns {:ok, body} with the decoded
response body. A non-2xx response returns
{:error, %Dowser.Elasticsearch.Error{}}; a transport, encoding or decoding
failure returns {:error, exception} from Dowser.Client. Each function has
a bang variant that returns the body directly or raises the error exception.
Summary
Functions
Returns the build, license and feature set of the cluster — GET /_xpack
(Get information API).
Like info/1, but returns the body directly or raises the error exception.
Returns the usage of each X-Pack feature across the cluster — GET /_xpack/usage
(Get usage information API).
Like usage/1, but returns the body directly or raises the error exception.
Types
@type body() :: term()
@type result() :: {:ok, body()} | {:error, Exception.t()}
Functions
Returns the build, license and feature set of the cluster — GET /_xpack
(Get information API).
{:ok, info} = Dowser.Elasticsearch.XPack.info()
info["license"]["type"]
#=> "basic"
info["features"]["ml"]["available"]
#=> trueOptions
:params—categoriesrestricts the response to any ofbuild,licenseandfeatures(comma-separated);accept_enterpriseandhumanshape the license section.
Like info/1, but returns the body directly or raises the error exception.
Returns the usage of each X-Pack feature across the cluster — GET /_xpack/usage
(Get usage information API).
Where info/1 says which features are available, this says what is being
used: how many jobs, watches, rollup jobs, mapped runtime fields and so on
each feature holds.
{:ok, usage} = Dowser.Elasticsearch.XPack.usage()
usage["watcher"]["count"]
#=> %{"active" => 2, "total" => 3}Options
:params—master_timeoutcaps the wait for the master node.
Like usage/1, but returns the body directly or raises the error exception.