Add a new API to return the list of undeployed xApps
[ric-plt/appmgr.git] / cmd / appmgr / api.go
index 2de8b05..db54eb2 100755 (executable)
@@ -42,6 +42,7 @@ func (m *XappManager) Initialize(h Helmer, cm ConfigMapper) {
                {"GET", "/ric/v1/health/ready", m.getHealthStatus},
 
                {"GET", "/ric/v1/xapps", m.getAllXapps},
+               {"GET", "/ric/v1/xapps/search", m.searchAllXapps},
                {"GET", "/ric/v1/xapps/{name}", m.getXappByName},
                {"GET", "/ric/v1/xapps/{name}/instances/{id}", m.getXappInstanceByName},
                {"POST", "/ric/v1/xapps", m.deployXapp},
@@ -155,6 +156,10 @@ func (m *XappManager) getAllXapps(w http.ResponseWriter, r *http.Request) {
        respondWithJSON(w, http.StatusOK, xapps)
 }
 
+func (m *XappManager) searchAllXapps(w http.ResponseWriter, r *http.Request) {
+       respondWithJSON(w, http.StatusOK, m.helm.SearchAll())
+}
+
 func (m *XappManager) deployXapp(w http.ResponseWriter, r *http.Request) {
        if r.Body == nil {
                Logger.Error("No xapp data found in request body - url=%s", r.URL.RequestURI())