+ if errList, err := m.cm.CreateConfigMap(c); err != nil {
+ if err.Error() != "Validation failed!" {
+ respondWithError(w, http.StatusInternalServerError, err.Error())
+ } else {
+ respondWithJSON(w, http.StatusUnprocessableEntity, errList)
+ }
+ return
+ }
+ respondWithJSON(w, http.StatusCreated, c.Metadata)
+}
+
+func (m *XappManager) updateConfig(w http.ResponseWriter, r *http.Request) {
+ var c XAppConfig
+ if parseConfig(w, r, &c) != nil {
+ return
+ }
+
+ if errList, err := m.cm.UpdateConfigMap(c); err != nil {
+ if err.Error() != "Validation failed!" {
+ respondWithError(w, http.StatusInternalServerError, err.Error())
+ } else {
+ respondWithJSON(w, http.StatusInternalServerError, errList)
+ }
+ return
+ }
+ respondWithJSON(w, http.StatusOK, c.Metadata)
+}
+
+func (m *XappManager) deleteSingleConfig(w http.ResponseWriter, r *http.Request) {
+ xappName, ok := getResourceId(r, w, "name")
+ if ok != true {