+ Parameters
+ ----------
+ nodeType: string
+ plmnId: string
+ nbId: string
+
+ Returns
+ -------
+ NbIdentity()
+
+ Raises
+ ------
+ SdlTypeError: If function's argument is of an inappropriate type.
+ NotConnected: If SDL is not connected to the backend data storage.
+ RejectedByBackend: If backend data storage rejects the request.
+ BackendError: If the backend data storage fails to process the request.
+ """
+ nbid_string: Set[bytes] = self.sdl_get(sdl_namespaces.E2_MANAGER, nodeType + ':' + plmnId + ':' + nbId, usemsgpack=False)
+ if nbid_string is not None:
+ nbid = NbIdentity()
+ nbid.ParseFromString(nbid_string)
+ return nbid
+ return None
+
+ def GetCellList(self, inventoryName):
+ """
+ Returns nodeb served cell list from the saved node data
+ In RNIB SDL key is defined following way: RAN:<inventoryName>
+
+ Parameters
+ ----------
+ nodeType: string
+ plmnId: string
+ nbId: string
+
+ Returns
+ -------
+ ServedCellInfo() in case of ENB
+ ServedNRCell() in case of GNB
+
+ Raises
+ ------
+ SdlTypeError: If function's argument is of an inappropriate type.
+ NotConnected: If SDL is not connected to the backend data storage.
+ RejectedByBackend: If backend data storage rejects the request.
+ BackendError: If the backend data storage fails to process the request.
+ """
+ nodeb = self.GetNodeb(inventoryName)
+ if nodeb is not None:
+ if nodeb.HasField('enb'):
+ return nodeb.enb.served_cells
+ elif nodeb.HasField('gnb'):
+ return nodeb.gnb.served_nr_cells
+ return None
+
+ def GetCellById(self, cell_type, cell_id):
+ """
+ Returns cell info by cell type and id.
+ In RNIB SDL keys are defined based on the cell type:
+ ENB type CELL:<cell_id>
+ GNB type NRCELL:<cell_id>
+
+ Parameters
+ ----------
+ cell_type: string
+ Available cell types
+ - ENB
+ - GNB
+
+ Returns
+ -------
+ Cell()
+
+ Raises
+ ------
+ SdlTypeError: If function's argument is of an inappropriate type.
+ NotConnected: If SDL is not connected to the backend data storage.
+ RejectedByBackend: If backend data storage rejects the request.
+ BackendError: If the backend data storage fails to process the request.
+ """
+ cellstr = None
+ if cell_type == pb_cell.Cell.Type.Name(pb_cell.Cell.LTE_CELL):
+ cellstr = 'CELL'
+ elif cell_type == pb_cell.Cell.Type.Name(pb_cell.Cell.NR_CELL):
+ cellstr = 'NRCELL'
+ if cellstr is not None:
+ cell_string: Set[bytes] = self.sdl_get(sdl_namespaces.E2_MANAGER, cellstr + ':' + cell_id, usemsgpack=False)
+ if cell_string is not None:
+ cell = pb_cell.Cell()
+ cell.ParseFromString(cell_string)
+ return cell
+ return None
+
+ def GetListNodebIds(self):
+ """
+ Returns both enb and gnb NbIdentity list
+
+ Returns
+ -------
+ List: (NbIdentity)
+
+ Raises
+ ------
+ SdlTypeError: If function's argument is of an inappropriate type.
+ NotConnected: If SDL is not connected to the backend data storage.
+ RejectedByBackend: If backend data storage rejects the request.
+ BackendError: If the backend data storage fails to process the request.
+ """
+ nlist1 = self._get_rnib_info(Node.Type.Name(Node.ENB))
+ nlist2 = self._get_rnib_info(Node.Type.Name(Node.GNB))
+
+ for n in nlist2:
+ nlist1.append(n)
+ return nlist1
+
+ def GetCell(self, inventoryName, pci):
+ """
+ Returns cell info using pci
+ In RNIB SDL key is defined following way: PCI:<inventoryName>:<pci hex val>
+
+ Parameters
+ ----------
+ inventoryName: string
+ pci: int
+
+ Returns
+ -------
+ Cell()
+
+ Raises
+ ------
+ SdlTypeError: If function's argument is of an inappropriate type.
+ NotConnected: If SDL is not connected to the backend data storage.
+ RejectedByBackend: If backend data storage rejects the request.
+ BackendError: If the backend data storage fails to process the request.
+ """
+ cell_string: Set[bytes] = self.sdl_get(sdl_namespaces.E2_MANAGER, 'PCI:{0:s}:{1:02x}'.format(inventoryName, pci), usemsgpack=False)
+ if cell_string is not None:
+ cell = pb_cell.Cell()
+ cell.ParseFromString(cell_string)
+ return cell
+ return None
+
+ def GetRanFunctionDefinition(self, inventoryName, ran_function_oid):
+ """
+ Returns GNB ran function definition list based on the ran_function_oid
+ In RNIB SDL key is defined following way: RAN:<inventoryName>
+
+ Parameters
+ ----------
+ inventoryName: string
+ ran_function_oid: int
+
+ Returns
+ -------
+ array of ran_function_definition matching to ran_function_oid
+
+ Raises
+ ------
+ SdlTypeError: If function's argument is of an inappropriate type.
+ NotConnected: If SDL is not connected to the backend data storage.
+ RejectedByBackend: If backend data storage rejects the request.
+ BackendError: If the backend data storage fails to process the request.
+ """
+ nodeb = self.GetNodeb(inventoryName)
+ if nodeb is not None:
+ if nodeb.HasField('gnb') and nodeb.gnb.ran_functions is not None:
+ ranFDList = []
+ for rf in nodeb.gnb.ran_functions:
+ if rf.ran_function_oid == ran_function_oid:
+ ranFDList.append(rf.ran_function_definition)
+ return ranFDList
+ return None