diff options
Diffstat (limited to 'cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java')
-rw-r--r-- | cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java index 60fccd1..cf9c269 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java @@ -31,6 +31,11 @@ package org.onap.optf.ticketmgt.service.rs; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; @@ -40,7 +45,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - import org.onap.optf.cmso.common.CMSRequestError; import org.onap.optf.ticketmgt.service.rs.models.ActiveTicketsRequest; import org.onap.optf.ticketmgt.service.rs.models.ActiveTicketsResponse; @@ -48,72 +52,65 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - @Api("Availability Interface") @Path("/{apiVersion}") @Produces({MediaType.APPLICATION_JSON}) public interface AvailabilityInterface { // ****************************************************************** - + @POST @Path("/activetickets") @Produces({MediaType.APPLICATION_JSON}) - @RequestMapping(value = "/{apiVersion}/activetickets", method = RequestMethod.POST, - consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) - @ApiOperation(value = "Request Active Tickets", notes = "API to support conflict avoidance. Retrieves the active ticket data for the " - + "passed criteria to detemine availability of passed elements within the passed time window." - + "\nIf the request results in asynchronous processging, IN_PROGRESS status will be returned and the " - + "optimizer will begin to poll the request until COMPLETED.", - response = ActiveTicketsResponse.class) - @ApiResponses( - value = {@ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class), + @RequestMapping(value = "/{apiVersion}/activetickets", method = RequestMethod.POST, + consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) + @ApiOperation(value = "Request Active Tickets", + notes = "API to support conflict avoidance. Retrieves the active ticket data for the " + + "passed criteria to detemine availability of passed elements within the passed time window." + + "\nIf the request results in asynchronous processging, IN_PROGRESS status will be returned and the " + + "optimizer will begin to poll the request until COMPLETED.", + response = ActiveTicketsResponse.class) + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"), + @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class), @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) public Response getActiveTickets( - @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(value="v1") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Active ticket criteria (elements and change windows).") ActiveTicketsRequest activeTicketsRequest - ); + @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable( + value = "v1") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Active ticket criteria (elements and change windows).") ActiveTicketsRequest activeTicketsRequest); @GET @Path("/activetickets/{id}") @Produces({MediaType.APPLICATION_JSON}) - @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.GET, - consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) - @ApiOperation(value = "Poll Active Tickets Request", notes = "Poll for the status of the request id. Optimizser will " - + " poll until status is COMPLETED and issue acknowledge (DELETE) API to acknowledge the " - + "receipt of the response.", - response = ActiveTicketsResponse.class) - @ApiResponses( - value = {@ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "Not found.", response = CMSRequestError.class), + @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.GET, + consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) + @ApiOperation(value = "Poll Active Tickets Request", + notes = "Poll for the status of the request id. Optimizser will " + + " poll until status is COMPLETED and issue acknowledge (DELETE) API to acknowledge the " + + "receipt of the response.", + response = ActiveTicketsResponse.class) + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"), + @ApiResponse(code = 404, message = "Not found.", response = CMSRequestError.class), @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) public Response pollActiveTickets( - @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(value="v1") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Active tickets request id.") @PathParam("id") String id - ); + @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable( + value = "v1") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Active tickets request id.") @PathParam("id") String id); @DELETE @Path("/activetickets/{id}") @Produces({MediaType.APPLICATION_JSON}) - @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.DELETE, - consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) + @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.DELETE, + consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) @ApiOperation(value = "Acknowledge Active Tickets Response", notes = "API call used to acknowledge the receipt" - + " of a COMPLETED asynchronous request to enable the Ticket Management service to remove it from their cache." - + " The service may remove from the cache on the poll request. The optimizer will treat Not found reponse on as normal.", - response = ActiveTicketsResponse.class) - @ApiResponses( - value = {@ApiResponse(code = 204, message = "OK"), - @ApiResponse(code = 404, message = "Not found", response = CMSRequestError.class), + + " of a COMPLETED asynchronous request to enable the Ticket Management service to remove it from their cache." + + " The service may remove from the cache on the poll request. The optimizer will treat Not found reponse on as normal.", + response = ActiveTicketsResponse.class) + @ApiResponses(value = {@ApiResponse(code = 204, message = "OK"), + @ApiResponse(code = 404, message = "Not found", response = CMSRequestError.class), @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) public Response deleteActiveTicketsRequest( - @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(value="v1") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Active tickets request id.") @PathParam("id") String id - ); + @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable( + value = "v1") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Active tickets request id.") @PathParam("id") String id); } |