2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.sdc.activityspec.api.rest;
19 import io.swagger.annotations.*;
20 import org.onap.sdc.activityspec.api.rest.types.ActivitySpecActionRequestDto;
21 import org.onap.sdc.activityspec.api.rest.types.ActivitySpecRequestDto;
22 import org.springframework.validation.annotation.Validated;
24 import javax.validation.Valid;
26 import javax.ws.rs.core.MediaType;
27 import javax.ws.rs.core.Response;
29 import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.USER_ID_HEADER_PARAM;
31 @Path("/v1.0/activity-spec/")
32 @Produces(MediaType.APPLICATION_JSON)
33 @Consumes(MediaType.APPLICATION_JSON)
34 @Api(value = "Activity Specs")
36 public interface ActivitySpecs {
40 @ApiOperation(value = "Create Activity Spec")
41 @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string",
42 paramType = "header")})
43 Response createActivitySpec(@Valid ActivitySpecRequestDto request);
46 @Path("/{id}/versions/{versionId}")
47 @ApiOperation(value = "Get Activity Spec")
48 @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string",
49 paramType = "header")})
50 Response getActivitySpec(@ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
51 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
54 @Path("/{id}/versions/{versionId}")
55 @ApiOperation(value = "Update Activity Spec")
56 @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string",
57 paramType = "header")})
58 Response updateActivitySpec(@Valid ActivitySpecRequestDto request,
59 @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
60 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
63 @Path("/{id}/versions/{versionId}/actions")
64 @ApiOperation(value = "Actions on a activity spec",
65 notes = "Performs one of the following actions on a activity spec: |" + "CERTIFY: Certifies activity spec.|"
66 + "DEPRECATE: Deprecates activity spec.|" + "DELETE: Deletes activity spec.")
67 @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string",
68 paramType = "header")})
69 Response actOnActivitySpec(ActivitySpecActionRequestDto request,
70 @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
71 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
75 @ApiOperation(value = "Get list of activity specs ", responseContainer = "List")
76 @ApiImplicitParams({@ApiImplicitParam(name = USER_ID_HEADER_PARAM, required = true, dataType = "string",
77 paramType = "header")})
78 Response list(@ApiParam(value = "List activity specs based on status filter") @QueryParam("status")
79 String versionStatus);