Subscription REST interface update
[ric-plt/submgr.git] / pkg / control / restendpoint.go
index 3b4f8f5..dc565d4 100644 (file)
@@ -40,7 +40,12 @@ func ConstructEndpointAddresses(clientEndpoint models.SubscriptionParamsClientEn
        var xAppHTTPEndPoint string
        var xAppRMREndPoint string
 
-       if host == "" || (HTTP_port == 0 && RMR_port == 0) {
+       if host == "" {
+               err := fmt.Errorf("ClientEndpoint provided without HOST name")
+               return "", "", err
+       }
+
+       if HTTP_port == 0 && RMR_port == 0 {
                err := fmt.Errorf("ClientEndpoint provided without PORT numbers")
                return "INVALID_HTTP_ADDRESS:" + host + (string)(*clientEndpoint.HTTPPort),
                        "INVALID_RMR_ADDRESS:" + host + (string)(*clientEndpoint.RMRPort),
@@ -57,7 +62,7 @@ func ConstructEndpointAddresses(clientEndpoint models.SubscriptionParamsClientEn
                xAppRMREndPoint = host + ":" + strconv.FormatInt(*clientEndpoint.RMRPort, 10)
        }
 
-       xapp.Logger.Info("xAppHttpEndPoint=%v, xAppRrmEndPoint=%v", xAppHTTPEndPoint, xAppRMREndPoint)
+       xapp.Logger.Debug("xAppHttpEndPoint=%v, xAppRrmEndPoint=%v", xAppHTTPEndPoint, xAppRMREndPoint)
 
        return xAppHTTPEndPoint, xAppRMREndPoint, nil
 }