Audit module is the most important module, it provides user management, licensing and auditing services to the other modules. It automatically recognizes other modules, that are running on the same machine or on different servers - either using multicast or IP white list. Audit module is the main communication channel for the BellaDati IoT console too.
Running module
Audit can be started using the provided starting script, automatically when installed using the installer or manually, by executing following command:
java -Dapplication.name=audit-1 -Dvertx.hazelcast.config=cluster.xml -Dfile.encoding=UTF8 -jar iot-collector-audit-x.y.z.jar -conf config.json
Runtime parameters explained
Parameter name | Description | Example |
---|---|---|
-Dapplication.name | Mandatory JVM parameter. Defines the name of the audit. This is usefull in situations, when there are multiple audits in your infrastructure and you need to distinguish them. | -Dapplication.name=audit-1 |
-Dvertx.hazelcast.config | Mandatory JVM parameter. Specifies the file containing the cluster configuration. | -Dvertx.hazelcast.config=cluster.xml |
-Dfile.encoding | Optional JVM parameter. Specifies the encoding used when working with byte streams or reading messages and files. | -Dfile.encoding=UTF8 |
-jar | -jar iot-collector-audit-x.y.z.jar | |
-conf | -conf config.json |
Configuration
Configuration is provided in config.json, which is passed to the application as -conf parameter
Configuration options
Option/Entity | Type | Default | Description |
---|---|---|---|
instance | Object | Contains configuration for audit instance | |
instance.license | String | empty | License provided by BellaDati |
instance.name | String | empty | Name of the instance |
instance.db | Object | Contains database configuration. You can keep the default values unless you use some specific database. | |
instance.db.url | String | Database connection string | |
instance.db.user | String | Database username | |
instance.db.password | String | Database password | |
instance.db.driverclass | String | Database JDBC driver class | |
instance.db.max_pool_size | Integer | Database maximum pool size | |
instance.db.drop | Boolean | Flag indicating if database should be dropped during module startup | |
instance.auth | Object | Configuration of administrators common for all modules | |
instance.auth.enabled | Boolean | Flag indicating if administrator authentication is enabled | |
instance.auth.drop | Boolean | Flag indicating if administrators should be dropped during module startup | |
instance.auth.merge | Boolean | Flag indicating if administrators should be merged during module startup | |
instance.auth.users | Object | Array of administrators to merge (insert new or update existing) | |
Configuration sample
Roles
This module supports following roles:
Verticle | Role | Permitted operations |
---|---|---|
Instance | ADMIN | All operations in all modules |
Audit | VIEWER | GET_STATUS, GET_MODULES, GET_SENSORS |
Module states
This module can have one of following statuses:
Verticle | Status | Description |
---|---|---|
Audit | UP | Verticle is up and running. It operates without any specific limitations. |
PAUSED | Verticle is paused but it operates without any specific limitations. Request to "GET /" ends with response code 405. |
Audit module API
This module provides following HTTP endpoints:
Path | Method | Description | URL Parameters | Example |
---|---|---|---|---|
/ | GET | Returns plain text with ECHO message (should be used in load balancer to detect UP/DOWN status) | - | https://localhost:8000/ |
/status | GET | Returns JSON object that contains internal state of audit verticle (e.g. total count of sensors) | - | https://localhost:8000/status |
/modules | GET | Returns JSON array that contains all modules registered in service discovery infrastructure | - | https://localhost:8000/modules |
/sensors | GET | Returns JSON array that contains status of all sensors | - order = "ASC" / "DESC" (default: "ASC") - start = from timestamp (default: 0) - stop = to timestamp - receiver_id = receiver identification - sensor_id = sensor identification - limit = page size (default: 100) | https://localhost:8000/sensors |
/pause | GET | Sets status PAUSED for audit verticle immediately. Returns response from "GET /status" endpoint (see above) | - | https://localhost:8000/pause |
/resume | GET | Sets status UP for audit verticle immediately. Returns response from "GET /status" endpoint (see above) | - | https://localhost:8000/resume |
/logout | GET | Executes logout of currently logged in user | - | https://localhost:8000/logout |
Overview
Content Tools