Define the schema 57/13457/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 25 Sep 2024 12:46:10 +0000 (14:46 +0200)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 25 Sep 2024 12:46:10 +0000 (14:46 +0200)
- add tp/interface types

Issue-ID: OAM-415
Change-Id: Ie6f761f22e64c1162b1ae20b59853021b5457592
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/network-generator/network_generation/model/python/o_ran_termination_point.py

index baba503..8b8d76b 100644 (file)
@@ -82,32 +82,15 @@ class ORanTerminationPoint(ORanObject):
         self._parent = value
 
     def to_topology(self) -> dict[str, Any]:
-        result: dict[str, Any] = {"tp-id": self.name}
+        result: dict[str, Any] = {
+            "tp-id": self.name,
+            "o-ran-sc-network:uuid": self.id,
+            "o-ran-sc-network:type": self.type,
+        }
         if self.supporter and type(self.parent) is not int:
-            network_ref: str = ""
-            match str(type(self.parent)):
-                case "<class 'model.python.o_ran_smo.ORanSmo'>":
-                    network_ref = self.parent.parent.id
-                case "<class 'model.python.o_ran_near_rt_ric.ORanNearRtRic'>":
-                    network_ref = self.parent.parent.parent.id
-                case "<class 'model.python.o_ran_cu.ORanCu'>":
-                    network_ref = self.parent.parent.parent.parent.id
-                case "<class 'model.python.o_ran_du.ORanDu'>":
-                    network_ref = self.parent.parent.parent.parent.parent.id
-                case "<class 'model.python.o_ran_cloud_du.ORanCloudDu'>":
-                    network_ref = self.parent.parent.parent.parent.parent.id
-                case "<class 'model.python.o_ran_ru.ORanRu'>":
-                    network_ref = (
-                        self.parent.parent.parent.parent.parent.parent.id
-                    )
-                case _:
-                    print("unknown: implement " + str(type(self.parent)))
-                    network_ref = "unknown: implement " + str(
-                        type(self.parent))
-
             result["supporting-termination-point"] = [
                 {
-                    "network-ref": network_ref,
+                    "network-ref": self.parent.network.id,
                     "node-ref": self.parent.name,
                     "tp-ref": self.supporter,
                 }