From 4594749442492e5107ea5aa7ef1e27285eee7eea Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Thu, 22 May 2025 14:04:19 +0200
Subject: [PATCH 1/2] add clusterId as query param

---
 .../geant/nmaas/portal/api/market/AppInstanceController.java | 5 ++++-
 .../nmaas/portal/api/market/AppInstanceControllerTest.java   | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/java/net/geant/nmaas/portal/api/market/AppInstanceController.java b/src/main/java/net/geant/nmaas/portal/api/market/AppInstanceController.java
index ca76028b1..81365d8a6 100644
--- a/src/main/java/net/geant/nmaas/portal/api/market/AppInstanceController.java
+++ b/src/main/java/net/geant/nmaas/portal/api/market/AppInstanceController.java
@@ -57,6 +57,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.lang.reflect.Field;
@@ -252,7 +253,9 @@ public class AppInstanceController extends AppBaseController {
     @Transactional
     public Id createAppInstance(@RequestBody AppInstanceRequest appInstanceRequest,
                                 @NotNull Principal principal,
-                                @PathVariable Long domainId) {
+                                @PathVariable Long domainId,
+                                @RequestParam(name = "clusterId",required = false) Long clusterId) {
+        log.error("Cluster = {}", clusterId);
         Application app = getApp(appInstanceRequest.getApplicationId());
         Domain domain = domainService.findDomain(domainId)
                 .orElseThrow(() -> new MissingElementException("Domain not found"));
diff --git a/src/test/java/net/geant/nmaas/portal/api/market/AppInstanceControllerTest.java b/src/test/java/net/geant/nmaas/portal/api/market/AppInstanceControllerTest.java
index 2faa5e053..6cd0015ac 100644
--- a/src/test/java/net/geant/nmaas/portal/api/market/AppInstanceControllerTest.java
+++ b/src/test/java/net/geant/nmaas/portal/api/market/AppInstanceControllerTest.java
@@ -453,7 +453,7 @@ public class AppInstanceControllerTest {
         when(applicationService.findApplication(appInstanceRequest.getApplicationId())).thenReturn(Optional.of(application));
 
         assertThrows(IllegalArgumentException.class, () -> {
-            this.appInstanceController.createAppInstance(appInstanceRequest, principal,domainId);
+            this.appInstanceController.createAppInstance(appInstanceRequest, principal,domainId, null);
         });
     }
 
-- 
GitLab


From b76b2c03d7d583dd35857247cfab4440d4763c43 Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Thu, 22 May 2025 14:04:31 +0200
Subject: [PATCH 2/2] add new labels

---
 src/test/shell/data/i18n/de.json | 8 ++++++--
 src/test/shell/data/i18n/en.json | 7 +++++--
 src/test/shell/data/i18n/fr.json | 8 ++++++--
 src/test/shell/data/i18n/pl.json | 8 ++++++--
 4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/test/shell/data/i18n/de.json b/src/test/shell/data/i18n/de.json
index 70edc1e5f..3a07ad01e 100644
--- a/src/test/shell/data/i18n/de.json
+++ b/src/test/shell/data/i18n/de.json
@@ -515,7 +515,9 @@
     "DEPLOY_BUTTON": "Installieren",
     "USE_DEFAULT_VERSION": "Standardversion verwenden",
     "SELECT_VERSION": "Version auswählen",
-    "AUTO_UPGRADES_ENABLED": "Automatische upgrades aktivieren"
+    "AUTO_UPGRADES_ENABLED": "Automatische upgrades aktivieren",
+    "REMOTE_CLUSTER" : "Use remote cluster",
+    "SELECT_CLUSTER": "Remote location"
   },
   "ADD_MEMBERS_MODAL": {
     "HEADER": "Add members",
@@ -1321,6 +1323,8 @@
     "DOMAIN_CREATION" : "Domain creation",
     "APPLICATION_DEPLOYMENT" : "Application deployment",
     "USER_ASSIGNMENT" : "User assignment",
-    "DOMAIN_GROUP_CHANGE" : "Domain group change"
+    "DOMAIN_GROUP_CHANGE" : "Domain group change",
+    "NEW" : "Add webhook",
+    "DETAILS" : "Webhooks details"
   }
 }
