X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=a1-go%2Fpkg%2Fresthooks%2Fresthooks.go;fp=a1-go%2Fpkg%2Fresthooks%2Fresthooks.go;h=79dba939345f31a826de191265209466e0538fea;hb=1a41ce75dbf508ae4d85c2dc4a562f36da04bb65;hp=45c392857d77236d2b84acb2c35f8ddb0ca93ff7;hpb=6242a3ff1b95eb8fc89931b11115ec9c06d08e96;p=ric-plt%2Fa1.git diff --git a/a1-go/pkg/resthooks/resthooks.go b/a1-go/pkg/resthooks/resthooks.go index 45c3928..79dba93 100644 --- a/a1-go/pkg/resthooks/resthooks.go +++ b/a1-go/pkg/resthooks/resthooks.go @@ -31,6 +31,7 @@ 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/sdlgo" + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" "github.com/santhosh-tekuri/jsonschema/v5" "gopkg.in/yaml.v2" ) @@ -72,12 +73,13 @@ func (rh *Resthook) IsValidJson(err error) bool { return err == invalidJsonSchema } func NewResthook() *Resthook { - return createResthook(sdlgo.NewSyncStorage()) + return createResthook(sdlgo.NewSyncStorage(), rmr.NewRMRSender()) } -func createResthook(sdlInst iSdl) *Resthook { +func createResthook(sdlInst iSdl, rmrSenderInst rmr.IRmrSender) *Resthook { return &Resthook{ - db: sdlInst, + db: sdlInst, + iRmrSenderInst: rmrSenderInst, } } @@ -363,6 +365,13 @@ func (rh *Resthook) CreatePolicyInstance(policyTypeId models.PolicyTypeID, polic if iscreated { a1.Logger.Debug("policy instance metadata created") } + isSent := rh.iRmrSenderInst.RmrSendToXapp(httpBodyString) + if isSent { + a1.Logger.Debug("rmrSendToXapp : message sent") + } else { + a1.Logger.Debug("rmrSendToXapp : message not sent") + } + } else { a1.Logger.Error("%+v", invalidJsonSchema) return invalidJsonSchema