aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/brokerhandler.go
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2020-01-07 15:33:04 +0100
committerKonrad Bańka <k.banka@samsung.com>2020-01-07 15:33:04 +0100
commit4f411bacefec35c9a51e078175668aa97a398477 (patch)
tree84a3110745d0ab5d5f5455a1d32b9af3917cbcf9 /src/k8splugin/api/brokerhandler.go
parent2a35410560f1c22ed12cd137cbf843e36f74740e (diff)
Instantiate infra_workload based on vf-module-*-ids
Deprecate k8s-rb-definition-* parameters from sdnc_directives in favor of vf-module-*-id that are used by newer artifact broker. Issue-ID: MULTICLOUD-836 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I26ae16bd53ced56ae11523584f900a102f6e0bb9
Diffstat (limited to 'src/k8splugin/api/brokerhandler.go')
-rw-r--r--src/k8splugin/api/brokerhandler.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/k8splugin/api/brokerhandler.go b/src/k8splugin/api/brokerhandler.go
index b377baf1..7671db44 100644
--- a/src/k8splugin/api/brokerhandler.go
+++ b/src/k8splugin/api/brokerhandler.go
@@ -134,15 +134,13 @@ func (b brokerInstanceHandler) createHandler(w http.ResponseWriter, r *http.Requ
return
}
- rbName := req.getAttributeValue(req.SDNCDirectives, "k8s-rb-definition-name")
- if rbName == "" {
- http.Error(w, "k8s-rb-definition-name is missing from sdnc-directives", http.StatusBadRequest)
+ if req.VFModuleModelInvariantID == "" {
+ http.Error(w, "vf-module-model-invariant-id is empty", http.StatusBadRequest)
return
}
- rbVersion := req.getAttributeValue(req.SDNCDirectives, "k8s-rb-definition-version")
- if rbVersion == "" {
- http.Error(w, "k8s-rb-definition-version is missing from sdnc-directives", http.StatusBadRequest)
+ if req.VFModuleModelVersionID == "" {
+ http.Error(w, "vf-module-model-version-id is empty", http.StatusBadRequest)
return
}
@@ -160,8 +158,8 @@ func (b brokerInstanceHandler) createHandler(w http.ResponseWriter, r *http.Requ
// Setup the resource parameters for making the request
var instReq app.InstanceRequest
- instReq.RBName = rbName
- instReq.RBVersion = rbVersion
+ instReq.RBName = req.VFModuleModelInvariantID
+ instReq.RBVersion = req.VFModuleModelVersionID
instReq.ProfileName = profileName
instReq.CloudRegion = cloudRegion
instReq.Labels = map[string]string{