X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Frestful%2Frestful.go;h=ca454178e73c237755d986829d2af9417386681d;hb=refs%2Fchanges%2F45%2F9245%2F1;hp=4255e2b02cb376d1ed1e87bab894e58ec2aada7c;hpb=cd6cc6ad28c32ccce6a2833917f7408a798e45fc;p=ric-plt%2Fricdms.git diff --git a/pkg/restful/restful.go b/pkg/restful/restful.go index 4255e2b..ca45417 100644 --- a/pkg/restful/restful.go +++ b/pkg/restful/restful.go @@ -23,10 +23,14 @@ 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" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/ricdms" "github.com/go-openapi/loads" @@ -37,6 +41,8 @@ func NewRestful() *Restful { r := &Restful{ rh: resthooks.NewResthook( ph.NewHealthChecker(), + po.NewOnboarder(), + ch.NewChartmgr(), ), } r.setupHandler() @@ -57,6 +63,30 @@ func (r *Restful) setupHandler() { return resp }) + api.OnboardPostOnboardxAppsHandler = onboard.PostOnboardxAppsHandlerFunc(func(poap onboard.PostOnboardxAppsParams) middleware.Responder { + ricdms.Logger.Debug("==> onboard API invoked.") + resp := r.rh.OnBoard(poap.Body) + 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 + }) + r.api = api }