some fix related to the integration 60/860/1
authorzkoczka <zoltan.koczka@nokia.com>
Mon, 2 Sep 2019 08:40:40 +0000 (10:40 +0200)
committerzkoczka <zoltan.koczka@nokia.com>
Mon, 2 Sep 2019 08:40:40 +0000 (10:40 +0200)
Change-Id: I650ed6aa6f34ea24a4d483b7f79a8bf29db164d0
Signed-off-by: zkoczka <zoltan.koczka@nokia.com>
api/routing_manager.yaml
cmd/rtmgr.go
pkg/nbi/httprestful.go
pkg/nbi/httprestful_test.go
pkg/rtmgr/types.go

index 7a1e302..93c4fc9 100644 (file)
@@ -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:
index f2b3903..e6a9665 100644 (file)
@@ -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'")
index 035501a..3d94cc9 100644 (file)
@@ -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 {
index ecf0c2e..c52643b 100644 (file)
@@ -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 {
index ba396c8..80d2dc0 100644 (file)
@@ -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
 }