Adding VIM refresh period to RO charm config

Refresh period is allowed >=60 or -1. Setting it -1
will disable the updating VM status.

Change-Id: I94ec37f68303128ba7af67f14121436005fd9259
Signed-off-by: aticig <gulsum.atici@canonical.com>
diff --git a/installers/charm/ro/src/charm.py b/installers/charm/ro/src/charm.py
index b196b19..b76fba7 100755
--- a/installers/charm/ro/src/charm.py
+++ b/installers/charm/ro/src/charm.py
@@ -81,6 +81,7 @@
     image_pull_policy: str
     debug_mode: bool
     security_context: bool
+    period_refresh_active: Optional[int]
 
     @validator("log_level")
     def validate_log_level(cls, v):
@@ -122,6 +123,14 @@
     def certificates_dict(cls):
         return _extract_certificates(cls.certificates) if cls.certificates else {}
 
+    @validator("period_refresh_active")
+    def validate_vim_refresh_period(cls, v):
+        if v and v < 60 and v != -1:
+            raise ValueError(
+                "Refresh Period is too tight, insert >= 60 seconds or disable using -1"
+            )
+        return v
+
 
 class RoCharm(CharmedOsmBase):
     """GrafanaCharm Charm."""
@@ -271,7 +280,12 @@
                 "OSMRO_LOG_LEVEL": config.log_level,
             }
         )
-
+        if config.period_refresh_active:
+            container_builder.add_envs(
+                {
+                    "OSMRO_PERIOD_REFRESH_ACTIVE": config.period_refresh_active,
+                }
+            )
         if config.enable_ng_ro:
             # Add secrets to the pod
             mongodb_secret_name = f"{self.app.name}-mongodb-secret"