aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/api/logicalCloudHandler.go
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2020-09-28 23:51:43 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-28 23:51:43 +0000
commit603a68284970205fa95dec67d4f9b88ae99e8d2c (patch)
treed16937051fd21723fe37e558a71e35ca3fcadadd /src/dcm/api/logicalCloudHandler.go
parent5a8a4cc2fa457c334ea8254762725d70371cf56a (diff)
parent20da89d07ad69a2cb067ceb0c416752e558bcf62 (diff)
Merge "Add a couple of sanity checks in DCM"
Diffstat (limited to 'src/dcm/api/logicalCloudHandler.go')
-rw-r--r--src/dcm/api/logicalCloudHandler.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dcm/api/logicalCloudHandler.go b/src/dcm/api/logicalCloudHandler.go
index 2e1811b7..fb0f0c63 100644
--- a/src/dcm/api/logicalCloudHandler.go
+++ b/src/dcm/api/logicalCloudHandler.go
@@ -186,6 +186,13 @@ func (h logicalCloudHandler) applyHandler(w http.ResponseWriter, r *http.Request
return
}
+ _, ctxVal, err := h.client.GetLogicalCloudContext(name)
+ if ctxVal != "" {
+ err = pkgerrors.New("Logical Cloud already applied")
+ http.Error(w, err.Error(), http.StatusConflict)
+ return
+ }
+
// Get Clusters
clusters, err := h.clusterClient.GetAllClusters(project, name)