Verify all clean function added for unit tests
[ric-plt/submgr.git] / pkg / control / sdl_restSubsDb.go
index 9178cb6..a0afbc0 100644 (file)
@@ -176,3 +176,14 @@ func (c *Control) RemoveAllRESTSubscriptionsFromSdl() error {
        }
        return nil
 }
+
+func (c *Control) GetRESTKeyCount() (int, error) {
+
+       // Get all keys
+       keys, err := c.restSubsDb.GetAll(restSubSdlNs)
+       if err != nil {
+               c.UpdateCounter(cSDLReadFailure)
+               return 0, fmt.Errorf("SDL: GetRESTKeyCount(), GetAll(). Error while reading E2 subscriptions  keys from DBAAS %s\n", err.Error())
+       }
+       return len(keys), nil
+}