1:- module(nodes, [
    2    info/4,         % +Ps, +NodeID, +Metric, -Reply
    3    info/5,         % +Ps, +NodeID, +Metric, +Params, -Reply
    4    shutdown/3,     % +Ps, +NodeID, -Reply
    5    shutdown/4,     % +Ps, +NodeID, +Params, -Reply
    6    stats/5,        % +Ps, +NodeID, +Metric, +IndexMetric, -Reply
    7    stats/6,        % +Ps, +NodeID, +Metric, +IndexMetric, +Params, -Reply
    8    hot_threads/3,  % +Ps, +NodeID, -Reply
    9    hot_threads/4   % +Ps, +NodeID, +Params, -Reply
   10]).

Nodes APIs

Manage nodes.

author
- Hongxin Liang
See also
- http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html */
license
- Apache License Version 2.0
   20:- use_module(transport).   21:- use_module(util).
 info(+Ps, +NodeID, +Metric, -Reply) is semidet
 info(+Ps, +NodeID, +Metric, +Params, -Reply) is semidet
The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information. See here.
   30info(Ps, NodeID, Metric, Reply) :-
   31    info(Ps, NodeID, Metric, _{}, Reply).
   32
   33info(Ps, NodeID, Metric, Params, Reply) :-
   34    make_context(['_nodes', NodeID, Metric], Context),
   35    perform_request(Ps, get, Context, Params, _, Reply).
 shutdown(+Ps, +NodeID, -Reply) is semidet
 shutdown(+Ps, +NodeID, +Params, -Reply) is semidet
The nodes shutdown API allows to shutdown one or more (or all) nodes in the cluster. See here.
   44shutdown(Ps, NodeID, Reply) :-
   45    shutdown(Ps, NodeID, _{}, Reply).
   46
   47shutdown(Ps, NodeID, Params, Reply) :-
   48    make_context(['_cluster', 'nodes', NodeID, '_shutdown'], Context),
   49    perform_request(Ps, post, Context, Params, '', _, Reply).
 stats(+Ps, +NodeID, +Metric, +IndexMetric, -Reply) is semidet
 stats(+Ps, +NodeID, +Metric, +IndexMetric, Params, -Reply) is semidet
The cluster nodes stats API allows to retrieve one or more (or all) of the cluster nodes statistics. See here.
   58stats(Ps, NodeID, Metric, IndexMetric, Reply) :-
   59    stats(Ps, NodeID, Metric, IndexMetric, _{}, Reply).
   60
   61stats(Ps, NodeID, Metric, IndexMetric, Params, Reply) :-
   62    make_context(['_nodes', NodeID, 'stats', Metric, IndexMetric], Context),
   63    perform_request(Ps, get, Context, Params, _, Reply).
 hot_threads(+Ps, +NodeID, -Reply) is semidet
 hot_threads(+Ps, +NodeID, +Params, -Reply) is semidet
An API allowing to get the current hot threads on each node in the cluster. See here.
   71hot_threads(Ps, NodeID, Reply) :-
   72    hot_threads(Ps, NodeID, _{}, Reply).
   73
   74hot_threads(Ps, NodeID, Params, Reply) :-
   75    make_context(['_nodes', NodeID, 'hot_threads'], Context),
   76    perform_request(Ps, get, Context, Params, _, Reply)