aboutsummaryrefslogtreecommitdiffstats
path: root/src/ovnaction/api/workloadifintenthandler.go
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2020-10-05 22:45:38 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-05 22:45:38 +0000
commitbb3df0da7c6eddee2f2fe36a46aa86860fc53f92 (patch)
tree65dacebb91fb6dff900da5df5407d10bcf01184c /src/ovnaction/api/workloadifintenthandler.go
parent9966f6af186676f38754c64759496eef0a1bc508 (diff)
parent1fc90f15489ae3eafeb5994f5285f09750feae4c (diff)
Merge "Ovnaction and vfw updates for deploy api change"
Diffstat (limited to 'src/ovnaction/api/workloadifintenthandler.go')
-rw-r--r--src/ovnaction/api/workloadifintenthandler.go24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/ovnaction/api/workloadifintenthandler.go b/src/ovnaction/api/workloadifintenthandler.go
index e7be6317..5c396378 100644
--- a/src/ovnaction/api/workloadifintenthandler.go
+++ b/src/ovnaction/api/workloadifintenthandler.go
@@ -22,8 +22,8 @@ import (
"io"
"net/http"
- moduleLib "github.com/onap/multicloud-k8s/src/ovnaction/pkg/module"
"github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/validation"
+ moduleLib "github.com/onap/multicloud-k8s/src/ovnaction/pkg/module"
pkgerrors "github.com/pkg/errors"
"github.com/gorilla/mux"
@@ -90,6 +90,7 @@ func (h workloadifintentHandler) createHandler(w http.ResponseWriter, r *http.Re
project := vars["project"]
compositeApp := vars["composite-app-name"]
compositeAppVersion := vars["version"]
+ deployIntentGroup := vars["deployment-intent-group-name"]
netControlIntent := vars["net-control-intent"]
workloadIntent := vars["workload-intent"]
@@ -105,10 +106,10 @@ func (h workloadifintentHandler) createHandler(w http.ResponseWriter, r *http.Re
}
err, httpError := validation.ValidateJsonSchemaData(netIfJSONFile, wif)
-if err != nil {
- http.Error(w, err.Error(), httpError)
- return
-}
+ if err != nil {
+ http.Error(w, err.Error(), httpError)
+ return
+ }
// Name is required.
if wif.Metadata.Name == "" {
@@ -127,7 +128,7 @@ if err != nil {
return
}
- ret, err := h.client.CreateWorkloadIfIntent(wif, project, compositeApp, compositeAppVersion, netControlIntent, workloadIntent, false)
+ ret, err := h.client.CreateWorkloadIfIntent(wif, project, compositeApp, compositeAppVersion, deployIntentGroup, netControlIntent, workloadIntent, false)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -150,6 +151,7 @@ func (h workloadifintentHandler) putHandler(w http.ResponseWriter, r *http.Reque
project := vars["project"]
compositeApp := vars["composite-app-name"]
compositeAppVersion := vars["version"]
+ deployIntentGroup := vars["deployment-intent-group-name"]
netControlIntent := vars["net-control-intent"]
workloadIntent := vars["workload-intent"]
@@ -188,7 +190,7 @@ func (h workloadifintentHandler) putHandler(w http.ResponseWriter, r *http.Reque
return
}
- ret, err := h.client.CreateWorkloadIfIntent(wif, project, compositeApp, compositeAppVersion, netControlIntent, workloadIntent, true)
+ ret, err := h.client.CreateWorkloadIfIntent(wif, project, compositeApp, compositeAppVersion, deployIntentGroup, netControlIntent, workloadIntent, true)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -211,19 +213,20 @@ func (h workloadifintentHandler) getHandler(w http.ResponseWriter, r *http.Reque
project := vars["project"]
compositeApp := vars["composite-app-name"]
compositeAppVersion := vars["version"]
+ deployIntentGroup := vars["deployment-intent-group-name"]
netControlIntent := vars["net-control-intent"]
workloadIntent := vars["workload-intent"]
var ret interface{}
var err error
if len(name) == 0 {
- ret, err = h.client.GetWorkloadIfIntents(project, compositeApp, compositeAppVersion, netControlIntent, workloadIntent)
+ ret, err = h.client.GetWorkloadIfIntents(project, compositeApp, compositeAppVersion, deployIntentGroup, netControlIntent, workloadIntent)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
} else {
- ret, err = h.client.GetWorkloadIfIntent(name, project, compositeApp, compositeAppVersion, netControlIntent, workloadIntent)
+ ret, err = h.client.GetWorkloadIfIntent(name, project, compositeApp, compositeAppVersion, deployIntentGroup, netControlIntent, workloadIntent)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -246,10 +249,11 @@ func (h workloadifintentHandler) deleteHandler(w http.ResponseWriter, r *http.Re
project := vars["project"]
compositeApp := vars["composite-app-name"]
compositeAppVersion := vars["version"]
+ deployIntentGroup := vars["deployment-intent-group-name"]
netControlIntent := vars["net-control-intent"]
workloadIntent := vars["workload-intent"]
- err := h.client.DeleteWorkloadIfIntent(name, project, compositeApp, compositeAppVersion, netControlIntent, workloadIntent)
+ err := h.client.DeleteWorkloadIfIntent(name, project, compositeApp, compositeAppVersion, deployIntentGroup, netControlIntent, workloadIntent)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return