Stub implementation for custom-onboard API 22/11222/1
authorsubhash kumar singh <subh.singh@samsung.com>
Thu, 25 May 2023 10:54:18 +0000 (10:54 +0000)
committersubhash kumar singh <subh.singh@samsung.com>
Thu, 25 May 2023 10:54:18 +0000 (10:54 +0000)
Stub implementation for custom-onboard API.

Issue-ID: RIC-955
Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
Change-Id: Ib150233ea641fe4e8ab19a77dea7ec3872d15e58

pkg/restful/restful.go

index 1b5e8a7..72dcea1 100644 (file)
@@ -1,22 +1,23 @@
-//==================================================================================
-//  Copyright (c) 2022 Samsung
+// ==================================================================================
 //
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
+//     Copyright (c) 2022 Samsung
 //
-//       http://www.apache.org/licenses/LICENSE-2.0
+//      Licensed under the Apache License, Version 2.0 (the "License");
+//      you may not use this file except in compliance with the License.
+//      You may obtain a copy of the License at
 //
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
+//          http://www.apache.org/licenses/LICENSE-2.0
 //
-//   This source code is part of the near-RT RIC (RAN Intelligent Controller)
-//   platform project (RICP).
-//==================================================================================
+//      Unless required by applicable law or agreed to in writing, software
+//      distributed under the License is distributed on an "AS IS" BASIS,
+//      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//      See the License for the specific language governing permissions and
+//      limitations under the License.
 //
+//      This source code is part of the near-RT RIC (RAN Intelligent Controller)
+//      platform project (RICP).
+//
+// ==================================================================================
 package restful
 
 import (
@@ -34,6 +35,7 @@ import (
        "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/experiment"
        "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"
@@ -117,6 +119,13 @@ func (r *Restful) setupHandler() {
                resp := r.rh.UninstallChart(*param.Body.XAppname, *param.Body.Version, param.Body.Namespace)
                return resp
        })
+
+       api.ExperimentPostCustomOnboardHandler = experiment.PostCustomOnboardHandlerFunc(func(pcop experiment.PostCustomOnboardParams) middleware.Responder {
+               ricdms.Logger.Debug("==> invoked custom onboarding")
+               // TODO: provide implementatoin
+               return &experiment.PostCustomOnboardOK{}
+       })
+
        api.ApplicationZipProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error {
                if zp, ok := data.(io.ReadCloser); ok {
                        defer zp.Close()