Add errorcode in swagger for custom onboard API 30/11230/1
authorsubhash kumar singh <subh.singh@samsung.com>
Fri, 26 May 2023 12:09:13 +0000 (12:09 +0000)
committersubhash kumar singh <subh.singh@samsung.com>
Fri, 26 May 2023 12:14:44 +0000 (12:14 +0000)
Added errorcode in swagger for custom onboard API.

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

api/ric-dms-api-2.0.yaml
pkg/restful/restful.go

index 6348b6a..510bdda 100644 (file)
@@ -29,17 +29,21 @@ schemes:
 paths:
   /custom-onboard:
     post:
-      summary: upload a file
+      summary: onboard helm pkg (custom onboarding)
       consumes:
         - multipart/form-data
       parameters:
         - in: formData
-          name: upfile
+          name: helmpkg
           type: file
-          description: api to upload file
+          description: This file represents the helm chart.
       responses:
         '200':
-          description: successfully uploaded
+          description: successfully onboarded helmchart
+        '500':
+          description: helmchart onboard  failed
+          schema:
+            $ref: '#/definitions/error_message'
       tags:
         - experiment
   /charts:
index 4e91b09..cde52e1 100644 (file)
@@ -122,8 +122,8 @@ func (r *Restful) setupHandler() {
 
        api.ExperimentPostCustomOnboardHandler = experiment.PostCustomOnboardHandlerFunc(func(pcop experiment.PostCustomOnboardParams) middleware.Responder {
                ricdms.Logger.Debug("==> invoked custom onboarding")
-               defer pcop.Upfile.Close()
-               return r.rh.Onboarder.CustomOnboard(pcop.Upfile)
+               defer pcop.Helmpkg.Close()
+               return r.rh.Onboarder.CustomOnboard(pcop.Helmpkg)
        })
 
        api.ApplicationZipProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error {