X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestful%2Frestful.go;h=b17c7ad17b475838c6158ee1f03d1a1000148ca4;hb=c1e4374fb522f55e9263dd2deca3d244e709ebdf;hp=9b784a13e2586d3fddb7e5171c762ed744a1cf0a;hpb=41f03638ee74f924d160328b3291aae61740cbdd;p=ric-plt%2Fricdms.git diff --git a/pkg/restful/restful.go b/pkg/restful/restful.go index 9b784a1..b17c7ad 100644 --- a/pkg/restful/restful.go +++ b/pkg/restful/restful.go @@ -27,11 +27,13 @@ import ( "os" ch "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/charts" + dm "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/deploy" 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/deploy" "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" @@ -47,6 +49,7 @@ func NewRestful() *Restful { ph.NewHealthChecker(), po.NewOnboarder(), ch.NewChartmgr(), + dm.NewDeploymentManager(), ), } r.setupHandler() @@ -67,6 +70,12 @@ func (r *Restful) setupHandler() { return resp }) + api.HealthGetHealthcheckXAppXAppNameNamespaceNamespaceHandler = health.GetHealthcheckXAppXAppNameNamespaceNamespaceHandlerFunc(func(param health.GetHealthcheckXAppXAppNameNamespaceNamespaceParams) middleware.Responder { + ricdms.Logger.Debug("==> Healthcheck for xApp is invoked") + resp := r.rh.GetxAppHealth(param.XAppName, param.Namespace) + return resp + }) + api.OnboardPostOnboardxAppsHandler = onboard.PostOnboardxAppsHandlerFunc(func(poap onboard.PostOnboardxAppsParams) middleware.Responder { ricdms.Logger.Debug("==> onboard API invoked.") resp := r.rh.OnBoard(poap.Body) @@ -97,6 +106,12 @@ func (r *Restful) setupHandler() { return resp }) + api.DeployPostDeployHandler = deploy.PostDeployHandlerFunc(func(param deploy.PostDeployParams) middleware.Responder { + ricdms.Logger.Debug("==> deployment of xApp") + resp := r.rh.DownloadAndInstallChart(param.Body.XAppname, param.Body.Version, *param.Body.Namespace) + return resp + }) + api.ApplicationZipProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { if zp, ok := data.(io.ReadCloser); ok { defer zp.Close()