Loading go-apps/meep-ams/server/convert.go +0 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ func convertAdjacentAppInfoNotificationToJson(obj *AdjacentAppInfoNotification) return string(jsonInfo) } func convertRegistrationInfoToJson(obj *RegistrationInfo) string { jsonInfo, err := json.Marshal(*obj) if err != nil { Loading go-apps/meep-app-enablement/server/service-mgmt/service-mgmt.go +29 −2 Original line number Diff line number Diff line Loading @@ -462,7 +462,7 @@ func appServicesGET(w http.ResponseWriter, r *http.Request) { defer mutex.Unlock() // Get App instance appInfo, err := getAppInfo(appId) appInfo, err := getAppInfoAnyMep(appId) if err != nil { http.Error(w, err.Error(), http.StatusNotFound) return Loading Loading @@ -495,7 +495,7 @@ func appServicesByIdGET(w http.ResponseWriter, r *http.Request) { defer mutex.Unlock() // Get App instance appInfo, err := getAppInfo(appId) appInfo, err := getAppInfoAnyMep(appId) if err != nil { http.Error(w, err.Error(), http.StatusNotFound) return Loading Loading @@ -1018,6 +1018,7 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) { isLocal: isLocal, scopeOfLocality: scopeOfLocality, }, Services: make([]ServiceInfo, 0), } var key string Loading Loading @@ -1415,6 +1416,32 @@ func getAppInfo(appId string) (map[string]string, error) { return appInfo, nil } func getAppInfoAnyMep(appId string) (map[string]string, error) { var appInfoList []map[string]string // Get app instance from any MEP keyMatchStr := baseKeyAnyMep + "app:" + appId + ":info" err := rc.ForEachEntry(keyMatchStr, populateAppInfo, &appInfoList) if err != nil || len(appInfoList) != 1 { return nil, errors.New("App Instance not found") } return appInfoList[0], nil } func populateAppInfo(key string, entry map[string]string, userData interface{}) error { appInfoList := userData.(*[]map[string]string) // Copy entry appInfo := make(map[string]string, len(entry)) for k, v := range entry { appInfo[k] = v } // Add app info to list *appInfoList = append(*appInfoList, appInfo) return nil } func validateAppInfo(appInfo map[string]string) (int, string, error) { // Make sure App is in ready state if appInfo[fieldState] != APP_STATE_READY { Loading Loading
go-apps/meep-ams/server/convert.go +0 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ func convertAdjacentAppInfoNotificationToJson(obj *AdjacentAppInfoNotification) return string(jsonInfo) } func convertRegistrationInfoToJson(obj *RegistrationInfo) string { jsonInfo, err := json.Marshal(*obj) if err != nil { Loading
go-apps/meep-app-enablement/server/service-mgmt/service-mgmt.go +29 −2 Original line number Diff line number Diff line Loading @@ -462,7 +462,7 @@ func appServicesGET(w http.ResponseWriter, r *http.Request) { defer mutex.Unlock() // Get App instance appInfo, err := getAppInfo(appId) appInfo, err := getAppInfoAnyMep(appId) if err != nil { http.Error(w, err.Error(), http.StatusNotFound) return Loading Loading @@ -495,7 +495,7 @@ func appServicesByIdGET(w http.ResponseWriter, r *http.Request) { defer mutex.Unlock() // Get App instance appInfo, err := getAppInfo(appId) appInfo, err := getAppInfoAnyMep(appId) if err != nil { http.Error(w, err.Error(), http.StatusNotFound) return Loading Loading @@ -1018,6 +1018,7 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) { isLocal: isLocal, scopeOfLocality: scopeOfLocality, }, Services: make([]ServiceInfo, 0), } var key string Loading Loading @@ -1415,6 +1416,32 @@ func getAppInfo(appId string) (map[string]string, error) { return appInfo, nil } func getAppInfoAnyMep(appId string) (map[string]string, error) { var appInfoList []map[string]string // Get app instance from any MEP keyMatchStr := baseKeyAnyMep + "app:" + appId + ":info" err := rc.ForEachEntry(keyMatchStr, populateAppInfo, &appInfoList) if err != nil || len(appInfoList) != 1 { return nil, errors.New("App Instance not found") } return appInfoList[0], nil } func populateAppInfo(key string, entry map[string]string, userData interface{}) error { appInfoList := userData.(*[]map[string]string) // Copy entry appInfo := make(map[string]string, len(entry)) for k, v := range entry { appInfo[k] = v } // Add app info to list *appInfoList = append(*appInfoList, appInfo) return nil } func validateAppInfo(appInfo map[string]string) (int, string, error) { // Make sure App is in ready state if appInfo[fieldState] != APP_STATE_READY { Loading