From ea8a77eb27bf00301a54d55859d5c236bc48a92a Mon Sep 17 00:00:00 2001 From: pkazimierowski <pkazimierowski@man.poznan.pl> Date: Wed, 28 May 2025 13:53:40 +0200 Subject: [PATCH] some changes --- .../AppLifecycleManagerRestController.java | 17 ------------ .../api/market/AppInstanceController.java | 27 +++++++++++++------ src/test/shell/data/i18n/de.json | 4 ++- src/test/shell/data/i18n/en.json | 4 ++- src/test/shell/data/i18n/fr.json | 4 ++- src/test/shell/data/i18n/pl.json | 4 ++- 6 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/main/java/net/geant/nmaas/orchestration/api/AppLifecycleManagerRestController.java b/src/main/java/net/geant/nmaas/orchestration/api/AppLifecycleManagerRestController.java index 983ae294c..beccf2ed9 100644 --- a/src/main/java/net/geant/nmaas/orchestration/api/AppLifecycleManagerRestController.java +++ b/src/main/java/net/geant/nmaas/orchestration/api/AppLifecycleManagerRestController.java @@ -109,22 +109,5 @@ public class AppLifecycleManagerRestController { return ex.getMessage(); } - /** - * @param deploymentId unique identifier of the deployed user application - */ - @PutMapping("/{deploymentId}/scale-down") - public ResponseEntity<Void> scaleDownApp(@PathVariable String deploymentId) { - lifecycleManager.scaleDown(new Identifier(deploymentId)); - return ResponseEntity.ok().build(); - } - - /** - * @param deploymentId unique identifier of the deployed user application - */ - @PutMapping("/{deploymentId}/scale-up") - public ResponseEntity<Void> scaleUpApp(@PathVariable String deploymentId) { - lifecycleManager.scaleUp(new Identifier(deploymentId)); - return ResponseEntity.ok().build(); - } } 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 81365d8a6..0e1299837 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 @@ -48,17 +48,11 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationEventPublisher; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -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 org.springframework.web.bind.annotation.*; import java.lang.reflect.Field; import java.security.Principal; @@ -763,5 +757,22 @@ public class AppInstanceController extends AppBaseController { } return pageable; } + /** + * @param deploymentId unique identifier of the deployed user application + */ + @PutMapping("/{deploymentId}/scale-down") + public ResponseEntity<Void> scaleDownApp(@PathVariable String deploymentId) { + appLifecycleManager.scaleDown(new Identifier(deploymentId)); + return ResponseEntity.ok().build(); + } + + /** + * @param deploymentId unique identifier of the deployed user application + */ + @PutMapping("/{deploymentId}/scale-up") + public ResponseEntity<Void> scaleUpApp(@PathVariable String deploymentId) { + appLifecycleManager.scaleUp(new Identifier(deploymentId)); + return ResponseEntity.ok().build(); + } } diff --git a/src/test/shell/data/i18n/de.json b/src/test/shell/data/i18n/de.json index 3ffdc0788..44301c83b 100644 --- a/src/test/shell/data/i18n/de.json +++ b/src/test/shell/data/i18n/de.json @@ -314,7 +314,9 @@ "RATING": "Rating", "POPULAR": "Popularity", "DATE" : "Date added" - } + }, + "SCALE_UP": "Fortsetzen", + "SCALE_DOWN": "Pause" }, "MONITOR": { "TITLE": "Überwachungsservice", diff --git a/src/test/shell/data/i18n/en.json b/src/test/shell/data/i18n/en.json index cfdd02ec4..4b2db4c1f 100644 --- a/src/test/shell/data/i18n/en.json +++ b/src/test/shell/data/i18n/en.json @@ -315,7 +315,9 @@ "RATING": "Rating", "POPULAR": "Popularity", "DATE" : "Date added" - } + }, + "SCALE_UP": "Resume", + "SCALE_DOWN": "Pause" }, "MONITOR": { "TITLE": "Monitor service", diff --git a/src/test/shell/data/i18n/fr.json b/src/test/shell/data/i18n/fr.json index 9a2949633..f5e56f1a4 100644 --- a/src/test/shell/data/i18n/fr.json +++ b/src/test/shell/data/i18n/fr.json @@ -316,7 +316,9 @@ "RATING": "Rating", "POPULAR": "Popularity", "DATE" : "Date added" - } + }, + "SCALE_UP": "Reprende", + "SCALE_DOWN": "Pause" }, "MONITOR": { "TITLE": "Monitor service", diff --git a/src/test/shell/data/i18n/pl.json b/src/test/shell/data/i18n/pl.json index 5e12f67b1..445db45ed 100644 --- a/src/test/shell/data/i18n/pl.json +++ b/src/test/shell/data/i18n/pl.json @@ -316,7 +316,9 @@ "RATING": "Ocena", "POPULAR": "Popularność", "DATE" : "Data dodania" - } + }, + "SCALE_UP": "Wznów", + "SCALE_DOWN": "Pauza" }, "MONITOR": { "TITLE": "Monitorowanie", -- GitLab