added svcapi ui and camunda code
[it/otf.git] / otf-service-api / src / main / java / org / oran / otf / api / service / TestExecutionService.java
1 /*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
2 #                                                                              #\r
3 #   Licensed under the Apache License, Version 2.0 (the "License");            #\r
4 #   you may not use this file except in compliance with the License.           #\r
5 #   You may obtain a copy of the License at                                    #\r
6 #                                                                              #\r
7 #       http://www.apache.org/licenses/LICENSE-2.0                             #\r
8 #                                                                              #\r
9 #   Unless required by applicable law or agreed to in writing, software        #\r
10 #   distributed under the License is distributed on an "AS IS" BASIS,          #\r
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
12 #   See the License for the specific language governing permissions and        #\r
13 #   limitations under the License.                                             #\r
14 ##############################################################################*/\r
15 \r
16 \r
17 package org.oran.otf.api.service;\r
18 \r
19 import org.oran.otf.common.model.TestExecution;\r
20 import org.oran.otf.common.model.local.OTFApiResponse;\r
21 import io.swagger.annotations.Api;\r
22 import io.swagger.v3.oas.annotations.Operation;\r
23 import io.swagger.v3.oas.annotations.media.Content;\r
24 import io.swagger.v3.oas.annotations.media.Schema;\r
25 import io.swagger.v3.oas.annotations.responses.ApiResponse;\r
26 import io.swagger.v3.oas.annotations.tags.Tag;\r
27 import javax.ws.rs.GET;\r
28 import javax.ws.rs.HeaderParam;\r
29 import javax.ws.rs.Path;\r
30 import javax.ws.rs.PathParam;\r
31 import javax.ws.rs.Produces;\r
32 import javax.ws.rs.core.MediaType;\r
33 import javax.ws.rs.core.Response;\r
34 \r
35 import org.springframework.stereotype.Component;\r
36 \r
37 @Component\r
38 @Api\r
39 @Path("/testExecution")\r
40 @Tag(name = "Test Services", description = "")\r
41 @Produces(MediaType.APPLICATION_JSON)\r
42 public interface TestExecutionService {\r
43   @GET\r
44   @Path("v1/status/executionId/{executionId}")\r
45   @Produces({MediaType.APPLICATION_JSON})\r
46   @Operation(\r
47       description = "Respond with a test execution object if it exists",\r
48       summary = "Find test execution log by processInstanceId",\r
49       responses = {\r
50         @ApiResponse(\r
51             responseCode = "200",\r
52             description = "The created Test Instance object is returned when it is created",\r
53             content = {\r
54               @Content(\r
55                   mediaType = "application/json",\r
56                   schema = @Schema(implementation = TestExecution.class))\r
57             })\r
58       })\r
59   Response getExecutionStatus(\r
60       @HeaderParam("Authorization") String authorization,\r
61       @PathParam("executionId") String executionId);\r
62 \r
63   @GET\r
64   @Path("v1/executionId/{executionId}")\r
65   @Produces({MediaType.APPLICATION_JSON})\r
66   @Operation(\r
67       description =\r
68           "Respond with a test execution object, and state of the process instance if it exists.",\r
69       summary = "Find test execution log by executionId",\r
70       responses = {\r
71           @ApiResponse(\r
72               responseCode = "200",\r
73               description = "The created Test Instance object is returned when it is created",\r
74               content = {\r
75                   @Content(\r
76                       mediaType = "application/json",\r
77                       schema = @Schema(implementation = TestExecution.class))\r
78               }),\r
79           @ApiResponse(\r
80               responseCode = "404",\r
81               description =\r
82                   "No process instance was found with the executionId used to query the service",\r
83               content = {\r
84                   @Content(\r
85                       mediaType = "application/json",\r
86                       schema = @Schema(implementation = OTFApiResponse.class))\r
87               })\r
88       })\r
89   Response getExecution(\r
90       @HeaderParam("Authorization") String authorization,\r
91       @PathParam("executionId") String executionId);\r
92 }\r