X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestful%2Frestful.go;h=9c9e861e47dd0980fd80f548f62a7f029bf7ceda;hb=9960403a919d3aeb771d7504376a6cb5f7a6e3d1;hp=2670fb6c4b74524b8b5c470a9b7dfdde0a21f49f;hpb=04897e6ba579f0cfd11453f589fc1fb24be4e820;p=ric-plt%2Fricdms.git diff --git a/pkg/restful/restful.go b/pkg/restful/restful.go index 2670fb6..9c9e861 100644 --- a/pkg/restful/restful.go +++ b/pkg/restful/restful.go @@ -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,30 @@ 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 + }) + + api.ChartsDownloadHelmChartHandler = charts.DownloadHelmChartHandlerFunc(func(param charts.DownloadHelmChartParams) middleware.Responder { + ricdms.Logger.Debug("==> Download helm chart") + resp := r.rh.DownloadChart(param.XAppName, param.Version) + return resp + }) + + api.ChartsGetChartHandler = charts.GetChartHandlerFunc(func(param charts.GetChartParams) middleware.Responder { + ricdms.Logger.Debug("==> Get Charts by name is invoked") + resp := r.rh.GetChartsByName(param.XAppName) + return resp + }) + + api.ChartsGetChartsFetcherHandler = charts.GetChartsFetcherHandlerFunc(func(param charts.GetChartsFetcherParams) middleware.Responder { + ricdms.Logger.Debug("==> Get Charts by name and version is invoked") + resp := r.rh.GetChartByNameAndVersion(param.XAppName, param.Version) + return resp + }) + r.api = api }