Commit b4035c1f authored by Micha Müller's avatar Micha Müller
Browse files

Merge branch 'CommonRestServer' into 'master'

Common rest server

See merge request !3
parents 72b1ca02 9f44fe66
......@@ -6,7 +6,7 @@ install/
*.o
*.so
*.dylib
collectagent
collectagent/collectagent
dcdbpusher/dcdbpusher
tools/dcdbconfig/dcdbconfig
tools/dcdbcsvimport/dcdbcsvimport
......
......@@ -4,30 +4,38 @@ MAKEFILENAME := $(lastword $(MAKEFILE_LIST))
SUB_DIRS = lib collectagent dcdbpusher analytics tools scripts
SOURCEFORGE_MROR = vorboss
CASSANDRA_VERSION = 3.0.18
MOSQUITTO_VERSION = 1.5.5
BOOST_VERSION = 1.58.0
BOOST_VERSION = 1.70.0
OPENSSL_VERSION = 1.0.2l
CPPDRV_VERSION = 2.10.0
LIBUV_VERSION = 1.24.0
SOURCEFORGE_MROR = vorboss
CPPNET_VERSION = 0.12.0-final
BACNET-STACK_VERSION = 0.8.5
FREEIPMI_VERSION = 1.5.5
NET-SNMP_VERSION = 5.8
BOOST_VERSION_U = $(subst .,_,$(BOOST_VERSION))
DISTFILES = apache-cassandra-$(CASSANDRA_VERSION).tar.gz;http://archive.apache.org/dist/cassandra/$(CASSANDRA_VERSION)/apache-cassandra-$(CASSANDRA_VERSION)-bin.tar.gz \
mosquitto-$(MOSQUITTO_VERSION).tar.gz;http://mosquitto.org/files/source/mosquitto-$(MOSQUITTO_VERSION).tar.gz \
boost_$(BOOST_VERSION_U).tar.gz;http://$(SOURCEFORGE_MROR).dl.sourceforge.net/project/boost/boost/$(BOOST_VERSION)/boost_$(BOOST_VERSION_U).tar.gz \
openssl-$(OPENSSL_VERSION).tar.gz;https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz \
libuv-v$(LIBUV_VERSION).tar.gz;https://dist.libuv.org/dist/v$(LIBUV_VERSION)/libuv-v$(LIBUV_VERSION).tar.gz \
cpp-driver-$(CPPDRV_VERSION).tar.gz;https://github.com/datastax/cpp-driver/archive/$(CPPDRV_VERSION).tar.gz \
cpp-netlib-$(CPPNET_VERSION).tar.gz;http://downloads.cpp-netlib.org/0.12.0/cpp-netlib-$(CPPNET_VERSION).tar.gz \
bacnet-stack-$(BACNET-STACK_VERSION).tgz;https://downloads.sourceforge.net/project/bacnet/bacnet-stack/bacnet-stack-$(BACNET-STACK_VERSION)/bacnet-stack-$(BACNET-STACK_VERSION).tgz \
freeipmi-$(FREEIPMI_VERSION).tar.gz;http://ftp.gnu.org/gnu/freeipmi/freeipmi-$(FREEIPMI_VERSION).tar.gz \
net-snmp-$(NET-SNMP_VERSION).tar.gz;https://sourceforge.net/projects/net-snmp/files/net-snmp/$(NET-SNMP_VERSION)/net-snmp-$(NET-SNMP_VERSION).tar.gz/download
DISTFILES_HASHES = apache-cassandra-3.0.18.tar.gz|94dbdaa58b366166c53f881b8e266bc8;mosquitto-1.5.5.tar.gz|a17dffc6f63b2a4ab2eb5c51139e60e9;boost_1_58_0.tar.gz|5a5d5614d9a07672e1ab2a250b5defc5;openssl-1.0.2l.tar.gz|f85123cd390e864dfbe517e7616e6566;cpp-driver-2.10.0.tar.gz|6d15dd2cccd2efd1fdc86089d26971d0;libuv-v1.24.0.tar.gz|90320330757253b07404d2a97f59c66b;cpp-netlib-0.12.0-final.tar.gz|29b87c0e8c1a9e7fbdea5afcec947d53;bacnet-stack-$(BACNET-STACK_VERSION).tgz|66b69111d91432fa67a7c6c1a653434d;freeipmi-$(FREEIPMI_VERSION).tar.gz|b8abfefee0b757f351d8fab777e3c1bb;net-snmp-$(NET-SNMP_VERSION).tar.gz|63bfc65fbb86cdb616598df1aff6458a
freeipmi-$(FREEIPMI_VERSION).tar.gz;http://ftp.gnu.org/gnu/freeipmi/freeipmi-$(FREEIPMI_VERSION).tar.gz \
net-snmp-$(NET-SNMP_VERSION).tar.gz;https://sourceforge.net/projects/net-snmp/files/net-snmp/$(NET-SNMP_VERSION)/net-snmp-$(NET-SNMP_VERSION).tar.gz/download
DISTFILES_HASHES = apache-cassandra-3.0.18.tar.gz|94dbdaa58b366166c53f881b8e266bc8;\
mosquitto-1.5.5.tar.gz|a17dffc6f63b2a4ab2eb5c51139e60e9;\
boost_1_70_0.tar.gz|fea771fe8176828fabf9c09242ee8c26;\
openssl-1.0.2l.tar.gz|f85123cd390e864dfbe517e7616e6566;\
cpp-driver-2.10.0.tar.gz|6d15dd2cccd2efd1fdc86089d26971d0;\
libuv-v1.24.0.tar.gz|90320330757253b07404d2a97f59c66b;\
bacnet-stack-0.8.5.tgz|66b69111d91432fa67a7c6c1a653434d;\
freeipmi-1.5.5.tar.gz|b8abfefee0b757f351d8fab777e3c1bb;\
net-snmp-5.8.tar.gz|63bfc65fbb86cdb616598df1aff6458a
include common.mk
......@@ -149,7 +157,7 @@ $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.built: $(DCDBDEPSPATH)/boost_$(BOOST_V
$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.installed: $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.built
cd $(@D) && ./b2 -j $(MAKETHREADS) install && touch $(@)
cd $(@D) && ./b2 -j $(MAKETHREADS) --no-cmake-config install && touch $(@)
$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.patched
@echo "Building libuv..."
......@@ -184,24 +192,6 @@ $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-dri
@echo "Installing cpp-driver..."
cd $(@D)/build && make install && touch $(@)
$(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.built: $(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.patched
@echo "Building cpp-netlib..."
mkdir -p $(DCDBDEPSPATH)/cpp-netlib_build
cd $(DCDBDEPSPATH)/cpp-netlib_build && \
CC=$(FULL_CC) CXX=$(FULL_CXX) cmake $(CMAKE_CROSS_FLAGS) \
-DCPP-NETLIB_ENABLE_HTTPS=off \
-DCPP-NETLIB_BUILD_TESTS=OFF \
-DCPP-NETLIB_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
-DBOOST_ROOT=$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/ \
$(@D) && \
make -j $(MAKETHREADS) && touch $(@)
$(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo "Installing cpp-netlib..."
cd $(DCDBDEPSPATH)/cpp-netlib_build && make install && touch $(@)
$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.patched
@touch $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built
......
This diff is collapsed.
......@@ -14,6 +14,7 @@
#include <boost/asio.hpp>
#include <dlfcn.h>
#include "logging.h"
#include "RESTHttpsServer.h"
#include "mqttchecker.h"
#include "includes/UnitInterface.h"
#include "includes/AnalyzerConfiguratorInterface.h"
......@@ -135,21 +136,6 @@ public:
*/
bool stop(const string& plugin="", const string& analyzer="");
/**
* @brief Supply a REST command to the manager
*
* Commands must be plugin-specific. Those will be forwarded to said plugins, if of GET type, and
* the result will be collected. If PUT type, one or more actions will be performed on the plugin
* (e.g. start or stop). Some generic commands are available as well (see cheatsheet).
*
* @param pathStrs resource path to be accessed
* @param queries vector of queries
* @param method Either GET or PUT
* @param io BOOST IO Service, required to reload plugins
* @return Response as a <data, response> pair
*/
restResponse_t REST(const vector<string>& pathStrs, const vector<pair<string,string>>& queries, const string& method, boost::asio::io_service& io);
/**
* @brief Get the vector of currently loaded plugins
*
......@@ -160,32 +146,54 @@ public:
*/
std::vector<an_dl_t>& getPlugins() { return _plugins; }
/**
* @brief Get the current status of the AnalyticsManager.
*
* @return Status of the AnalyticsManager.
*/
managerState_t getStatus() { return _status; }
/**
* @brief Adds analytics RestAPI endpoints to an RestAPI server.
*
* @param restServer The RestAPI server which should offer analytics
* endpoints.
*/
void addRestEndpoints(RESTHttpsServer* restServer);
// String used as a response for the REST GET /help command
const string restCheatSheet = "dcdbpusher analytics RESTful API cheatsheet:\n"
" -GET: /analytics/plugins List of currently loaded plugins (Discovery)\n"
" /analytics/[plugin]/analyzers\n"
" List of running analyzers in the specified\n"
" data analytics plugin\n"
" /analytics/[plugin]/[analyzer]/sensors\n"
" List of currently running sensors which belong\n"
" to the specified data analytics plugin (Discovery)\n"
" /analytics/[plugin]/[analyzer]/units\n"
" List of units to which sensors are associated in the\n"
" specified data analytics plugin (Discovery)\n"
" -PUT: /analytics/[plugin]/[analyzer]/[start|stop|reload]\n"
" Start/stop the analyzers of the plugin or\n"
" reload the plugin configuration\n"
" /analytics/[plugin]/[analyzer]/compute\n"
" Perform computation of the given analyzer\n"
" in real-time. A \"unit\" query, specifying\n"
" the target unit must be included\n"
" /analytics/[plugin]/[analyzer]/[action]\n"
" Perform plugin-specific actions\n"
" (refer to documentation)\n"
"\n"
"All resources have to be prepended by host:port and need at\n"
"least the query ?authkey=[token] at the end. Multiple queries\n"
"need to be separated by semicolons(';')\n";
"(All commands must be prepended by \"/analytics\" !)\n"
" -GET: /plugins?[json] D List off currently loaded plugins.\n"
" /sensors?plugin;[analyzer];[json]\n"
" D List of currently running sensors which belong to\n"
" the specified plugin (and analyzer).\n"
" /analyzers?plugin;[json]\n"
" D List of running analyzers in the specified data\n"
" analytics plugin.\n"
" /units?plugin;[analyzer];[json]\n"
" D List of units to which sensors are associated in\n"
" the specified data analytics plugin (and analyzer).\n"
" -PUT: /start?[plugin];[analyzer]\n"
" Start all or only a specific analytics plugin or\n"
" start only a specific analyzer within a plugin.\n"
" /stop?[plugin];[analyzer]\n"
" Stop all or only a specific analytics plugin or\n"
" stop only a specific analyzer within a plugin.\n"
" /reload?[plugin] Reload all or only a specific analytics plugin.\n"
" /compute?plugin;analyzer;[unit];[json]\n"
" Query the specified analyzer for a unit. Default\n"
" unit is the root.\n"
" /analyzer?plugin;action;[analyzer]\n"
" Do a custom analyzer action for all or only an\n"
" selected analyzer within a plugin (refer to plugin\n"
" documentation).\n"
"\n"
"D = Discovery method\n"
"All resources have to be prepended by host:port.\n"
"A query can be appended as ?query=[value] at the end. Multiple queries\n"
"need to be separated by semicolons(';'). \"query=value\" syntax was shortened\n"
"to \"query\" for readability. Optional queries are marked with [ ]\n";
protected:
......@@ -206,6 +214,184 @@ protected:
//Logger object
boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
private:
// all stuff related to REST API
// Utility method to check the status of the analytics manager. If not
// loaded: prepares the response accordingly so no further actions are
// required.
// Return true if loaded, false otherwise.
inline bool managerLoaded(http::response<http::string_body>& res) {
if (_status != LOADED) {
const std::string err = "AnalyticsManager is not loaded!\n";
RESTAPILOG(error) << err;
res.body() = err;
res.result(http::status::internal_server_error);
return false;
}
return true;
}
// methods for REST API endpoints
/**
* GET "/analytics/help"
*
* @brief Return a cheatsheet of available REST API endpoints specific for
* the analytics manager.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | - | - | -
* Optional | - | - | -
*/
void GET_analytics_help(endpointArgs);
/**
* GET "/analytics/plugins"
*
* @brief (Discovery) List all currently loaded data analytic plugins.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | - | - | -
* Optional | json | true | format response as json
*/
void GET_analytics_plugins(endpointArgs);
/**
* GET "/analytics/sensors"
*
* @brief (Discovery) List all sensors of a plugin.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | plugin | all analyzer plugin | specify the plugin
* | | names |
* Optional | analyzer| all analyzers of a | restrict sensors list to an
* | | plugin | analyzer
* | json | true | format response as json
*/
void GET_analytics_sensors(endpointArgs);
/**
* GET "/analytics/units"
*
* @brief (Discovery) List all units of a plugin.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | plugin | all analyzer plugin | specify the plugin
* | | names |
* Optional | analyzer| all analyzers of a | restrict unit list to an
* | | plugin | analyzer
* | json | true | format response as json
*/
void GET_analytics_units(endpointArgs);
/**
* GET "/analytics/analyzers"
*
* @brief (Discovery) List all active analyzers of a plugin.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | plugin | all analyzer plugin | specify the plugin
* | | names |
* Optional | json | true | format response as json
*/
void GET_analytics_analyzers(endpointArgs);
/**
* PUT "/analytics/start"
*
* @brief Start all or only a specific plugin. Or only start a specific
* streaming analyzer within a specific plugin.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | - | - | -
* Optional | plugin | all analyzer plugin | only start the specified
* | | names | plugin
* | analyzer| all analyzers of a | only start the specified
* | | plugin | analyzer. Requires a plugin
* | | | to be specified. Limited to
* | | | streaming analyzers.
*/
void PUT_analytics_start(endpointArgs);
/**
* PUT "/analytics/stop"
*
* @brief Stop all or only a specific plugin. Or only stop a specific
* streaming analyzer within a plugin.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | - | - | -
* Optional | plugin | all analyzer plugin | only stop the specified
* | | names | plugin
* | analyzer| all analyzers of a | only stop the specified
* | | plugin | analyzer. Requires a plugin
* | | | to be specified. Limited to
* | | | streaming analyzers.
*/
void PUT_analytics_stop(endpointArgs);
/**
* This endpoint must either be overwritten (by adding a custom
* "analyzer/reload" endpoint) or must not be used. A reload requires
* an external io_service object and can therefore not be conducted by the
* AnalyticsManager itself.
*
* PUT "/analytics/reload"
*
* @brief Reload configuration and initialization of all or only a specific
* analytics plugin.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | - | - | -
* Optional | plugin | all analyzer plugin | reload only the specified
* | | names | plugin
*/
void PUT_analytics_reload(endpointArgs);
/**
* PUT "/analytics/compute"
*
* @brief Query the given analyzer for a certain input unit. Intended for
* "on-demand" analyzers, but works with "streaming" analyzers as
* well.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | plugin | all analyzer plugin | select plugin
* | | names |
* | analyzer| all analyzers of a | select analyzer
* | | plugin |
* Optional | unit | all units of a plugin| select target unit
* | json | true | format response as json
*/
void PUT_analytics_compute(endpointArgs);
/**
* PUT "/analytics/analyzer"
*
* @brief Perform a custom REST PUT action defined at analyzer level.
*
* Queries | key | possible values | explanation
* -------------------------------------------------------------------------
* Required | plugin | all analyzer plugin | select plugin
* | | names |
* | action | see analyzer | select custom action
* | | documentation |
* | custom action may require more queries!
* Optional | analyzer| all analyzers of a | select analyzer
* | | plugin |
* | custom action may allow for more queries!
*/
void PUT_analytics_analyzer(endpointArgs);
};
#endif //PROJECT_ANALYTICSMANAGER_H
......@@ -11,10 +11,8 @@
2. [Instantiating Units](#instantiatingUnits)
3. [MQTT Topics](#mqttTopics)
3. [Rest API](#restApi)
1. [Table of queries](#tableOfQueries)
2. [Ressources for GET request](#resourcesGET)
3. [Ressources for PUT request](#resourcesPUT)
4. [Examples](#restExamples)
1. [List of ressources](#listOfRessources)
2. [Examples](#restExamples)
3. [Plugins](#plugins)
1. [Average Plugin](#averagePlugin)
2. [Writing Plugins](#writingPlugins)
......@@ -321,65 +319,255 @@ DCDBAnalytics provides a REST API that can be used to perform various management
API is functionally identical to that of DCDBPusher, and is hosted at the same address. All requests that are targeted
at the data analytics framework must have a resource path starting with _/analytics_.
### Table of Queries <a name="tableOfQueries"></a>
The DCDBAnalytics REST API shares the same query types as DCDBPusher. In addition, the following queries specific to
this framework are defined:
| Key | Value | Explanation |
|:--- |:----- |:----------- |
| unit | A unit name | Name of the target unit for PUT _compute_ queries
### Resources for GET Request <a name="resourcesGET"></a>
The following is the list of available GET resources for the DCDBAnalytics REST API:
| Ressource | Explanation |
|:--------- |:----------- |
| /analytics/help | Responds with a small cheatsheet which presents all currently supported resources.
| /analytics/plugins | (Discovery) Returns a list of all currently loaded data analytics plugins.
| /analytics/[plugin]/analyzers | (Discovery) Returns a list of all active analyzers for the given plugin.
| /analytics/[plugin]/[analyzer]/units | (Discovery) Returns a list of all units instantiated in the given analyzer. The [analyzer] argument is optional, in which case all units instantiated in all analyzers will be returned.
| /analytics/[plugin]/[analyzer]/sensors | (Discovery) Returns a list of all output sensors associated to the given analyzer. The [analyzer] argument is optional, in which case all output sensors in all analyzers will be returned.
> NOTE &ensp;&ensp;&ensp;&ensp;&ensp; The value of analyzer output sensors can be retrieved with the _compute_ resource
described in the PUT section, or with the [plugin]/[sensor]/avg resource defined in the DCDBPusher REST API.
### Resources for PUT Request <a name="resourcesPUT"></a>
The following is the list of available PUT resources for the DCDBAnalytics REST API:
| Ressource | Explanation |
|:--------- |:----------- |
| /analytics/help | Responds with a small cheatsheet which presents all currently supported resources.
| /analytics/[plugin]/[analyzer]/start | Starts the (stopped) analyzer in the specified plugin. The [analyzer] argument is optional. If not specified, all analyzers in the given plugin will be started.
| /analytics/[plugin]/[analyzer]/start | Stops the (started) analyzer in the specified plugin. The [analyzer] argument is optional. If not specified, all analyzers in the given plugin will be stopped. This resource, together with _start_, can only be used on _streaming_ analyzers.
| /analytics/[plugin]/reload | Reload the configuration and initialization of the given plugin.
| /analytics/[plugin]/[analyzer]/compute | Queries the given analyzer for a certain input unit, and returns the result. This resource should be used with _on-demand_ analyzers, but works with _streaming_ analyzers as well. The target unit must be specified in a query, and if not present, the _root_ unit will be queried instead.
> NOTE &ensp;&ensp;&ensp;&ensp;&ensp; Developers can integrate their custom REST API resources that are plugin-specific,
by implementing the _REST_ method in _AnalyzerTemplate_. To know more about plugin-specific resources, please refer
to the respective documentation.
### List of ressources <a name="listOfRessources"></a>
Prefix `/analytics` left out!
<table>
<tr>
<td colspan="2"><b>Ressource</b></td>
<td colspan="2">Description</td>
</tr>
<tr>
<td>Query</td>
<td>Value</td>
<td>Opt.</td>
<td>Description</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>GET /help</b></td>
<td colspan="2">Return a cheatsheet of possible analytics REST API endpoints.</td>
</tr>
<tr>
<td colspan="4">No queries.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>GET /plugins</b></td>
<td colspan="2">List all currently loaded data analytic plugins.</td>
</tr>
<tr>
<td>json</td>
<td>"true"</td>
<td>Yes</td>
<td>Format response as json.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>GET /sensors</b></td>
<td colspan="2">List all sensors of a specific plugin.</td>
</tr>
<tr>
<td>plugin</td>
<td>All anlalyzer plugin names.</td>
<td>No</td>
<td>Specify the plugin.</td>
</tr>
<tr>
<td>analyzer</td>
<td>All analyzers of a plugin.</td>
<td>Yes</td>
<td>Restrict sensor list to an analyzer.</td>
</tr>
<tr>
<td>json</td>
<td>"true"</td>
<td>Yes</td>
<td>Format response as json.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>GET /units</b></td>
<td colspan="2">List all units of a specific plugin.</td>
</tr>
<tr>
<td>plugin</td>
<td>All analyzer plugin names.</td>
<td>No</td>
<td>Specify the plugin.</td>
</tr>
<tr>
<td>analyzer</td>
<td>All analyzers of a plugin.</td>
<td>Yes</td>
<td>Restrict unit list to an analyzer.</td>
</tr>
<tr>
<td>json</td>
<td>"true"</td>
<td>Yes</td>
<td>Format response as json.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>GET /analyzers</b></td>
<td colspan="2">List all analyzers of a specific plugin.</td>
</tr>
<tr>
<td>plugin</td>
<td>All analyzer plugin names.</td>
<td>No</td>
<td>Specify the plugin.</td>
</tr>
<tr>
<td>json</td>
<td>"true"</td>
<td>Yes</td>
<td>Format response as json.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>PUT /start</b></td>
<td colspan="2">Start all or only a specific plugin. Or only start a specific streaming analyzer within a specific plugin.</td>
</tr>
<tr>
<td>plugin</td>
<td>All plugin names.</td>
<td>Yes</td>
<td>Specify the plugin.</td>
</tr>
<tr>
<td>analyzer</td>
<td>All analyzer names of a plugin.</td>
<td>Yes</td>
<td>Only start the specified analyzer. Requires a plugin to be specified. Limited to streaming analyzers.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>PUT /stop</b></td>
<td colspan="2">Stop all or only a specific plugin. Or only stop a specific streaming analyzer within a specific plugin.</td>
</tr>
<tr>
<td>plugin</td>
<td>All plugin names.</td>
<td>Yes</td>
<td>Specify the plugin.</td>
</tr>
<tr>
<td>analyzer</td>
<td>All analyzer names of a plugin.</td>
<td>Yes</td>
<td>Only stop the specified analyzer. Requires a plugin to be specified. Limited to streaming analyzers.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>PUT /reload</b></td>
<td colspan="2">Reload configuration and initialization of all or only a specific analytics plugin.</td>
</tr>
<tr>
<td>plugin</td>
<td>All plugin names.</td>
<td>Yes</td>
<td>Reload only the specified plugin.</td>
</tr>
</table>
<table>
<tr>
<td colspan="2"><b>PUT /compute</b></td>
<td colspan="2">Query the given analyzer for a certain input unit. Intended for "on-demand" analyzers, but works with "streaming" analyzers as well.</td>
</tr>
<tr>
<td>plugin</td>
<td>All plugin names.</td>
<td>No</td>
<td>Specify the plugin.</td>
</tr>
<tr>
<td>analyzer</td>
<td>All analyzer names of a plugin.</td>
<td>No</td>
<td>Specify the analyzer within the plugin.</td>
</tr>
<tr>
<td>unit</td>
<td>All units of a plugin.</td>
<td>Yes</td>
<td>Select the target unit. Defaults to the root unit if not specified.</td>
</tr>
<tr>
<td>json</td>
<td>"true"</td>
<td>Yes</td>
<td>Format response as json.</td>
</tr>
</table>