diff --git a/src/test/shell/data/i18n/en.json b/src/test/shell/data/i18n/en.json
index de426e285..6484fdeae 100644
--- a/src/test/shell/data/i18n/en.json
+++ b/src/test/shell/data/i18n/en.json
@@ -517,7 +517,9 @@
     "DEPLOY_BUTTON": "Deploy",
     "USE_DEFAULT_VERSION": "Use default version",
     "SELECT_VERSION": "Select version",
-    "AUTO_UPGRADES_ENABLED": "Enable automatic upgrades"
+    "AUTO_UPGRADES_ENABLED": "Enable automatic upgrades",
+    "REMOTE_CLUSTER" : "Use remote cluster",
+    "SELECT_CLUSTER": "Remote location"
   },
   "ADD_MEMBERS_MODAL": {
     "HEADER": "Add members",
@@ -1327,6 +1329,7 @@
     "APPLICATION_DEPLOYMENT" : "Application deployment",
     "USER_ASSIGNMENT" : "User assignment",
     "DOMAIN_GROUP_CHANGE" : "Domain group change",
-    "NEW" : "Add webhook"
+    "NEW" : "Add webhook",
+    "DETAILS" : "Webhooks details"
   }
 }
diff --git a/src/test/shell/data/i18n/fr.json b/src/test/shell/data/i18n/fr.json
index 43daf12ff..449bdc580 100644
--- a/src/test/shell/data/i18n/fr.json
+++ b/src/test/shell/data/i18n/fr.json
@@ -517,7 +517,9 @@
     "DEPLOY_BUTTON": "Déployer",
     "USE_DEFAULT_VERSION": "Utiliser la version par défaut",
     "SELECT_VERSION": "Sélectionnez la version",
-    "AUTO_UPGRADES_ENABLED": "Activer les mises à jour automatiques"
+    "AUTO_UPGRADES_ENABLED": "Activer les mises à jour automatiques",
+    "REMOTE_CLUSTER" : "Use remote cluster",
+    "SELECT_CLUSTER": "Remote location"
   },
   "ADD_MEMBERS_MODAL": {
     "HEADER": "Add members",
@@ -1325,6 +1327,8 @@
     "DOMAIN_CREATION" : "Domain creation",
     "APPLICATION_DEPLOYMENT" : "Application deployment",
     "USER_ASSIGNMENT" : "User assignment",
-    "DOMAIN_GROUP_CHANGE" : "Domain group change"
+    "DOMAIN_GROUP_CHANGE" : "Domain group change",
+    "NEW" : "Add webhook",
+    "DETAILS" : "Webhooks details"
   }
 }
diff --git a/src/test/shell/data/i18n/pl.json b/src/test/shell/data/i18n/pl.json
index 61ef098c7..ae51c715d 100644
--- a/src/test/shell/data/i18n/pl.json
+++ b/src/test/shell/data/i18n/pl.json
@@ -516,7 +516,9 @@
     "DEPLOY_BUTTON": "Uruchom",
     "USE_DEFAULT_VERSION": "Użyj domyślnej wersji",
     "SELECT_VERSION": "Wybierz wersję",
-    "AUTO_UPGRADES_ENABLED": "Włącz automatyczne aktualizacje"
+    "AUTO_UPGRADES_ENABLED": "Włącz automatyczne aktualizacje",
+    "REMOTE_CLUSTER" : "Uruchomienie na zewnęntrzym klastrze",
+    "SELECT_CLUSTER": "Zdalna lokalizacja"
   },
   "ADD_MEMBERS_MODAL": {
     "HEADER": "Dodaj użytkowników",
@@ -1324,6 +1326,8 @@
     "DOMAIN_CREATION" : "Domain creation",
     "APPLICATION_DEPLOYMENT" : "Application deployment",
     "USER_ASSIGNMENT" : "User assignment",
-    "DOMAIN_GROUP_CHANGE" : "Domain group change"
+    "DOMAIN_GROUP_CHANGE" : "Domain group change",
+    "NEW" : "Add webhook",
+    "DETAILS" : "Webhooks details"
   }
 }
-- 
GitLab