X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Ftemporal%2Factivities%2Fvnf.py;h=9aca0e304bc34a704f395894aab1aa832570c34c;hb=0a28d984ff2622a719d882168b220d001108db40;hp=0c5b22e2fadb469ee65ed317e0aa54dd23ce6e33;hpb=63c7ce8974a2d4ae295b5d61a81386bf6af734f2;p=osm%2Fcommon.git diff --git a/osm_common/temporal/activities/vnf.py b/osm_common/temporal/activities/vnf.py index 0c5b22e..9aca0e3 100644 --- a/osm_common/temporal/activities/vnf.py +++ b/osm_common/temporal/activities/vnf.py @@ -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()