2 * Copyright © 2017-2018 AT&T Intellectual Property.
3 * Modifications Copyright © 2018 IBM.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
23 * https://creativecommons.org/licenses/by/4.0/
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.
32 package org.onap.optf.cmso.service.rs;
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;
42 import org.onap.optf.cmso.common.CMSRequestError;
43 import org.onap.optf.cmso.service.rs.models.v2.OptimizedScheduleMessage;
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;
51 @Api("CMSO Optimized Schedule API")
52 @Path("/{apiVersion}")
53 @Produces({MediaType.APPLICATION_JSON})
54 public interface CMSOOptimizedScheduleService {
56 // ******************************************************************
58 @Path("/schedules/optimized/{scheduleId}")
59 @Produces({MediaType.APPLICATION_JSON})
60 @ApiOperation(value = "", notes = "Creates a request for an optimized schedule")
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,
69 value = "Schedule id to uniquely identify the schedule request being created.") @PathParam("scheduleId") String scheduleId,
71 value = "Data for creating a schedule request for the given schedule id") OptimizedScheduleMessage scheduleMessage);