d361d166701158adf6443ede9dc37ba0e36db3be
[policy/distribution.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2022 Nordix Foundation.
4  *  Modifications Copyright (C) 2022 Nordix Foundation.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.distribution.forwarding.testclasses;
23
24 import javax.ws.rs.Consumes;
25 import javax.ws.rs.POST;
26 import javax.ws.rs.Path;
27 import javax.ws.rs.Produces;
28 import javax.ws.rs.core.MediaType;
29 import javax.ws.rs.core.Response;
30 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
31
32 /**
33  * Class to provide rest end points for LifecycleApiControlLoopSimulator.
34  *
35  * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech)
36  */
37 @Path("/onap")
38 @Produces(MediaType.APPLICATION_JSON)
39 public class LifecycleApiControlLoopSimulatorEndpoint {
40
41     /**
42      * ControlLoop commissioning end-point.
43      *
44      * @param body the post body
45      * @return the response object
46      */
47     @POST
48     @Path("/controlloop/v2/commission")
49     @Consumes(MediaType.APPLICATION_JSON)
50     @Produces(MediaType.APPLICATION_JSON)
51     public Response commissionControlLoop(final ToscaServiceTemplate body) {
52         return Response.status(Response.Status.OK).entity(body).build();
53     }
54 }