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.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;
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;
38 @Path("/v1.0/activity-spec/")
39 @Produces(MediaType.APPLICATION_JSON)
40 @Consumes(MediaType.APPLICATION_JSON)
41 @Api(value = "Activity Specs")
43 public interface ActivitySpecs {
47 @ApiOperation(value = "Create Activity Spec")
48 Response createActivitySpec(@Valid ActivitySpecRequestDto request);
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);
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);
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);
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);