summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/instancehandler.go
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@orange.com>2021-08-01 21:01:44 +0200
committerLukasz Rajewski <lukasz.rajewski@orange.com>2021-08-02 22:48:48 +0200
commit5e27642926c9967a26eef5d4625aba2f1eee2c8c (patch)
tree9689affa97005d0eceb026432f6872744fcdc282 /src/k8splugin/api/instancehandler.go
parente42203ee6c170eebb9466ee82baa97f83e88955c (diff)
Add suport for query api on root level
Add suport for query api on root level. Instance query handler and root query handler merged. Issue-ID: MULTICLOUD-1379 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I1dc95c7aca0e734edf5794e7c36143dc12070f2b
Diffstat (limited to 'src/k8splugin/api/instancehandler.go')
-rw-r--r--src/k8splugin/api/instancehandler.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/k8splugin/api/instancehandler.go b/src/k8splugin/api/instancehandler.go
index b56a8e12..3baa8065 100644
--- a/src/k8splugin/api/instancehandler.go
+++ b/src/k8splugin/api/instancehandler.go
@@ -1,6 +1,8 @@
/*
Copyright 2018 Intel Corporation.
Copyright © 2021 Samsung Electronics
+Copyright © 2021 Orange
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@ -181,15 +183,11 @@ func (i instanceHandler) queryHandler(w http.ResponseWriter, r *http.Request) {
name := r.FormValue("Name")
labels := r.FormValue("Labels")
if apiVersion == "" {
- http.Error(w, "Missing apiVersion mandatory parameter", http.StatusBadRequest)
+ http.Error(w, "Missing ApiVersion mandatory parameter", http.StatusBadRequest)
return
}
if kind == "" {
- http.Error(w, "Missing kind mandatory parameter", http.StatusBadRequest)
- return
- }
- if name == "" && labels == "" {
- http.Error(w, "Name or Labels parameter must be provided", http.StatusBadRequest)
+ http.Error(w, "Missing Kind mandatory parameter", http.StatusBadRequest)
return
}
resp, err := i.client.Query(id, apiVersion, kind, name, labels)