RMR handler for A1 policy response
[ric-plt/a1.git] / a1-go / pkg / resthooks / resthooks.go
index 8fb07df..508bc49 100644 (file)
@@ -30,6 +30,8 @@ import (
 
        "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/a1"
        "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/models"
+       "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/policy"
+       "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/restapi/operations/a1_mediator"
        "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/rmr"
        "gerrit.o-ran-sc.org/r/ric-plt/sdlgo"
        "github.com/santhosh-tekuri/jsonschema/v5"
@@ -85,14 +87,18 @@ func (rh *Resthook) IsValidJson(err error) bool {
        return err == invalidJsonSchema
 }
 func NewResthook() *Resthook {
-       return createResthook(sdlgo.NewSyncStorage(), rmr.NewRMRSender())
+       sdl := sdlgo.NewSyncStorage()
+       policyManager := policy.NewPolicyManager(sdl)
+       return createResthook(sdl, rmr.NewRMRSender(policyManager))
 }
 
 func createResthook(sdlInst iSdl, rmrSenderInst rmr.IRmrSender) *Resthook {
-       return &Resthook{
+       rh := &Resthook{
                db:             sdlInst,
                iRmrSenderInst: rmrSenderInst,
        }
+
+       return rh
 }
 
 func (rh *Resthook) GetA1Health() bool {