Return service names of xApps instead of IP
[ric-plt/appmgr.git] / cmd / appmgr / api.go
index db54eb2..e805a51 100755 (executable)
@@ -26,6 +26,7 @@ import (
        "github.com/spf13/viper"
        "log"
        "net/http"
+       "time"
 )
 
 // API functions
@@ -181,6 +182,13 @@ func (m *XappManager) deployXapp(w http.ResponseWriter, r *http.Request) {
                return
        }
 
+       for i := 0; i < 3; i++ {
+               if xapp, err = m.helm.Status(xapp.Name); xapp.Instances != nil {
+                       break;
+               }
+               time.Sleep(time.Duration(5) * time.Second)
+       }
+
        respondWithJSON(w, http.StatusCreated, xapp)
 
        m.sd.Publish(xapp, EventType("created"))