blob: e23a3eec4e5536f1fc5395d69ac273b6714c3e5b [file] [log] [blame]
sanghoshin94872a12015-10-16 18:04:34 +09001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
sanghoshin94872a12015-10-16 18:04:34 +09003 *
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 */
sangho0c2a3da2016-02-16 13:39:07 +090016package org.onosproject.openstacknetworking.web;
sanghoshin94872a12015-10-16 18:04:34 +090017
sanghoshin94872a12015-10-16 18:04:34 +090018import org.onosproject.rest.AbstractWebResource;
sanghoshin94872a12015-10-16 18:04:34 +090019
20import javax.ws.rs.Consumes;
21import javax.ws.rs.DELETE;
22import javax.ws.rs.POST;
23import javax.ws.rs.PUT;
24import javax.ws.rs.Path;
sanghoshin65723ae2015-11-17 22:07:21 +090025import javax.ws.rs.PathParam;
sanghoshin94872a12015-10-16 18:04:34 +090026import javax.ws.rs.Produces;
27import javax.ws.rs.core.MediaType;
28import javax.ws.rs.core.Response;
29import java.io.InputStream;
30
sanghoshinf25d2e02015-11-11 23:07:17 +090031/**
32 * Handles Rest API call from Neutron ML2 plugin.
33 */
sanghoshin94872a12015-10-16 18:04:34 +090034@Path("ports")
35public class OpenstackPortWebResource extends AbstractWebResource {
36
sanghoshin94872a12015-10-16 18:04:34 +090037 @POST
38 @Consumes(MediaType.APPLICATION_JSON)
39 @Produces(MediaType.APPLICATION_JSON)
40 public Response createPorts(InputStream input) {
Hyunsun Moonb974fca2016-06-30 21:20:39 -070041 return Response.status(Response.Status.OK).build();
sanghoshin94872a12015-10-16 18:04:34 +090042 }
43
sanghoshin65723ae2015-11-17 22:07:21 +090044 @Path("{portUUID}")
sanghoshin94872a12015-10-16 18:04:34 +090045 @DELETE
sanghoshin65723ae2015-11-17 22:07:21 +090046 public Response deletePorts(@PathParam("portUUID") String id) {
Jian Lic2a542b2016-05-10 11:48:19 -070047 return Response.noContent().build();
sanghoshin94872a12015-10-16 18:04:34 +090048 }
49
50 @PUT
51 @Path("{id}")
52 @Consumes(MediaType.APPLICATION_JSON)
53 @Produces(MediaType.APPLICATION_JSON)
54 public Response updatePorts(InputStream input) {
Hyunsun Moonb974fca2016-06-30 21:20:39 -070055 // TODO call security group update here
56 return Response.status(Response.Status.OK).build();
sanghoshin94872a12015-10-16 18:04:34 +090057 }
58}