From 34fdca8bce06ae78b5593956d11fe5dbe3daf965 Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Fri, 6 May 2022 10:43:58 +0100 Subject: Watchdog Process-Make Configurable Make time configurable for the watchdog process. Add documentation outlining this. Issue-ID: CPS-875 Change-Id: I1307c82d02789097efda1ba981eb1fd36c9efc38 Signed-off-by: DylanB95EST --- cps-application/src/main/resources/application.yml | 3 +++ .../api/inventory/sync/ModuleSyncWatchdog.java | 2 +- docs/deployment.rst | 28 +++++++++++++++------- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml index 138f4e188..00424a587 100644 --- a/cps-application/src/main/resources/application.yml +++ b/cps-application/src/main/resources/application.yml @@ -137,3 +137,6 @@ ncmp: password: ${DMI_PASSWORD} api: base-path: dmi + timers: + advised-modules-sync: + sleep-time-ms: 30000 \ No newline at end of file diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java index 69413171d..0d8f85219 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java @@ -38,7 +38,7 @@ public class ModuleSyncWatchdog { /** * Execute Cm Handle poll which changes the cm handle state from 'ADVISED' to 'READY'. */ - @Scheduled(fixedDelay = 30000) + @Scheduled(fixedDelayString = "${ncmp.timers.advised-modules-sync.sleep-time-ms}") public void executeAdvisedCmHandlePoll() { YangModelCmHandle newAdvisedCmHandle = syncUtils.getAnAdvisedCmHandle(); while (newAdvisedCmHandle != null) { diff --git a/docs/deployment.rst b/docs/deployment.rst index 06e1ddcc0..7dd4494f2 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -157,8 +157,10 @@ To get a listing of the cps-core Pods, run the following command: dev-cps-core-postgres-primary-f7766d46c-s9d5b 1/1 Running 0 24h dev-cps-core-postgres-replica-84659d68f9-6qnt4 1/1 Running 0 24h +.. note:: + The CPS Service will have to be restarted each time a change is made to a configurable property. -Additional Cps-Core Customizations +Additional CPS-Core Customizations ================================== The following table lists some properties that can be specified as Helm chart @@ -181,14 +183,6 @@ Any spring supported property can be configured by providing in ``config.additio | | | | | | See also :ref:`cps_common_credentials_retrieval`. | | +---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ -| config.dmiPluginUserName | User name used by cps-core to authenticate themselves for using ncmp-dmi-plugin service. | ``dmiuser`` | -+---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ -| config.dmiPluginUserPassword | Internal password used by cps-core to connect to ncmp-dmi-plugin service. | Not defined | -| | | | -| | If not defined, the password is generated when deploying the application. | | -| | | | -| | See also :ref:`cps_common_credentials_retrieval`. | | -+---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ | postgres.config.pgUserName | Internal user name used by cps-core to connect to its own database. | ``cps`` | +---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ | postgres.config.pgUserPassword | Internal password used by cps-core to connect to its own database. | Not defined | @@ -287,6 +281,22 @@ Any spring supported property can be configured by providing in ``config.additio | maximumPoolSize | including both idle and in-use connections. | | +---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ +Additional CPS-NCMP Customizations +================================== ++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ +| config.dmiPluginUserName | User name used by cps-core to authenticate themselves for using ncmp-dmi-plugin service. | ``dmiuser`` | ++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ +| config.dmiPluginUserPassword | Internal password used by cps-core to connect to ncmp-dmi-plugin service. | Not defined | +| | | | +| | If not defined, the password is generated when deploying the application. | | +| | | | +| | See also :ref:`cps_common_credentials_retrieval`. | | ++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ +| config.timers.advised-modules-sync | Specifies the delay in milliseconds in which the module sync watch dog will wake again after finishing. | ``30000`` | +| .sleep-time-ms | | | +| | | | ++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+ + CPS-Core Docker Installation ============================ -- cgit 1.2.3-korg