aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2021-03-11 10:58:37 +0100
committerKonrad Bańka <k.banka@samsung.com>2021-03-11 10:58:37 +0100
commitdb4031f13d0de1333b98c13659f7f279bc690963 (patch)
tree96d920f6e03e3f5d7e7a746c8bba828d0dac14aa /src
parent68def373cb0e2a4fd5b0af867797cc39ac81b1e0 (diff)
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 <k.banka@samsung.com> Change-Id: I139486a41c7dbd67d414a07776e9a5d711d9887b
Diffstat (limited to 'src')
-rw-r--r--src/k8splugin/api/configtemplatehandler.go9
1 files changed, 7 insertions, 2 deletions
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