X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fsdl_e2SubsDb.go;h=d1830dee9df6f11ac43ff1e648dd0285a9da6a0e;hb=afadb6df033657afef927964aa637ba7c8fc0880;hp=3305e4180c4b725c3cc23e4802d7e9910124236e;hpb=40a8b1be512bd1dc42a681685980c4ac99b298a4;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/sdl_e2SubsDb.go b/pkg/control/sdl_e2SubsDb.go index 3305e41..d1830de 100644 --- a/pkg/control/sdl_e2SubsDb.go +++ b/pkg/control/sdl_e2SubsDb.go @@ -223,3 +223,14 @@ func (c *Control) RemoveAllSubscriptionsFromSdl() error { } return nil } + +func (c *Control) GetE2KeyCount() (int, error) { + + // Get all keys + keys, err := c.e2SubsDb.GetAll(e2SubSdlNs) + if err != nil { + c.UpdateCounter(cSDLReadFailure) + return 0, fmt.Errorf("SDL: GetE2KeyCount(), GetAll(). Error while reading E2 subscriptions keys from DBAAS %s\n", err.Error()) + } + return len(keys), nil +}