2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdcrests.vsp.rest;
23 import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
24 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
26 import io.swagger.annotations.Api;
27 import io.swagger.annotations.ApiOperation;
28 import io.swagger.annotations.ApiParam;
29 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
30 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
31 import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto;
32 import org.springframework.validation.annotation.Validated;
34 import javax.validation.constraints.NotNull;
35 import javax.ws.rs.Consumes;
36 import javax.ws.rs.DELETE;
37 import javax.ws.rs.GET;
38 import javax.ws.rs.HeaderParam;
39 import javax.ws.rs.POST;
40 import javax.ws.rs.Path;
41 import javax.ws.rs.PathParam;
42 import javax.ws.rs.Produces;
43 import javax.ws.rs.core.MediaType;
44 import javax.ws.rs.core.Response;
47 @Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors")
48 @Produces(MediaType.APPLICATION_JSON)
49 @Consumes(MediaType.APPLICATION_JSON)
50 @Api(value = "Vendor Software Product Component MIB Uploads")
52 public interface ComponentUploads {
54 @Path("/snmp-trap/upload")
55 @Consumes(MediaType.MULTIPART_FORM_DATA)
56 @ApiOperation(value = "Upload vendor software product MIB Trap Definitions file")
57 Response uploadTrapMibFile(@Multipart("upload") Attachment attachment,
58 @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
60 @ApiParam(value = "Vendor software product component Id")
61 @PathParam("componentId") String componentId,
62 @NotNull(message = USER_MISSING_ERROR_MSG)
63 @HeaderParam(USER_HEADER_PARAM) String user);
67 @ApiOperation(value = "Delete vendor software product MIB Trap Definitions file")
68 Response deleteTrapMibFile(
69 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
70 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
72 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
76 @Consumes(MediaType.MULTIPART_FORM_DATA)
77 @ApiOperation(value = "Upload vendor software product MIB Poll Definitions file")
78 Response uploadPollMibFile(@Multipart("upload") Attachment attachment,
79 @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
81 @ApiParam(value = "Vendor software product component Id")
82 @PathParam("componentId") String componentId,
83 @NotNull(message = USER_MISSING_ERROR_MSG)
84 @HeaderParam(USER_HEADER_PARAM) String user);
88 @ApiOperation(value = "Delete vendor software product MIB Poll Definitions file")
89 Response deletePollMibFile(
90 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
91 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
93 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
97 @ApiOperation(value = "Get the filenames of uploaded MIB definitions",
98 response = MibUploadStatusDto.class)
99 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
100 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
102 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)