From 9f3017176de38c7f340db0af0621cb368301a108 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta Date: Wed, 13 Mar 2024 14:02:50 +0530 Subject: [PATCH] docs: updated microservice deployment --- README.md | 4 +- .../libbbfdm-api_datamodel_as_microservice.md | 43 +++++++++++-------- tools/tools_input.json | 4 +- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b6709d43..3842e260 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,11 @@ All supported tools are presented in this file[BBFDM Tools](./tools/README.md) | Device.PeriodicStatistics. | periodicstats | https://dev.iopsys.eu/bbf/periodicstats.git | | Device.SoftwareModules. | swmodd | https://dev.iopsys.eu/lcm/swmodd.git | | Device.Time. | timemngr | https://dev.iopsys.eu/bbf/timemngr.git | -| Device.DynamicDNS. | ddnsmngr | https://dev.iopsys.eu/bbf/ddnsmngr.git | +| Device.DynamicDNS. | ddnsmngr | https://dev.iopsys.eu/bbf/ddnsmngr.git | | Device.Hosts. | hostmngr | https://dev.iopsys.eu/iopsys/hostmngr.git | | Device.Services.VoiceService. | tr104 | https://dev.iopsys.eu/voice/tr104.git | +| Device.NAT.PortTrigger. | port-trigger | https://dev.iopsys.eu/network/port-trigger.git | +| Device.DNS. | dnsmngr | https://dev.iopsys.eu/network/dnsmngr.git | | Device.DSL. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | | Device.FAST. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | | Device.ATM. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | diff --git a/docs/guide/libbbfdm-api_datamodel_as_microservice.md b/docs/guide/libbbfdm-api_datamodel_as_microservice.md index 0b9cc170..bb8f45eb 100644 --- a/docs/guide/libbbfdm-api_datamodel_as_microservice.md +++ b/docs/guide/libbbfdm-api_datamodel_as_microservice.md @@ -60,11 +60,14 @@ Micro-service approach, disintegrate the plugins further and run them as individ It's a three step process, if DotSO or JSON plugin already present, if not refer to the plugins document. 1. Install the DotSO/JSON plugin to non-bbf plugin location -2. Create an input.json file, like below +2. Create an json file with required input parameters, like below ```json { "daemon": { + "config": { + "loglevel": "1" + }, "input": { "type": "JSON", // JSON or DotSO "name": "/etc/bulkdata/bulkdata.json" // Path of the plugin @@ -79,28 +82,30 @@ It's a three step process, if DotSO or JSON plugin already present, if not refer } ``` -3. Add an uci-default script to add the micro-service in bbfdm +3. Place this json file in micro-service(`/etc/bbfdm/micro_services`) directory ```bash -$ cat bulkdata/files/etc/uci-defaults/50_add_bulkdata_dm_microservice -#!/bin/sh - -if ! uci -q get bbfdm.bulkdata >/dev/null; then - uci set bbfdm.bulkdata=micro_service - uci set bbfdm.bulkdata.enable=1 - uci set bbfdm.bulkdata.input_json="/etc/bulkdata/input.json" - uci set bbfdm.bulkdata.loglevel=1 -fi +$ cat /etc/bbfdm/micro_services/bulkdata.json +{ + "daemon": { + "config": { + "loglevel": "1" + }, + "input": { + "type": "JSON", + "name": "/etc/bulkdata/bulkdata.json" + }, + "output": { + "type": "UBUS", + "parent_dm": "Device.", + "object": "BulkData", + "root_obj": "bbfdm" + } + } +} ``` -Which adds a micro-service handler into bbfdm uci - -```bash -config micro_service 'bulkdata' - option enable '1' - option input_json '/etc/bulkdata/input.json' - option loglevel '1' -``` +Which then gets started by `bbfdmd` init script. ## When to switch to micro-service model There are few parameters which can help in answer this query, diff --git a/tools/tools_input.json b/tools/tools_input.json index c34bd756..fdec1b4e 100644 --- a/tools/tools_input.json +++ b/tools/tools_input.json @@ -176,9 +176,9 @@ "proto": "git", "dm_files": [ "bbf_plugin/dsl.c", - "bbf_plugin/fast.c", + "bbf_plugin/fast.c", "bbf_plugin/atm.c", - "bbf_plugin/ptm.c" + "bbf_plugin/ptm.c" ] } ],