2  * Copyright © 2017-2018 AT&T Intellectual Property.
\r 
   4  * Licensed under the Apache License, Version 2.0 (the "License");
\r 
   5  * you may not use this file except in compliance with the License.
\r 
   6  * You may obtain a copy of the License at
\r 
   8  *     http://www.apache.org/licenses/LICENSE-2.0
\r 
  10  * Unless required by applicable law or agreed to in writing, software
\r 
  11  * distributed under the License is distributed on an "AS IS" BASIS,
\r 
  12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r 
  13  * See the License for the specific language governing permissions and
\r 
  14  * limitations under the License.
\r 
  17 package org.onap.ccsdk.apps.controllerblueprints.service.rs;
\r 
  19 import io.swagger.annotations.*;
\r 
  20 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
\r 
  21 import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
\r 
  22 import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModel;
\r 
  23 import org.springframework.web.bind.annotation.RequestMapping;
\r 
  24 import org.springframework.web.bind.annotation.RequestMethod;
\r 
  25 import org.springframework.web.bind.annotation.ResponseBody;
\r 
  27 import javax.ws.rs.*;
\r 
  28 import javax.ws.rs.core.MediaType;
\r 
  29 import java.util.List;
\r 
  32  * ConfigModelRest.java Purpose: Rest service controller for ConfigModelRest Management
\r 
  34  * @author Brinda Santh
\r 
  39 @Produces({MediaType.APPLICATION_JSON})
\r 
  40 public interface ConfigModelRest {
\r 
  43      * This is a getConfigModel rest service
\r 
  46      * @return ConfigModel
\r 
  47      * @throws BluePrintException
\r 
  50     @Path("/configmodel/{id}")
\r 
  51     @Consumes({MediaType.APPLICATION_JSON})
\r 
  52     @Produces({MediaType.APPLICATION_JSON})
\r 
  53     @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)
\r 
  54     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
  55             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
  56     @RequestMapping(value = "/configmodel/{id}", method = RequestMethod.GET)
\r 
  57     @ResponseBody ConfigModel getConfigModel(@ApiParam(required = true) @PathParam("id") Long id)
\r 
  58             throws BluePrintException;
\r 
  62      * This is a saveConfigModel rest service
\r 
  64      * @param configModel
\r 
  65      * @return ConfigModel
\r 
  66      * @throws BluePrintException
\r 
  69     @Path("/configmodel")
\r 
  70     @Consumes({MediaType.APPLICATION_JSON})
\r 
  71     @Produces({MediaType.APPLICATION_JSON})
\r 
  72     @ApiOperation(value = "Provides Rest service to get Model Type by Tags", response = ServiceTemplate.class)
\r 
  73     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
  74             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
  75     ConfigModel saveConfigModel(@ApiParam(required = true) ConfigModel configModel)
\r 
  76             throws BluePrintException;
\r 
  79      * This is a deleteConfigModel rest service
\r 
  82      * @throws BluePrintException
\r 
  85     @Path("/configmodel/{id}")
\r 
  86     @Consumes({MediaType.APPLICATION_JSON})
\r 
  87     @Produces({MediaType.APPLICATION_JSON})
\r 
  88     @ApiOperation(value = "Provides Rest service to delete ConfigModel.")
\r 
  89     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
  90             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
  91     void deleteConfigModel(@ApiParam(required = true) @PathParam("id") Long id) throws BluePrintException;
\r 
  94      * This is a getInitialConfigModel rest service
\r 
  97      * @return ConfigModel
\r 
  98      * @throws BluePrintException
\r 
 101     @Path("/configmodelinitial/{name}")
\r 
 102     @Consumes({MediaType.APPLICATION_JSON})
\r 
 103     @Produces({MediaType.APPLICATION_JSON})
\r 
 104     @ApiOperation(value = "Provides Rest service to create default Service Template", response = ConfigModel.class)
\r 
 105     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
 106             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
 107     ConfigModel getInitialConfigModel(@ApiParam(required = true) @PathParam("name") String name)
\r 
 108             throws BluePrintException;
\r 
 111      * This is a getCloneConfigModel rest service
\r 
 114      * @return ConfigModel
\r 
 115      * @throws BluePrintException
\r 
 118     @Path("/configmodelclone/{id}")
\r 
 119     @Consumes({MediaType.APPLICATION_JSON})
\r 
 120     @Produces({MediaType.APPLICATION_JSON})
\r 
 121     @ApiOperation(value = "Provides Rest service to create default Service Template", response = ConfigModel.class)
\r 
 122     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
 123             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
 124     ConfigModel getCloneConfigModel(@ApiParam(required = true) @PathParam("id") Long id)
\r 
 125             throws BluePrintException;
\r 
 128      * This is a publishConfigModel rest service
\r 
 131      * @return ServiceTemplate
\r 
 132      * @throws BluePrintException
\r 
 135     @Path("/configmodelpublish/{id}")
\r 
 136     @Consumes({MediaType.APPLICATION_JSON})
\r 
 137     @Produces({MediaType.APPLICATION_JSON})
\r 
 138     @ApiOperation(value = "Provides Rest service to get Model Type by Tags", response = ConfigModel.class)
\r 
 139     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
 140             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
 141     ConfigModel publishConfigModel(@ApiParam(required = true) @PathParam("id") Long id)
\r 
 142             throws BluePrintException;
\r 
 145      * This is a getConfigModelByNameAndVersion rest service
\r 
 149      * @return ConfigModel
\r 
 150      * @throws BluePrintException
\r 
 153     @Path("/configmodelbyname/{name}/version/{version}")
\r 
 154     @Consumes({MediaType.APPLICATION_JSON})
\r 
 155     @Produces({MediaType.APPLICATION_JSON})
\r 
 156     @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)
\r 
 157     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
 158             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
 159     ConfigModel getConfigModelByNameAndVersion(@ApiParam(required = true) @PathParam("name") String name,
\r 
 160                                                @ApiParam(required = true) @PathParam("version") String version) throws BluePrintException;
\r 
 163      * This is a searchServiceModels rest service
\r 
 166      * @return List<ConfigModel>
\r 
 167      * @throws BluePrintException
\r 
 170     @Path("/configmodelsearch/{tags}")
\r 
 171     @Consumes({MediaType.APPLICATION_JSON})
\r 
 172     @Produces({MediaType.APPLICATION_JSON})
\r 
 173     @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)
\r 
 174     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
\r 
 175             @ApiResponse(code = 500, message = "Unexpected Runtime error")})
\r 
 176     List<ConfigModel> searchConfigModels(@ApiParam(required = true) @PathParam("tags") String tags)
\r 
 177             throws BluePrintException;
\r