4. Components and APIs

4.1. Components

Table 4.1 Components
/ Main site
for Component
Component API
MongoDB MongoDB site MongoDB doc.  
Postgres PostgreSQL site PostgreSQL doc.  
Kong API gateway
(Community Edition)
Kong site Kong doc.  
Redis Redis site Redis doc.  
Zookeeper Zookeeper site Zookeeper doc.  
Kafka Kafka site Kafka doc.  
Auth GitHub - auth Auth doc. API - auth
History GitHub - history   API - history
Device Manager GitHub - DeviceManager DeviceManager doc. API - DeviceManager
Image Manager GitHub - image-manager   API - image-manager
GUI GitHub - GUI    
Flowbroker GitHub - flowbroker   API - flowbroker
Databroker GitHub - data-broker   API - data-broker
Iotagent Mosca
GitHub - iotagent-mosca    
Data Manager GitHub - Data Manager   API - Data Manager
Cron GitHub - Cron   API - Cron

4.2. Exposed APIs (API Gateway)

The API gateway used in dojot reroutes some of endpoints from component. The following table shows which endpoint exposed by the API gateway is mapped to which component endpoint, its component endpoint Documentation and whether the endpoint needs authentication when used via API Gateway. See more about how using API in Using API interface.

Table 4.2 Exposed endpoints
Endpoint exposed
by the API gateway
GUI / /   No
Device Manager /device /device See more Yes
Device Manager /template /template See more Yes
Flowbroker /flows / See more Yes
Auth /auth / See more No
Auth /auth/revoke /revoke   No
Auth /auth/user /user See more Yes
Auth /auth/pap /pap See more Yes
History /history / See more Yes
EJBCA REST /sign /sign See more Yes
EJBCA REST /ca /ca See more Yes
EJBCA REST /user /user See more Yes
Data Manager /import /import See more Yes
Data Manager /export /export See more Yes
Cron /cron /cron See more Yes
Image Manager /fw-image / See more Yes
Data Broker
Data Broker /subscription /subscription   Yes
Data Broker /stream /stream   Yes
Data Broker /socket.io /socket.io See more No

NOTE: Some of the endpoints from component aren’t exposed, but are used internally.

In addition, the API gateway reroutes the endpoints with their ports from component, so that they become uniform: all of them are accessible through the same port (default is TCP port 8000), see the following table.

Table 4.3 Original endpoints to The API gateway
Component Original endpoint Gateway Endpoint
GUI host:80/ host:8000/
Device Manager host:5000/device host:8000/device
Device Manager host:5000/template host:8000/template
Flowbroker host:80/ host:8000/flows
Auth host:5000/ host:8000/auth
Auth host:5000/auth/revoke host:8000/auth/revoke
Auth host:5000/user host:8000/auth/user
Auth host:5000/pap host:8000/auth/pap
History host:8000/ host:8000/history
EJBCA REST host:5583/sign host:8000/sign
EJBCA REST host:5583/ca host:8000/ca
Data Manager host:3000/import host:8000/import
Data Manager host:3000/export host:8000/export
Cron host:5000/cron host:8000/cron
Image Manager host:5000/ host:8000/fw-image
Data Broker host:80/device/{{deviceID}}/latest host:8000/device/{deviceID}/latest
Data Broker host:80/subscription host:8000/subscription
Data Broker host:80/stream host:8000/stream
Data Broker host:80/socket.io host:8000/socket.io

4.3. Kafka messages

These are the messages sent by components and their subjects. If you are developing a new internal component (such as a new IoT agent), see API - data-broker to check how to receive messages sent by other components in dojot.

Table 4.4 Original endpoints
Component Message Subject
DeviceManager Device CRUD (Messages - DeviceManager) dojot.device-manager.device
iotagent-mosca Device data update (Messages - iotagent-mosca) device-data
auth Tenants creation/removal (Messages - auth) dojot.tenancy