X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=a1-go%2Fpkg%2Frestful%2Frestful.go;fp=a1-go%2Fpkg%2Frestful%2Frestful.go;h=44b34228080caaf0f9c49cc86fee9c3dc2a6e703;hb=a5d992815f470a349dea86d616509222eb051f97;hp=d8d1e9269e85791235bb7ad1d3e156cc19ce8c56;hpb=2705dc9e68c52693a510aca78a8c74c7fb042c7c;p=ric-plt%2Fa1.git diff --git a/a1-go/pkg/restful/restful.go b/a1-go/pkg/restful/restful.go index d8d1e92..44b3422 100644 --- a/a1-go/pkg/restful/restful.go +++ b/a1-go/pkg/restful/restful.go @@ -50,6 +50,16 @@ func (r *Restful) setupHandler() *operations.A1API { } api := operations.NewA1API(swaggerSpec) + + api.A1MediatorA1ControllerGetHealthcheckHandler = a1_mediator.A1ControllerGetHealthcheckHandlerFunc(func(param a1_mediator.A1ControllerGetHealthcheckParams) middleware.Responder { + a1.Logger.Debug("handler for get Health Check of A1") + resp := r.rh.GetA1Health() + if resp == false { + return a1_mediator.NewA1ControllerGetHealthcheckInternalServerError() + } + return a1_mediator.NewA1ControllerGetHealthcheckOK() + }) + api.A1MediatorA1ControllerGetAllPolicyTypesHandler = a1_mediator.A1ControllerGetAllPolicyTypesHandlerFunc(func(param a1_mediator.A1ControllerGetAllPolicyTypesParams) middleware.Responder { a1.Logger.Debug("handler for get all policy type") return a1_mediator.NewA1ControllerGetAllPolicyTypesOK().WithPayload(r.rh.GetAllPolicyType())