Implement Health Check Api.
[ric-plt/a1.git] / a1-go / pkg / resthooks / resthooks.go
index c57c2e8..8fb07df 100644 (file)
@@ -95,6 +95,15 @@ func createResthook(sdlInst iSdl, rmrSenderInst rmr.IRmrSender) *Resthook {
        }
 }
 
+func (rh *Resthook) GetA1Health() bool {
+       data, _ := rh.db.GetAll(a1MediatorNs)
+       if data != nil {
+               a1.Logger.Debug("Database connected and A1 is healthy")
+               return true
+       }
+       return false
+}
+
 func (rh *Resthook) GetAllPolicyType() []models.PolicyTypeID {
 
        var policyTypeIDs []models.PolicyTypeID