X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=mso-api-handlers%2Fmso-api-handler-infra%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fso%2Fapihandlerinfra%2FServiceInstances.java;fp=mso-api-handlers%2Fmso-api-handler-infra%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fso%2Fapihandlerinfra%2FServiceInstances.java;h=17967ca9049b5be421cf82be935503bcaa0c4686;hb=f46e824fe4730738cc422e87facc5c80ffa44b10;hp=d4331dcfe80c370edded1c7f6122d953f505236d;hpb=43224c4dc5ff3bf67979f480d8628f300497da07;p=so.git 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 d4331dcfe8..17967ca904 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 @@ -809,6 +809,29 @@ public class ServiceInstances extends AbstractRestHandler { } } + @PUT + @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/pnfs/{pnfInstanceId}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @Operation(description = "Create PNF on a specified version and serviceInstance", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) + @Transactional + public Response updatePnfInstance(String request, @PathParam("version") String version, + @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("pnfInstanceId") String pnfInstanceId, + @Context ContainerRequestContext requestContext) throws ApiException { + String requestId = requestHandlerUtils.getRequestId(requestContext); + HashMap instanceIdMap = new HashMap<>(); + instanceIdMap.put("serviceInstanceId", serviceInstanceId); + instanceIdMap.put("pnfInstanceId", pnfInstanceId); + try { + return serviceInstances(request, Action.updateInstance, instanceIdMap, version, requestId, + requestHandlerUtils.getRequestUri(requestContext, uriPrefix)); + } catch (Exception e) { + logger.error("Error in pnf", e); + throw e; + } + } + @POST @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks") @Consumes(MediaType.APPLICATION_JSON)