summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra
diff options
context:
space:
mode:
authorsanket12345 <SX00562924@techmahindra.com>2021-08-20 17:49:49 +0530
committerSanchita Pathak <sanchita@techmahindra.com>2021-08-25 09:35:19 +0000
commita24258bd4e9a3aca020e097306744daa1efce704 (patch)
tree8d1e78bb2e6183dc6f0adde0d32cd8d17ad22761 /mso-api-handlers/mso-api-handler-infra
parent9e597da1e74ab81a27879f6100335e6815ff1702 (diff)
Expose HealthCheck Northbound API of SO
Code changes in CNFO to Create Workflow and Expose if over Northbound API of SO Issue-ID: SO-3716 Signed-off-by: sanket12345 <SX00562924@techmahindra.com> Change-Id: I88f55f115c112d613f42f0b800aeb5491d7c6ace
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java18
2 files changed, 19 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
index 2a91eaef5a..469c99eeb0 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
@@ -45,6 +45,7 @@ public enum Action implements Actions {
deactivateAndCloudDelete,
scaleOut,
recreateInstance,
+ healthCheck,
addMembers,
removeMembers,
forCustomWorkflow
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
index 36922a878f..ed4a52ada0 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
@@ -414,6 +414,24 @@ public class ServiceInstances extends AbstractRestHandler {
requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
}
+ @POST
+ @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/healthcheck")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @Operation(description = "HealthCheck for provided VNF instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
+ @Transactional
+ public Response cnfHealthCheck(String request, @PathParam("version") String version,
+ @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
+ @Context ContainerRequestContext requestContext) throws ApiException {
+ String requestId = requestHandlerUtils.getRequestId(requestContext);
+ HashMap<String, String> instanceIdMap = new HashMap<>();
+ instanceIdMap.put("serviceInstanceId", serviceInstanceId);
+ instanceIdMap.put("vnfInstanceId", vnfInstanceId);
+ return serviceInstances(request, Action.healthCheck, instanceIdMap, version, requestId,
+ requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
+ }
+
@PUT
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)