X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=cmd%2Frtmgr.go;h=834df26d15bfb386a2e00676b565d962cc923a8e;hb=bfeca7737cc003f149ca8b01d1aaf484dcb762d7;hp=af0aba192604501548734f720cfc70026f14b810;hpb=6a9ce4976c1fbbcb8d4a068f81e76515c99a9d3f;p=ric-plt%2Frtmgr.git diff --git a/cmd/rtmgr.go b/cmd/rtmgr.go index af0aba1..834df26 100644 --- a/cmd/rtmgr.go +++ b/cmd/rtmgr.go @@ -32,17 +32,13 @@ */ package main -//TODO: change flag to pflag (won't need any argument parse) - import ( "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" "os" "os/signal" "routing-manager/pkg/nbi" - //"routing-manager/pkg/rpe" + "routing-manager/pkg/nbi/restful" "routing-manager/pkg/rtmgr" - //"routing-manager/pkg/sbi" - //"routing-manager/pkg/sdl" "syscall" "time" ) @@ -67,20 +63,25 @@ func main() { rtmgr.Eps = make(rtmgr.Endpoints) rtmgr.Mtype = make(rtmgr.MessageTypeList) rtmgr.Rtmgr_ready = false + rtmgr.RMRConnStatus = make(map[string]bool) -// RMR thread is starting port: 4560 + // RMR thread is starting port: 4560 c := nbi.NewControl() go c.Run() -// Waiting for RMR to be ready + // Waiting for RMR to be ready time.Sleep(time.Duration(2) * time.Second) for xapp.Rmr.IsReady() == false { - time.Sleep(time.Duration(2) * time.Second) + time.Sleep(time.Duration(2) * time.Second) } - dummy_whid := int(xapp.Rmr.Openwh("localhost:4560")) + dummy_whid := int(xapp.Rmr.Openwh("rtmgr:4560")) xapp.Logger.Info("created dummy Wormhole ID for routingmanager and dummy_whid :%d", dummy_whid) + go func() { + restful.LaunchRest(xapp.Config.GetString("nbiurl")) + }() + nbi.Serve() os.Exit(0) }