sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 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 | */ |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 16 | package org.onosproject.openstacknetworking.web; |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 17 | |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 18 | import org.onosproject.rest.AbstractWebResource; |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 19 | |
| 20 | import javax.ws.rs.Consumes; |
| 21 | import javax.ws.rs.DELETE; |
| 22 | import javax.ws.rs.POST; |
| 23 | import javax.ws.rs.PUT; |
| 24 | import javax.ws.rs.Path; |
sanghoshin | 65723ae | 2015-11-17 22:07:21 +0900 | [diff] [blame] | 25 | import javax.ws.rs.PathParam; |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 26 | import javax.ws.rs.Produces; |
| 27 | import javax.ws.rs.core.MediaType; |
| 28 | import javax.ws.rs.core.Response; |
| 29 | import java.io.InputStream; |
| 30 | |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 31 | /** |
| 32 | * Handles Rest API call from Neutron ML2 plugin. |
| 33 | */ |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 34 | @Path("ports") |
| 35 | public class OpenstackPortWebResource extends AbstractWebResource { |
| 36 | |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 37 | @POST |
| 38 | @Consumes(MediaType.APPLICATION_JSON) |
| 39 | @Produces(MediaType.APPLICATION_JSON) |
| 40 | public Response createPorts(InputStream input) { |
Hyunsun Moon | b974fca | 2016-06-30 21:20:39 -0700 | [diff] [blame^] | 41 | return Response.status(Response.Status.OK).build(); |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 42 | } |
| 43 | |
sanghoshin | 65723ae | 2015-11-17 22:07:21 +0900 | [diff] [blame] | 44 | @Path("{portUUID}") |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 45 | @DELETE |
sanghoshin | 65723ae | 2015-11-17 22:07:21 +0900 | [diff] [blame] | 46 | public Response deletePorts(@PathParam("portUUID") String id) { |
Jian Li | c2a542b | 2016-05-10 11:48:19 -0700 | [diff] [blame] | 47 | return Response.noContent().build(); |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | @PUT |
| 51 | @Path("{id}") |
| 52 | @Consumes(MediaType.APPLICATION_JSON) |
| 53 | @Produces(MediaType.APPLICATION_JSON) |
| 54 | public Response updatePorts(InputStream input) { |
Hyunsun Moon | b974fca | 2016-06-30 21:20:39 -0700 | [diff] [blame^] | 55 | // TODO call security group update here |
| 56 | return Response.status(Response.Status.OK).build(); |
sanghoshin | 94872a1 | 2015-10-16 18:04:34 +0900 | [diff] [blame] | 57 | } |
| 58 | } |