Code Review
/
ric-plt
/
ricdms.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Health check API for service
[ric-plt/ricdms.git]
/
pkg
/
restful
/
restful.go
diff --git
a/pkg/restful/restful.go
b/pkg/restful/restful.go
index
2b8dc96
..
4255e2b
100644
(file)
--- a/
pkg/restful/restful.go
+++ b/
pkg/restful/restful.go
@@
-23,14
+23,22
@@
import (
"log"
"os"
"log"
"os"
+ ph "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/health"
"gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi"
"gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations"
"gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi"
"gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations"
+ "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/health"
+ "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/resthooks"
"gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/ricdms"
"github.com/go-openapi/loads"
"gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/ricdms"
"github.com/go-openapi/loads"
+ "github.com/go-openapi/runtime/middleware"
)
func NewRestful() *Restful {
)
func NewRestful() *Restful {
- r := &Restful{}
+ r := &Restful{
+ rh: resthooks.NewResthook(
+ ph.NewHealthChecker(),
+ ),
+ }
r.setupHandler()
return r
}
r.setupHandler()
return r
}
@@
-42,6
+50,13
@@
func (r *Restful) setupHandler() {
}
api := operations.NewRICDMSAPI(swaggerSpec)
}
api := operations.NewRICDMSAPI(swaggerSpec)
+
+ api.HealthGetHealthCheckHandler = health.GetHealthCheckHandlerFunc(func(ghcp health.GetHealthCheckParams) middleware.Responder {
+ ricdms.Logger.Debug("==> HealthCheck API invoked.")
+ resp := r.rh.GetDMSHealth()
+ return resp
+ })
+
r.api = api
}
r.api = api
}