summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/instancehandler.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/api/instancehandler.go')
-rw-r--r--src/k8splugin/api/instancehandler.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/k8splugin/api/instancehandler.go b/src/k8splugin/api/instancehandler.go
index 3baa8065..3fc514cd 100644
--- a/src/k8splugin/api/instancehandler.go
+++ b/src/k8splugin/api/instancehandler.go
@@ -122,8 +122,15 @@ func (i instanceHandler) createHandler(w http.ResponseWriter, r *http.Request) {
func (i instanceHandler) getHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
id := vars["instID"]
+ var resp interface{}
+ var err error
+
+ if r.URL.Query().Get("full") == "true" {
+ resp, err = i.client.GetFull(id)
+ } else {
+ resp, err = i.client.Get(id)
+ }
- resp, err := i.client.Get(id)
if err != nil {
log.Error("Error getting Instance", log.Fields{
"error": err,
@@ -132,7 +139,6 @@ func (i instanceHandler) getHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
-
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
err = json.NewEncoder(w).Encode(resp)