summaryrefslogtreecommitdiffstats
path: root/src/orchestrator/api/apphandler.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/orchestrator/api/apphandler.go')
-rw-r--r--src/orchestrator/api/apphandler.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/orchestrator/api/apphandler.go b/src/orchestrator/api/apphandler.go
index 3cd2dbc8..06341e7e 100644
--- a/src/orchestrator/api/apphandler.go
+++ b/src/orchestrator/api/apphandler.go
@@ -129,6 +129,30 @@ func (h appHandler) getAppHandler(w http.ResponseWriter, r *http.Request) {
compositeAppVersion := vars["version"]
name := vars["app-name"]
+ // handle the get all apps case - return a list of only the json parts
+ if len(name) == 0 {
+ var retList []moduleLib.App
+
+ ret, err := h.client.GetApps(projectName, compositeAppName, compositeAppVersion)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+ for _, app := range ret {
+ retList = append(retList, moduleLib.App{Metadata: app.Metadata})
+ }
+
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusOK)
+ err = json.NewEncoder(w).Encode(retList)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ return
+ }
+
accepted, _, err := mime.ParseMediaType(r.Header.Get("Accept"))
if err != nil {
http.Error(w, err.Error(), http.StatusNotAcceptable)