daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
daniel | bb83ebc | 2015-10-29 15:13:06 +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; |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 17 | |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 18 | /** |
| 19 | * Handles Rest API call from Neutron ML2 plugin. |
| 20 | */ |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 21 | import org.onosproject.rest.AbstractWebResource; |
| 22 | import org.slf4j.Logger; |
| 23 | import org.slf4j.LoggerFactory; |
| 24 | |
| 25 | import javax.ws.rs.Consumes; |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 26 | import javax.ws.rs.DELETE; |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 27 | import javax.ws.rs.POST; |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 28 | import javax.ws.rs.PUT; |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 29 | import javax.ws.rs.Path; |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 30 | import javax.ws.rs.PathParam; |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 31 | import javax.ws.rs.Produces; |
| 32 | import javax.ws.rs.core.MediaType; |
| 33 | import javax.ws.rs.core.Response; |
| 34 | import java.io.InputStream; |
| 35 | |
| 36 | @Path("subnets") |
| 37 | public class OpenstackSubnetWebResource extends AbstractWebResource { |
| 38 | protected static final Logger log = LoggerFactory |
| 39 | .getLogger(OpenstackSubnetWebResource.class); |
| 40 | |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 41 | @POST |
| 42 | @Consumes(MediaType.APPLICATION_JSON) |
| 43 | @Produces(MediaType.APPLICATION_JSON) |
| 44 | public Response createSubnet(InputStream input) { |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 45 | return Response.status(Response.Status.OK).build(); |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 46 | } |
| 47 | |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 48 | |
| 49 | @PUT |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 50 | @Path("{subnetId}") |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 51 | @Produces(MediaType.APPLICATION_JSON) |
| 52 | @Consumes(MediaType.APPLICATION_JSON) |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 53 | public Response updateSubnet(@PathParam("subnetId") String id, |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 54 | final InputStream input) { |
| 55 | return Response.status(Response.Status.OK).build(); |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | @DELETE |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 59 | @Path("{subnetId}") |
jskim | 7d88174 | 2016-09-13 09:39:02 +0900 | [diff] [blame] | 60 | @Produces(MediaType.APPLICATION_JSON) |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 61 | public Response deleteSubnet(@PathParam("subnetId") String id) { |
Jian Li | c2a542b | 2016-05-10 11:48:19 -0700 | [diff] [blame] | 62 | return Response.noContent().build(); |
sanghoshin | f25d2e0 | 2015-11-11 23:07:17 +0900 | [diff] [blame] | 63 | } |
daniel | bb83ebc | 2015-10-29 15:13:06 +0900 | [diff] [blame] | 64 | } |