[
https://issues.apache.org/jira/browse/METRON-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15832532#comment-15832532
]
ASF GitHub Bot commented on METRON-503:
---------------------------------------
Github user merrimanr commented on a diff in the pull request:
https://github.com/apache/incubator-metron/pull/316#discussion_r97170146
--- Diff: metron-interface/metron-rest/README.md ---
@@ -0,0 +1,458 @@
+# Metron REST and Configuration UI
+
+This UI exposes and aids in sensor configuration.
+
+## Prerequisites
+
+* A running Metron cluster
+* A running instance of MySQL
+* Java 8 installed
+* Storm CLI and Metron topology scripts (start_parser_topology.sh,
start_enrichment_topology.sh, start_elasticsearch_topology.sh) installed
+
+## Installation
+1. Package the Application with Maven:
+ ```
+ mvn clean package
+ ```
+
+1. Untar the archive in the target directory. The directory structure
will look like:
+ ```
+ bin
+ start.sh
+ lib
+ metron-rest-version.jar
+ ```
+
+1. Install Hibernate by downloading version 5.0.11.Final from
(http://hibernate.org/orm/downloads/). Unpack the archive and set the
HIBERNATE_HOME environment variable to the absolute path of the top level
directory.
+ ```
+ export HIBERNATE_HOME=/path/to/hibernate-release-5.0.11.Final
+ ```
+
+1. Install the MySQL client by downloading version 5.1.40 from
(https://dev.mysql.com/downloads/connector/j/). Unpack the archive and set the
MYSQL_CLIENT_HOME environment variable to the absolute path of the top level
directory.
+ ```
+ export MYSQL_CLIENT_HOME=/path/to/mysql-connector-java-5.1.40
+ ```
+
+1. Create a MySQL user for the Config UI
(http://dev.mysql.com/doc/refman/5.7/en/adding-users.html).
+
+1. Create a Config UI database in MySQL with this command:
+ ```
+ CREATE DATABASE IF NOT EXISTS metronrest
+ ```
+
+1. Create an `application.yml` file with the contents of
[application-docker.yml](src/main/resources/application-docker.yml).
Substitute the appropriate Metron service urls (Kafka, Zookeeper, Storm, etc)
in properties containing `${docker.host.address}` and update the
`spring.datasource.username` and `spring.datasource.password` properties using
the MySQL credentials from step 4.
+
+1. Start the UI with this command:
+ ```
+ ./bin/start.sh /path/to/application.yml
+ ```
+
+## Usage
+
+The exposed REST endpoints can be accessed with the Swagger UI at
http://host:port/swagger-ui.html#/. The default port is 8080 but can be
changed in application.yml by setting "server.port" to the desired port. Users
can be added with this SQL statement:
+```
+use metronrest;
+insert into users (username, password, enabled) values
('your_username','your_password',1);
+insert into authorities (username, authority) values ('your_username',
'ROLE_USER');
+```
+Users can be added to additional groups with this SQL statement:
+```
+use metronrest;
+insert into authorities (username, authority) values ('your_username',
'your_group');
+```
+
+## API
+
+Request and Response objects are JSON formatted. The JSON schemas are
available in the Swagger UI.
+
+| |
+| ---------- |
+| [ `GET /api/v1/global/config`](#get-apiv1globalconfig)|
+| [ `DELETE /api/v1/global/config`](#delete-apiv1globalconfig)|
+| [ `POST /api/v1/global/config`](#post-apiv1globalconfig)|
+| [ `GET /api/v1/grok/list`](#get-apiv1groklist)|
+| [ `POST /api/v1/grok/validate`](#post-apiv1grokvalidate)|
+| [ `GET /api/v1/kafka/topic`](#get-apiv1kafkatopic)|
+| [ `POST /api/v1/kafka/topic`](#post-apiv1kafkatopic)|
+| [ `GET /api/v1/kafka/topic/{name}`](#get-apiv1kafkatopic{name})|
+| [ `DELETE /api/v1/kafka/topic/{name}`](#delete-apiv1kafkatopic{name})|
+| [ `GET
/api/v1/kafka/topic/{name}/sample`](#get-apiv1kafkatopic{name}sample)|
+| [ `GET
/api/v1/sensor/enrichment/config`](#get-apiv1sensorenrichmentconfig)|
+| [ `GET
/api/v1/sensor/enrichment/config/list/available`](#get-apiv1sensorenrichmentconfiglistavailable)|
+| [ `DELETE
/api/v1/sensor/enrichment/config/{name}`](#delete-apiv1sensorenrichmentconfig{name})|
+| [ `POST
/api/v1/sensor/enrichment/config/{name}`](#post-apiv1sensorenrichmentconfig{name})|
+| [ `GET
/api/v1/sensor/enrichment/config/{name}`](#get-apiv1sensorenrichmentconfig{name})|
+| [ `GET /api/v1/sensor/indexing/config`](#get-apiv1sensorindexingconfig)|
+| [ `DELETE
/api/v1/sensor/indexing/config/{name}`](#delete-apiv1sensorindexingconfig{name})|
+| [ `POST
/api/v1/sensor/indexing/config/{name}`](#post-apiv1sensorindexingconfig{name})|
+| [ `GET
/api/v1/sensor/indexing/config/{name}`](#get-apiv1sensorindexingconfig{name})|
+| [ `POST /api/v1/sensor/parser/config`](#post-apiv1sensorparserconfig)|
+| [ `GET /api/v1/sensor/parser/config`](#get-apiv1sensorparserconfig)|
+| [ `GET
/api/v1/sensor/parser/config/history`](#get-apiv1sensorparserconfighistory)|
+| [ `GET
/api/v1/sensor/parser/config/history/history/{name}`](#get-apiv1sensorparserconfighistoryhistory{name})|
+| [ `GET
/api/v1/sensor/parser/config/history/{name}`](#get-apiv1sensorparserconfighistory{name})|
+| [ `GET
/api/v1/sensor/parser/config/list/available`](#get-apiv1sensorparserconfiglistavailable)|
+| [ `POST
/api/v1/sensor/parser/config/parseMessage`](#post-apiv1sensorparserconfigparsemessage)|
+| [ `GET
/api/v1/sensor/parser/config/reload/available`](#get-apiv1sensorparserconfigreloadavailable)|
+| [ `DELETE
/api/v1/sensor/parser/config/{name}`](#delete-apiv1sensorparserconfig{name})|
+| [ `GET
/api/v1/sensor/parser/config/{name}`](#get-apiv1sensorparserconfig{name})|
+| [ `GET /api/v1/storm`](#get-apiv1storm)|
+| [ `GET /api/v1/storm/client/status`](#get-apiv1stormclientstatus)|
+| [ `GET /api/v1/storm/enrichment`](#get-apiv1stormenrichment)|
+| [ `GET
/api/v1/storm/enrichment/activate`](#get-apiv1stormenrichmentactivate)|
+| [ `GET
/api/v1/storm/enrichment/deactivate`](#get-apiv1stormenrichmentdeactivate)|
+| [ `GET /api/v1/storm/enrichment/start`](#get-apiv1stormenrichmentstart)|
+| [ `GET /api/v1/storm/enrichment/stop`](#get-apiv1stormenrichmentstop)|
+| [ `GET /api/v1/storm/indexing`](#get-apiv1stormindexing)|
+| [ `GET
/api/v1/storm/indexing/activate`](#get-apiv1stormindexingactivate)|
+| [ `GET
/api/v1/storm/indexing/deactivate`](#get-apiv1stormindexingdeactivate)|
+| [ `GET /api/v1/storm/indexing/start`](#get-apiv1stormindexingstart)|
+| [ `GET /api/v1/storm/indexing/stop`](#get-apiv1stormindexingstop)|
+| [ `GET
/api/v1/storm/parser/activate/{name}`](#get-apiv1stormparseractivate{name})|
+| [ `GET
/api/v1/storm/parser/deactivate/{name}`](#get-apiv1stormparserdeactivate{name})|
+| [ `GET
/api/v1/storm/parser/start/{name}`](#get-apiv1stormparserstart{name})|
+| [ `GET
/api/v1/storm/parser/stop/{name}`](#get-apiv1stormparserstop{name})|
+| [ `GET /api/v1/storm/{name}`](#get-apiv1storm{name})|
+| [ `GET /api/v1/transformation/list`](#get-apiv1transformationlist)|
+| [ `GET
/api/v1/transformation/list/functions`](#get-apiv1transformationlistfunctions)|
+| [ `GET
/api/v1/transformation/list/simple/functions`](#get-apiv1transformationlistsimplefunctions)|
+| [ `POST
/api/v1/transformation/validate`](#post-apiv1transformationvalidate)|
+| [ `POST
/api/v1/transformation/validate/rules`](#post-apiv1transformationvalidaterules)|
+| [ `GET /api/v1/user`](#get-apiv1user)|
+
+### `GET /api/v1/global/config`
--- End diff --
There is a utility included (ReadMeUtils) that generates the README from
the swagger so I would consider it the source of truth. I like the idea of
putting Swagger into our general docs though.
> Metron REST API
> ---------------
>
> Key: METRON-503
> URL: https://issues.apache.org/jira/browse/METRON-503
> Project: Metron
> Issue Type: New Feature
> Reporter: Ryan Merriman
> Assignee: Ryan Merriman
> Attachments: Metron REST API.docx
>
>
> As discussed on the dev list ([DISCUSS] Metron REST API Requirements), this
> Jira includes adding a REST API to Metron.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)