Add support for RT policies
Change-Id: I8845d7d296634d3b06465385fd35c4ffabac9ee0
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
diff --git a/pkg/cm/cm.go b/pkg/cm/cm.go
index af5372d..a073c0a 100755
--- a/pkg/cm/cm.go
+++ b/pkg/cm/cm.go
@@ -31,6 +31,7 @@
"path"
"regexp"
"strings"
+ "strconv"
"time"
"gerrit.oran-osc.org/r/ric-plt/appmgr/pkg/appmgr"
@@ -262,8 +263,8 @@
return
}
-func (cm *CM) GetMessages(name string) (msgs appmgr.MessageTypes) {
- appmgr.Logger.Info("Fetching tx/rx messages for: %s", name)
+func (cm *CM) GetRtmData(name string) (msgs appmgr.RtmData) {
+ appmgr.Logger.Info("Fetching RT data for xApp=%s", name)
ns := cm.GetNamespace("")
args := fmt.Sprintf("get configmap -o jsonpath='{.data.config-file\\.json}' -n %s %s", ns, cm.GetConfigMapName(name, ns))
@@ -285,6 +286,11 @@
for _, m := range v.GetArray("rmr", "rxMessages") {
msgs.RxMessages = append(msgs.RxMessages, strings.Trim(m.String(), `"`))
}
+ for _, m := range v.GetArray("rmr", "policies") {
+ if val, err := strconv.Atoi(strings.Trim(m.String(), `"`)); err == nil {
+ msgs.Policies = append(msgs.Policies, int64(val))
+ }
+ }
return
}