+ if len(e2tAddresses) == 0 {
+ m.logger.Warnf("#E2TInstancesManager.GetE2TInstances - Empty E2T addresses list")
+ return []*entities.E2TInstance{}, nil
+ }
+
+ e2tInstances, err := m.rnibDataService.GetE2TInstances(e2tAddresses)
+
+ if err != nil {
+ m.logger.Errorf("#E2TInstancesManager.GetE2TInstances - Failed retrieving E2T instances list. error: %s", err)
+ return e2tInstances, err
+ }
+
+ if len(e2tInstances) == 0 {
+ m.logger.Warnf("#E2TInstancesManager.GetE2TInstances - Empty E2T instances list")
+ return e2tInstances, nil
+ }
+
+ return e2tInstances, nil
+}
+
+func findActiveE2TInstanceWithMinimumAssociatedRans(e2tInstances []*entities.E2TInstance) *entities.E2TInstance {
+ var minInstance *entities.E2TInstance
+ minAssociatedRanCount := math.MaxInt32
+
+ for _, v := range e2tInstances {
+ if v.State == entities.Active && len(v.AssociatedRanList) < minAssociatedRanCount {
+ minAssociatedRanCount = len(v.AssociatedRanList)
+ minInstance = v
+ }
+ }
+
+ return minInstance
+}
+
+func (m *E2TInstancesManager) AddE2TInstance(e2tAddress string) error {
+