Base class for get model names activity 58/13658/3
authorDaniel Arndt <daniel.arndt@canonical.com>
Mon, 10 Jul 2023 12:49:38 +0000 (09:49 -0300)
committeraticig <gulsum.atici@canonical.com>
Tue, 11 Jul 2023 13:07:56 +0000 (15:07 +0200)
Change-Id: Ia7eeb2a89eab5c3c4364de7bb6b8f2313d12163f
Signed-off-by: Daniel Arndt <daniel.arndt@canonical.com>
osm_common/temporal/activities/vnf.py

index 0c5b22e..9aca0e3 100644 (file)
@@ -417,3 +417,51 @@ class SetVnfModel(BaseActivity):
 
     async def __call__(self, activity_input: Input) -> None:
         raise NotImplementedError()
+
+
+class GetModelNames(BaseActivity):
+    """Gets the models of VNFs associated with the NS.
+
+    Collaborators:
+        DB read:           vnfrs
+
+    Raises (retryable):
+        DbException: If DB read operations fail
+
+    Activity Lifecycle:
+        This activity should complete relatively quickly (less than a second).
+
+        This activity will not report a heartbeat due to its
+        short-running nature.
+
+        This is an idempotent activity.
+    """
+
+    @dataclass
+    class Input:
+        """
+        Attributes:
+        -----------
+        ns_uuid : str
+            The UUID of the NS from which we are looking for the model names.
+        """
+
+        ns_uuid: str
+
+    @dataclass
+    class Output:
+        """
+        Attributes:
+        -----------
+        model_names: set[str]
+            The set of model names associated with the NS.
+        """
+
+        model_names: set[str]
+
+    def __init__(self, db: DbBase):
+        super().__init__()
+        self.db: DbBase = db
+
+    async def __call__(self, activity_input: Input) -> Output:
+        raise NotImplementedError()