Implement Get operation for chart list
[ric-plt/ricdms.git] / pkg / restful / restful.go
index 2670fb6..acfd65a 100644 (file)
@@ -23,10 +23,12 @@ import (
        "log"
        "os"
 
+       ch "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/charts"
        ph "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/health"
        po "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/onboard"
        "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi"
        "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations"
+       "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/charts"
        "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/health"
        "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/onboard"
        "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/resthooks"
@@ -40,6 +42,7 @@ func NewRestful() *Restful {
                rh: resthooks.NewResthook(
                        ph.NewHealthChecker(),
                        po.NewOnboarder(),
+                       ch.NewChartmgr(),
                ),
        }
        r.setupHandler()
@@ -66,6 +69,12 @@ func (r *Restful) setupHandler() {
                return resp
        })
 
+       api.ChartsGetChartsListHandler = charts.GetChartsListHandlerFunc(func(param charts.GetChartsListParams) middleware.Responder {
+               ricdms.Logger.Debug("==> GetChartList")
+               resp := r.rh.GetCharts()
+               return resp
+       })
+
        r.api = api
 }