blob: ca9f3ab7ae2cf04fa19e86e9bb990ca3feb4ba2f [file] [log] [blame]
danielbb83ebc2015-10-29 15:13:06 +09001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
danielbb83ebc2015-10-29 15:13:06 +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;
danielbb83ebc2015-10-29 15:13:06 +090017
sanghoshinf25d2e02015-11-11 23:07:17 +090018/**
19 * Handles Rest API call from Neutron ML2 plugin.
20 */
danielbb83ebc2015-10-29 15:13:06 +090021import org.onosproject.rest.AbstractWebResource;
22import org.slf4j.Logger;
23import org.slf4j.LoggerFactory;
24
25import javax.ws.rs.Consumes;
sanghoshinf25d2e02015-11-11 23:07:17 +090026import javax.ws.rs.DELETE;
danielbb83ebc2015-10-29 15:13:06 +090027import javax.ws.rs.POST;
sanghoshinf25d2e02015-11-11 23:07:17 +090028import javax.ws.rs.PUT;
danielbb83ebc2015-10-29 15:13:06 +090029import javax.ws.rs.Path;
sanghoshinf25d2e02015-11-11 23:07:17 +090030import javax.ws.rs.PathParam;
danielbb83ebc2015-10-29 15:13:06 +090031import javax.ws.rs.Produces;
32import javax.ws.rs.core.MediaType;
33import javax.ws.rs.core.Response;
34import java.io.InputStream;
35
36@Path("subnets")
37public class OpenstackSubnetWebResource extends AbstractWebResource {
38 protected static final Logger log = LoggerFactory
39 .getLogger(OpenstackSubnetWebResource.class);
40
danielbb83ebc2015-10-29 15:13:06 +090041 @POST
42 @Consumes(MediaType.APPLICATION_JSON)
43 @Produces(MediaType.APPLICATION_JSON)
44 public Response createSubnet(InputStream input) {
sanghoshinf25d2e02015-11-11 23:07:17 +090045 return Response.status(Response.Status.OK).build();
danielbb83ebc2015-10-29 15:13:06 +090046 }
47
sanghoshinf25d2e02015-11-11 23:07:17 +090048
49 @PUT
sangho0c2a3da2016-02-16 13:39:07 +090050 @Path("{subnetId}")
sanghoshinf25d2e02015-11-11 23:07:17 +090051 @Produces(MediaType.APPLICATION_JSON)
52 @Consumes(MediaType.APPLICATION_JSON)
sangho0c2a3da2016-02-16 13:39:07 +090053 public Response updateSubnet(@PathParam("subnetId") String id,
sanghoshinf25d2e02015-11-11 23:07:17 +090054 final InputStream input) {
55 return Response.status(Response.Status.OK).build();
sanghoshinf25d2e02015-11-11 23:07:17 +090056 }
57
58 @DELETE
sangho0c2a3da2016-02-16 13:39:07 +090059 @Path("{subnetId}")
jskim7d881742016-09-13 09:39:02 +090060 @Produces(MediaType.APPLICATION_JSON)
sangho0c2a3da2016-02-16 13:39:07 +090061 public Response deleteSubnet(@PathParam("subnetId") String id) {
Jian Lic2a542b2016-05-10 11:48:19 -070062 return Response.noContent().build();
sanghoshinf25d2e02015-11-11 23:07:17 +090063 }
danielbb83ebc2015-10-29 15:13:06 +090064}