06b85246af6d8653a98b02ac84eb37c1613bb2a4
[sdc.git] /
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
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
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.onap.sdc.activityspec.api.rest;
18
19 import io.swagger.annotations.Api;
20 import io.swagger.annotations.ApiOperation;
21 import io.swagger.annotations.ApiParam;
22 import org.onap.sdc.activityspec.api.rest.types.ActivitySpecActionRequestDto;
23 import org.onap.sdc.activityspec.api.rest.types.ActivitySpecRequestDto;
24 import org.springframework.validation.annotation.Validated;
25
26 import javax.validation.Valid;
27 import javax.ws.rs.Consumes;
28 import javax.ws.rs.GET;
29 import javax.ws.rs.POST;
30 import javax.ws.rs.PUT;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.PathParam;
33 import javax.ws.rs.Produces;
34 import javax.ws.rs.QueryParam;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
37
38 @Path("/v1.0/activity-spec/")
39 @Produces(MediaType.APPLICATION_JSON)
40 @Consumes(MediaType.APPLICATION_JSON)
41 @Api(value = "Activity Specs")
42 @Validated
43 public interface ActivitySpecs {
44
45     @POST
46     @Path("/")
47     @ApiOperation(value = "Create Activity Spec")
48     Response createActivitySpec(@Valid ActivitySpecRequestDto request);
49
50     @GET
51     @Path("/{id}/versions/{versionId}")
52     @ApiOperation(value = "Get Activity Spec")
53     Response getActivitySpec(@ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
54                                     @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
55
56     @PUT
57     @Path("/{id}/versions/{versionId}")
58     @ApiOperation(value = "Update Activity Spec")
59     Response updateActivitySpec(@Valid ActivitySpecRequestDto request,
60                                        @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
61                                        @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
62
63     @PUT
64     @Path("/{id}/versions/{versionId}/actions")
65     @ApiOperation(value = "Actions on a activity spec",
66             notes = "Performs one of the following actions on a activity spec: |" + "CERTIFY: Certifies activity spec.|"
67                             + "DEPRECATE: Deprecates activity spec.|" + "DELETE: Deletes activity spec.")
68     Response actOnActivitySpec(ActivitySpecActionRequestDto request,
69                                       @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
70                                       @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
71
72     @GET
73     @Path("/")
74     @ApiOperation(value = "Get list of activity specs ", responseContainer = "List")
75     Response list(@ApiParam(value = "List activity specs based on status filter") @QueryParam("status")
76                           String versionStatus);
77 }