From: subhash kumar singh Date: Fri, 26 May 2023 12:09:13 +0000 (+0000) Subject: Add errorcode in swagger for custom onboard API X-Git-Tag: 2.1.0~4 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=6b58a57644cf6fe8b9f255e6a52abe2a97cb9549;p=ric-plt%2Fricdms.git Add errorcode in swagger for custom onboard API Added errorcode in swagger for custom onboard API. Issue-ID: RIC-955 Signed-off-by: subhash kumar singh Change-Id: Ib578e8f91161ff404a4e99ac977c6d40cf9692f4 --- diff --git a/api/ric-dms-api-2.0.yaml b/api/ric-dms-api-2.0.yaml index 6348b6a..510bdda 100644 --- a/api/ric-dms-api-2.0.yaml +++ b/api/ric-dms-api-2.0.yaml @@ -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: diff --git a/pkg/restful/restful.go b/pkg/restful/restful.go index 4e91b09..cde52e1 100644 --- a/pkg/restful/restful.go +++ b/pkg/restful/restful.go @@ -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 {