diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2021-08-13 14:52:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-08-13 14:52:41 +0000 |
commit | 07f292919103fb1fa505944639a163578694f839 (patch) | |
tree | 18172ea80234e8906d209e2413ea71722ca843a9 /mso-api-handlers | |
parent | 27c3d83a8b8c70aa923896fd655e739f2b013c3b (diff) | |
parent | 30106b39d2ac1bc206134cfcb8fc73eb1f29b923 (diff) |
Merge "Add new endpoint and macro for service upgrade"
Diffstat (limited to 'mso-api-handlers')
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 88c4bc3b04..2a91eaef5a 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 @@ -26,6 +26,7 @@ public enum Action implements Actions { updateInstance, deleteInstance, configureInstance, + upgradeInstance, replaceInstance, replaceInstanceRetainAssignments, activateInstance, 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 bcbc7c7ca6..36922a878f 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 @@ -379,6 +379,24 @@ public class ServiceInstances extends AbstractRestHandler { } @POST + @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/upgrade") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @Operation(description = "Upgrade a Service Instance to newer model", responses = @ApiResponse( + content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))) + @Transactional + public Response upgradeServiceInstance(String request, @PathParam("version") String version, + @PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext) + throws ApiException { + String requestId = requestHandlerUtils.getRequestId(requestContext); + HashMap<String, String> instanceIdMap = new HashMap<>(); + instanceIdMap.put("serviceInstanceId", serviceInstanceId); + + return serviceInstances(request, Action.upgradeInstance, instanceIdMap, version, requestId, + requestHandlerUtils.getRequestUri(requestContext, uriPrefix)); + } + + @POST @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) |