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.openecomp.activityspec.api.rest;
19 import io.swagger.annotations.Api;
20 import io.swagger.annotations.ApiOperation;
21 import io.swagger.annotations.ApiParam;
22 import org.openecomp.activityspec.api.rest.types.ActivitySpecActionRequestDto;
23 import org.openecomp.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 {
46 @ApiOperation(value = "Create Activity Spec")
47 Response createActivitySpec(@Valid ActivitySpecRequestDto request);
50 @Path("/{id}/versions/{versionId}")
51 @ApiOperation(value = "Get Activity Spec")
52 Response getActivitySpec(@ApiParam(value = "Activity Spec Id") @PathParam("id")
54 @ApiParam(value = "Version Id") @PathParam("versionId")
58 @Path("/{id}/versions/{versionId}")
59 @ApiOperation(value = "Update Activity Spec")
60 Response updateActivitySpec(@Valid ActivitySpecRequestDto request,
61 @ApiParam(value = "Activity Spec Id") @PathParam("id")
63 @ApiParam(value = "Version Id") @PathParam("versionId")
67 @Path("/{id}/versions/{versionId}/actions")
68 @ApiOperation(value = "Actions on a activity spec",
69 notes = "Performs one of the following actions on a activity spec: |"
70 + "Submit: Finalize its active version.|"
71 + "Deprecate: Deprecate activity spec.|")
72 Response actOnActivitySpec(ActivitySpecActionRequestDto request,
73 @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
74 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
78 @ApiOperation(value = "Get list of activity specs ",
79 responseContainer = "List")
80 Response list(@ApiParam(
81 value = "Currently supported values: 'Certified' - only activity specs with Certified status")
82 @QueryParam("status") String versionStatus);