+
+func (r *Restful) getAppConfig() (configList models.AllXappConfig) {
+ for _, v := range xappmap {
+ namespace := "ricxapp" //Namespace hardcoded, to be removed later
+ for _, j := range v {
+ var activeConfig interface{}
+ if j.xappdynamiconfig {
+ continue
+ }
+ xappconfig := httpGetXAppsconfig(fmt.Sprintf("http://%s%s", j.httpendpoint, j.xappconfigpath))
+
+ if xappconfig == nil {
+ appmgr.Logger.Info("config not found for %s", &j.xappname)
+ continue
+ }
+ json.Unmarshal([]byte(*xappconfig), &activeConfig)
+
+ c := models.XAppConfig{
+ Metadata: &models.ConfigMetadata{XappName: &j.xappname, Namespace: &namespace},
+ Config: activeConfig,
+ }
+ configList = append(configList, &c)
+
+ }
+
+ }
+ return
+}
+
+func (r *Restful) symptomdataServer() {
+ http.HandleFunc("/ric/v1/symptomdata", func(w http.ResponseWriter, req *http.Request) {
+ d, _ := r.GetApps()
+ xappData := struct {
+ XappList models.AllDeployedXapps `json:"xappList"`
+ ConfigList models.AllXappConfig `json:"configList"`
+ SubscriptionList models.AllSubscriptions `json:"subscriptionList"`
+ }{
+ d,
+ r.getAppConfig(),
+ r.rh.GetAllSubscriptions(),
+ }
+
+ w.Header().Set("Content-Type", "application/json")
+ w.Header().Set("Content-Disposition", "attachment; filename=platform/apps_info.json")
+ w.WriteHeader(http.StatusOK)
+ resp, _ := json.MarshalIndent(xappData, "", " ")
+ w.Write(resp)
+ })
+
+ http.ListenAndServe(":8081", nil)
+}