1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\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
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\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
17 package org.oran.otf.api.service;
\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
35 import org.springframework.stereotype.Component;
\r
39 @Path("/testExecution")
\r
40 @Tag(name = "Test Services", description = "")
\r
41 @Produces(MediaType.APPLICATION_JSON)
\r
42 public interface TestExecutionService {
\r
44 @Path("v1/status/executionId/{executionId}")
\r
45 @Produces({MediaType.APPLICATION_JSON})
\r
47 description = "Respond with a test execution object if it exists",
\r
48 summary = "Find test execution log by processInstanceId",
\r
51 responseCode = "200",
\r
52 description = "The created Test Instance object is returned when it is created",
\r
55 mediaType = "application/json",
\r
56 schema = @Schema(implementation = TestExecution.class))
\r
59 Response getExecutionStatus(
\r
60 @HeaderParam("Authorization") String authorization,
\r
61 @PathParam("executionId") String executionId);
\r
64 @Path("v1/executionId/{executionId}")
\r
65 @Produces({MediaType.APPLICATION_JSON})
\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
72 responseCode = "200",
\r
73 description = "The created Test Instance object is returned when it is created",
\r
76 mediaType = "application/json",
\r
77 schema = @Schema(implementation = TestExecution.class))
\r
80 responseCode = "404",
\r
82 "No process instance was found with the executionId used to query the service",
\r
85 mediaType = "application/json",
\r
86 schema = @Schema(implementation = OTFApiResponse.class))
\r
89 Response getExecution(
\r
90 @HeaderParam("Authorization") String authorization,
\r
91 @PathParam("executionId") String executionId);
\r