Subscription REST interface update
[ric-plt/xapp-frame.git] / pkg / xapp / xapp.go
index ab5aeb6..e8f47ef 100755 (executable)
@@ -23,7 +23,6 @@ import (
        "bytes"
        "encoding/json"
        "fmt"
-       "github.com/spf13/viper"
        "net/http"
        "os"
        "os/signal"
@@ -31,6 +30,8 @@ import (
        "sync/atomic"
        "syscall"
        "time"
+
+       "github.com/spf13/viper"
 )
 
 type ReadyCB func(interface{})
@@ -111,6 +112,8 @@ func getService(host, service string) string {
 
        svc := fmt.Sprintf(service, strings.ToUpper(appnamespace), strings.ToUpper(host))
        url := strings.Split(os.Getenv(strings.Replace(svc, "-", "_", -1)), "//")
+
+       Logger.Info("getService: %+v %+v", svc, url)
        if len(url) > 1 {
                return url[1]
        }
@@ -251,7 +254,7 @@ func init() {
        Resource = NewRouter()
        Config = Configurator{}
        Metric = NewMetrics(viper.GetString("metrics.url"), viper.GetString("metrics.namespace"), Resource.router)
-       Subscription = NewSubscriber(viper.GetString("subscription.host"), viper.GetInt("subscription.timeout"))
+       Subscription = NewSubscriber(viper.GetString("controls.subscription.host"), viper.GetInt("controls.subscription.timeout"))
        Sdl = NewSDLClient(viper.GetString("controls.db.namespace"))
        Rnib = NewRNIBClient()
        Util = NewUtils()