From: subhash kumar singh Date: Tue, 1 Jun 2021 14:08:57 +0000 (+0530) Subject: Send policy query message X-Git-Tag: 1.0.1~6 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=83b7567d4429d0ad76f2262e1e7cfe958230bc07;p=ric-app%2Fhw-go.git Send policy query message Send policy query message to A1-mediator to get policy instance list. Change-Id: Ib11aa4ab49c266a1def7c4171b743e841fda21d3 Signed-off-by: subhash kumar singh --- diff --git a/config/uta_rtg.rt b/config/uta_rtg.rt index 2b08655..14d77aa 100755 --- a/config/uta_rtg.rt +++ b/config/uta_rtg.rt @@ -1,4 +1,6 @@ newrt|start rte|10004|localhost:4560 rte|10005|localhost:4591 +rte|20011|service-ricplt-a1mediator-rmr.ricplt:4562 +rte|20012|service-ricplt-a1mediator-rmr.ricplt:4562 newrt|end diff --git a/hwApp.go b/hwApp.go index 2f82210..dc4e4f7 100755 --- a/hwApp.go +++ b/hwApp.go @@ -27,6 +27,29 @@ import ( type HWApp struct { } +var ( + A1_POLICY_QUERY = 20013 + POLICY_QUERY_PAYLOAD = "{\"policy_type_id\":20000}" +) + +func (e *HWApp) sendPolicyQuery() { + xapp.Logger.Info("Invoked method to send policy query message") + + // prepare and send policy query message over RMR + rmrParams := new(xapp.RMRParams) + rmrParams.Mtype = A1_POLICY_QUERY // A1_POLICY_QUERY + rmrParams.Payload = []byte(POLICY_QUERY_PAYLOAD) + + // send rmr message + flg := xapp.Rmr.SendMsg(rmrParams) + + if flg { + xapp.Logger.Info("Successfully sent policy query message over RMR") + } else { + xapp.Logger.Info("Failed to send policy query message over RMR") + } +} + func (e *HWApp) ConfigChangeHandler(f string) { xapp.Logger.Info("Config file changed") }