aboutsummaryrefslogtreecommitdiffstats
path: root/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service
diff options
context:
space:
mode:
authorMukesh Paliwal <mukesh.paliwal1@huawei.com>2021-10-20 09:42:28 +0530
committerMukesh Paliwal <mukesh.paliwal1@huawei.com>2021-10-28 08:00:27 +0000
commit7cbb2d84bdfb1b467c5799ea267b9300fee609f6 (patch)
treeef709f92d9a961f2341aac6f55d005e62a8f88dd /so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service
parent18a52fdb476285d33757879aa69e7a4f247f5e14 (diff)
Adding Custom workflow changesistanbul
Issue-ID: SO-3765 Signed-off-by: Mukesh Paliwal <mukesh.paliwal1@huawei.com> Change-Id: I7e315e16c71c0be2648550c3b6ed9ac7ba26cb6b
Diffstat (limited to 'so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service')
-rw-r--r--so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
index 1069dd3..0cca471 100644
--- a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
+++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
@@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
+import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -655,4 +656,35 @@ public class SoMonitoringController {
}
}
+ @DELETE
+ @Path("/serviceRecipes/{id}")
+ @Produces({MediaType.APPLICATION_JSON})
+ public Response delServiceRecipe(final @PathParam("id") String id) {
+ try {
+ catalogDbClient.deleteServiceRecipe(id);
+ } catch (Exception e) {
+ LOGGER.info("SoMonitoringController delServiceRecipe error: {}", e.getMessage());
+ return Response.status(Status.INTERNAL_SERVER_ERROR).entity("{\"errMsg\":\"Unable to delete service recipe.\"}").build();
+ }
+ return Response.status(Status.OK).build();
+ }
+
+ @GET
+ @Path("/serviceTemplates")
+ @Produces({MediaType.APPLICATION_JSON})
+ public Response getServices() {
+ List<Service> services = catalogDbClient.getServices();
+ Map<String, List<Map<String, String>>> mapServices = new HashMap<String, List<Map<String, String>>>();
+ List<Map<String, String>> serviceList = new ArrayList<Map<String, String>>();
+ for (Service service : services) {
+ Map<String, String> serviceObj = new HashMap<String, String>();
+ serviceObj.put("modelInvariantId", service.getModelInvariantId());
+ serviceObj.put("modelVersionId", service.getModelVersionId());
+ serviceObj.put("modelName", service.getModelName());
+ serviceList.add(serviceObj);
+ }
+ mapServices.put("services", serviceList);
+ return Response.status(Status.OK).entity(mapServices).build();
+ }
+
}