From: zkoczka Date: Mon, 2 Sep 2019 08:40:40 +0000 (+0200) Subject: some fix related to the integration X-Git-Tag: 0.3.9~12 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=1892a705147ad415b7c43cc5bb6d8ac4262b3583;p=ric-plt%2Frtmgr.git some fix related to the integration Change-Id: I650ed6aa6f34ea24a4d483b7f79a8bf29db164d0 Signed-off-by: zkoczka --- diff --git a/api/routing_manager.yaml b/api/routing_manager.yaml index 7a1e302..93c4fc9 100644 --- a/api/routing_manager.yaml +++ b/api/routing_manager.yaml @@ -171,8 +171,7 @@ definitions: type: "object" properties: id: - type: "integer" - format: "int64" + type: "string" event: type: "string" version: @@ -196,7 +195,7 @@ definitions: maximum: 65535 subscription_id: #subscription sequence number type: "integer" - format: "int16" + format: "int32" xapp-list: type: "array" items: diff --git a/cmd/rtmgr.go b/cmd/rtmgr.go index f2b3903..e6a9665 100644 --- a/cmd/rtmgr.go +++ b/cmd/rtmgr.go @@ -50,7 +50,7 @@ func parseArgs() { // TODO: arguments should be validated (filename; xm-url; sbi-if; rest-url; rest-port) args = make(map[string]*string) args["configfile"] = flag.String("configfile", "/etc/rtmgrcfg.json", "Routing manager's configuration file path") - args["nbi"] = flag.String("nbi", "httpGetter", "Northbound interface module to be used. Valid values are: 'httpGetter | httpRESTful'") + args["nbi"] = flag.String("nbi", "httpRESTful", "Northbound interface module to be used. Valid values are: 'httpGetter | httpRESTful'") args["sbi"] = flag.String("sbi", "nngpush", "Southbound interface module to be used. Valid values are: 'nngpush | nngpub'") args["rpe"] = flag.String("rpe", "rmrpush", "Route Policy Engine to be used. Valid values are: 'rmrpush | rmrpub'") args["sdl"] = flag.String("sdl", "file", "Datastore enginge to be used. Valid values are: 'file'") diff --git a/pkg/nbi/httprestful.go b/pkg/nbi/httprestful.go index 035501a..3d94cc9 100644 --- a/pkg/nbi/httprestful.go +++ b/pkg/nbi/httprestful.go @@ -157,10 +157,10 @@ func launchRest(nbiif *string, datach chan<- *models.XappCallbackData, subchan c server.Port, err = strconv.Atoi(nbiUrl.Port()) if err != nil { - rtmgr.Logger.Error("Invalid NBI RestAPI port") - os.Exit(1) + rtmgr.Logger.Error("Invalid NBI RestAPI port") + os.Exit(1) } - server.Host = nbiUrl.Hostname() + server.Host = "0.0.0.0" // set handlers api.HandleProvideXappHandleHandler = handle.ProvideXappHandleHandlerFunc( func(params handle.ProvideXappHandleParams) middleware.Responder { diff --git a/pkg/nbi/httprestful_test.go b/pkg/nbi/httprestful_test.go index ecf0c2e..c52643b 100644 --- a/pkg/nbi/httprestful_test.go +++ b/pkg/nbi/httprestful_test.go @@ -99,7 +99,7 @@ func TestRecvXappCallbackData(t *testing.T) { XApps: *swag.String("[]"), Version: *swag.Int64(1), Event: *swag.String("any"), - ID: *swag.Int64(123456), + ID: *swag.String("123456"), } ch := make(chan *models.XappCallbackData) @@ -127,7 +127,7 @@ func TestProvideXappHandleHandlerImpl(t *testing.T) { XApps: *swag.String("[]"), Version: *swag.Int64(1), Event: *swag.String("someevent"), - ID: *swag.Int64(123456)} + ID: *swag.String("123456")} var httpRestful, _ = GetNbi("httpRESTful") err := httpRestful.(*HttpRestful).ProvideXappHandleHandlerImpl(datach, &data) if err != nil { @@ -149,7 +149,7 @@ func TestValidateXappCallbackData(t *testing.T) { XApps: *swag.String("[]"), Version: *swag.Int64(1), Event: *swag.String("someevent"), - ID: *swag.Int64(123456)} + ID: *swag.String("123456")} err := validateXappCallbackData(&data) if err != nil { @@ -162,7 +162,7 @@ func TestValidateXappCallbackDataWithInvalidData(t *testing.T) { XApps: *swag.String("{}"), Version: *swag.Int64(1), Event: *swag.String("someevent"), - ID: *swag.Int64(123456)} + ID: *swag.String("123456")} err := validateXappCallbackData(&data) if err == nil { diff --git a/pkg/rtmgr/types.go b/pkg/rtmgr/types.go index ba396c8..80d2dc0 100644 --- a/pkg/rtmgr/types.go +++ b/pkg/rtmgr/types.go @@ -55,7 +55,7 @@ type RouteTableEntry struct { MessageType string TxList EndpointList RxGroups []EndpointList - SubID int16 + SubID int32 } type XApp struct { @@ -90,7 +90,7 @@ type RicComponents struct { } type Subscription struct { - SubID int16 + SubID int32 Fqdn string Port uint16 }