diff options
author | Yoav Schneiderman <yoav.schneiderman@intl.att.com> | 2019-12-18 21:04:38 +0200 |
---|---|---|
committer | Einat Vinouze <einat.vinouze@intl.att.com> | 2019-12-24 11:46:22 +0200 |
commit | 89de17b50dcd1d29fb87acfe518d1ddf43c1408a (patch) | |
tree | a6ae4d0c697c9e016bb86733d9df6eebe6a0ee88 /vid-app-common | |
parent | 8fd9bd94ca80daf31a8fc83893503120d9405a2f (diff) |
move templates API to a intended controller
Issue-ID: VID-730
Change-Id: Id2aa44803a190333b5a96fda77ca15d254b4c222
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-app-common')
2 files changed, 14 insertions, 12 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java index 3260656ff..6c8a37262 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java @@ -76,20 +76,11 @@ public class AsyncInstantiationController extends VidRestrictedBaseController { this.auditService = auditService; } - /** - * Gets the new services status. - * @param request the request - * @return the services list - */ @RequestMapping(method = RequestMethod.GET) - public List<ServiceInfo> getServicesInfo(HttpServletRequest request, - @RequestParam(value = "serviceModelId", required = false) UUID serviceModelId) { - if (serviceModelId == null) { - return asyncInstantiationBL.getAllServicesInfo(); - } else { - return asyncInstantiationRepository.listInstantiatedServicesByServiceModelId(serviceModelId); - } + public List<ServiceInfo> getServicesInfo(HttpServletRequest request) { + return asyncInstantiationBL.getAllServicesInfo(); } + @RequestMapping(value = "bulk", method = RequestMethod.POST) public MsoResponseWrapper2<List<String>> createBulkOfServices(@RequestBody ServiceInstantiation request, HttpServletRequest httpServletRequest) { //Push to DB according the model diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/InstantiationTemplatesController.java b/vid-app-common/src/main/java/org/onap/vid/controller/InstantiationTemplatesController.java index 8aae3d805..ff9add2b6 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/InstantiationTemplatesController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/InstantiationTemplatesController.java @@ -21,9 +21,11 @@ package org.onap.vid.controller; +import java.util.List; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.onap.vid.dal.AsyncInstantiationRepository; +import org.onap.vid.model.ServiceInfo; import org.onap.vid.model.serviceInstantiation.ServiceInstantiation; import org.onap.vid.services.AsyncInstantiationBusinessLogic; import org.onap.vid.services.InstantiationTemplatesService; @@ -31,6 +33,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController @@ -53,6 +57,13 @@ public class InstantiationTemplatesController extends VidRestrictedBaseControlle this.asyncInstantiationRepository = asyncInstantiationRepository; } + + @GetMapping + public List<ServiceInfo> getTemplatesInfo(HttpServletRequest request, + @RequestParam(value = "serviceModelId") UUID serviceModelId) { + return asyncInstantiationRepository.listInstantiatedServicesByServiceModelId(serviceModelId); + } + @GetMapping("templateTopology/{jobId}") public ServiceInstantiation getTemplateTopology(HttpServletRequest request, @PathVariable(value="jobId") UUID jobId) { return instantiationTemplates.getJobRequestAsTemplate(jobId); |