From: Konrad Bańka Date: Thu, 11 Mar 2021 09:58:37 +0000 (+0100) Subject: Correct Day2 Config Template creation response X-Git-Tag: 0.8.1~2^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=db4031f13d0de1333b98c13659f7f279bc690963;p=multicloud%2Fk8s.git Correct Day2 Config Template creation response Modified day2 config template handler to return metadata of created configuration template on its creation. Issue-ID: MULTICLOUD-1311 Signed-off-by: Konrad Bańka Change-Id: I139486a41c7dbd67d414a07776e9a5d711d9887b --- diff --git a/src/k8splugin/api/configtemplatehandler.go b/src/k8splugin/api/configtemplatehandler.go index 641e4206..bd7c2db9 100644 --- a/src/k8splugin/api/configtemplatehandler.go +++ b/src/k8splugin/api/configtemplatehandler.go @@ -64,8 +64,13 @@ func (h rbTemplateHandler) createHandler(w http.ResponseWriter, r *http.Request) return } - w.WriteHeader(http.StatusNoContent) - + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusCreated) + err = json.NewEncoder(w).Encode(p) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } } // uploadHandler handles upload of the template tar file into the database