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,
}