"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"
ph.NewHealthChecker(),
po.NewOnboarder(),
ch.NewChartmgr(),
+ dm.NewDeploymentManager(),
),
}
r.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)
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.DeployDeleteDeployHandler = deploy.DeleteDeployHandlerFunc(func(param deploy.DeleteDeployParams) middleware.Responder {
+ ricdms.Logger.Debug("==> undeploy xApp")
+ resp := r.rh.UninstallChart(*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()