c0806d75fc95cca72cd864c9f027e4f75c8c112d
[optf/cmso.git] /
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  * Modifications Copyright © 2018 IBM.
4  * 
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * 
9  *         http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * 
17  * 
18  * Unless otherwise specified, all documentation contained herein is licensed
19  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
20  * you may not use this documentation except in compliance with the License.
21  * You may obtain a copy of the License at
22  * 
23  *         https://creativecommons.org/licenses/by/4.0/
24  * 
25  * Unless required by applicable law or agreed to in writing, documentation
26  * distributed under the License is distributed on an "AS IS" BASIS,
27  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28  * See the License for the specific language governing permissions and
29  * limitations under the License.
30 */
31
32 package org.onap.optf.cmso.service.rs;
33
34 import javax.ws.rs.DefaultValue;
35 import javax.ws.rs.POST;
36 import javax.ws.rs.Path;
37 import javax.ws.rs.PathParam;
38 import javax.ws.rs.Produces;
39 import javax.ws.rs.core.MediaType;
40 import javax.ws.rs.core.Response;
41
42 import org.onap.optf.cmso.common.CMSRequestError;
43 import org.onap.optf.cmso.service.rs.models.v2.OptimizedScheduleMessage;
44
45 import io.swagger.annotations.Api;
46 import io.swagger.annotations.ApiOperation;
47 import io.swagger.annotations.ApiParam;
48 import io.swagger.annotations.ApiResponse;
49 import io.swagger.annotations.ApiResponses;
50
51 @Api("CMSO Optimized Schedule API")
52 @Path("/{apiVersion}")
53 @Produces({MediaType.APPLICATION_JSON})
54 public interface CMSOOptimizedScheduleService {
55
56     // ******************************************************************
57     @POST
58     @Path("/schedules/optimized/{scheduleId}")
59     @Produces({MediaType.APPLICATION_JSON})
60     @ApiOperation(value = "", notes = "Creates a request for an optimized schedule")
61     @ApiResponses(
62             value = {@ApiResponse(code = 202, message = "Schedule request accepted for optimization."),
63                     @ApiResponse(code = 409, message = "Schedule request already exists for this schedule id.",
64                             response = CMSRequestError.class),
65                     @ApiResponse(code = 500, message = "Unexpected Runtime error")})
66     public Response createScheduleRequest(
67             @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
68             @ApiParam(
69                     value = "Schedule id to uniquely identify the schedule request being created.") @PathParam("scheduleId") String scheduleId,
70             @ApiParam(
71                     value = "Data for creating a schedule request for the given schedule id") OptimizedScheduleMessage scheduleMessage);
72
73
74 }