-# Copyright 2024 highstreet technologies
+# Copyright 2024 highstreet technologies GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
"""
Module for a class representing a O-RAN Network
"""
-import xml.etree.ElementTree as ET
import os
+import uuid
+import xml.etree.ElementTree as ET
+from datetime import datetime, timezone
from typing import Any, cast
import network_generation.model.python.hexagon as Hexagon
)
from network_generation.model.python.point import Point
+
# Define the "IORanNetwork" interface
-IORanNetwork = IORanObject
+class IORanNetwork(IORanObject):
+ network: Any
class ORanNetwork(ORanObject):
__my_default_value: IORanNetwork = cast(IORanNetwork, ORanObject.default())
+ __my_network_id = str(uuid.uuid5(uuid.NAMESPACE_DNS, "Operator A"))
+
+ # Get the current date and time in UTC
+ __current_time = datetime.now(timezone.utc)
+ # Format the time string as required
+ __time_string = __current_time.strftime("%Y-%m-%dT%H:%M:%SZ")
+ __my_valid_for = {
+ "startDateTime": f'{__current_time.strftime("%Y")}-01-01T00:00:00Z',
+ "endDateTime": f'{__current_time.strftime("%Y")}-12-31T23:59:59Z',
+ }
+
# constructor
def __init__(
self,
configuration: dict[str, dict],
data: dict[str, Any] = cast(dict[str, Any], __my_default_value),
- **kwargs: dict[str, Any]
+ **kwargs: dict[str, Any],
) -> None:
o_ran_network_data: IORanNetwork = self._to_o_ran_network_data(data)
super().__init__(cast(dict[str, Any], o_ran_network_data), **kwargs)
"oRanNearRtRicSpiralRadiusOfOCus": configuration["pattern"][
"nearRtRic"
]["oRanCuSpiralRadius"],
- "oRanCuSpiralRadiusOfODus": configuration["pattern"][
- "oRanCu"
- ]["oRanDuSpiralRadius"],
+ "oRanCuSpiralRadiusOfODus": configuration["pattern"]["oRanCu"][
+ "oRanDuSpiralRadius"
+ ],
"oRanDuSpiralRadiusOfTowers": configuration["pattern"][
"oRanDu"
]["towerSpiralRadius"],
"geoLocation": self.center,
"layout": layout,
"parent": self,
+ "network": self,
}
)
"network": [
{
"network-id": self.id,
+ "o-ran-sc-network:name": self.name,
"node": nodes,
"ietf-network-topology:link": links,
}