Committed by
Gerrit Code Review
Remove deprecated ConfigProvider.
Change-Id: Ibf927671b0729212e9d1d2bbfd19d4aaab48b9dd
Showing
3 changed files
with
0 additions
and
70 deletions
This diff is collapsed. Click to expand it.
| 1 | -/* | ||
| 2 | - * Copyright 2015-present Open Networking Laboratory | ||
| 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 | - */ | ||
| 16 | -package org.onosproject.rest.resources; | ||
| 17 | - | ||
| 18 | -import com.fasterxml.jackson.databind.JsonNode; | ||
| 19 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 20 | -import org.onlab.rest.BaseResource; | ||
| 21 | -import org.onosproject.net.device.DeviceProviderRegistry; | ||
| 22 | -import org.onosproject.net.device.DeviceService; | ||
| 23 | -import org.onosproject.net.host.HostProviderRegistry; | ||
| 24 | -import org.onosproject.net.link.LinkProviderRegistry; | ||
| 25 | -import org.slf4j.Logger; | ||
| 26 | -import org.slf4j.LoggerFactory; | ||
| 27 | - | ||
| 28 | -import javax.ws.rs.Consumes; | ||
| 29 | -import javax.ws.rs.POST; | ||
| 30 | -import javax.ws.rs.Path; | ||
| 31 | -import javax.ws.rs.core.MediaType; | ||
| 32 | -import javax.ws.rs.core.Response; | ||
| 33 | -import java.io.InputStream; | ||
| 34 | - | ||
| 35 | -import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; | ||
| 36 | - | ||
| 37 | -/** | ||
| 38 | - * Inject devices, ports, links and end-station hosts. | ||
| 39 | - */ | ||
| 40 | -@Path("config") | ||
| 41 | -public class ConfigWebResource extends BaseResource { | ||
| 42 | - | ||
| 43 | - private static Logger log = LoggerFactory.getLogger(ConfigWebResource.class); | ||
| 44 | - | ||
| 45 | - /** | ||
| 46 | - * Upload device, port, link and host data. | ||
| 47 | - * | ||
| 48 | - * @param input JSON blob | ||
| 49 | - * @return 200 OK | ||
| 50 | - */ | ||
| 51 | - @POST | ||
| 52 | - @Path("topology") | ||
| 53 | - @Consumes(MediaType.APPLICATION_JSON) | ||
| 54 | - public Response topology(InputStream input) { | ||
| 55 | - try { | ||
| 56 | - ObjectMapper mapper = new ObjectMapper(); | ||
| 57 | - JsonNode cfg = mapper.readTree(input); | ||
| 58 | - new ConfigProvider(cfg, get(DeviceService.class), | ||
| 59 | - get(DeviceProviderRegistry.class), | ||
| 60 | - get(LinkProviderRegistry.class), | ||
| 61 | - get(HostProviderRegistry.class)).parse(); | ||
| 62 | - return Response.ok().build(); | ||
| 63 | - } catch (Exception e) { | ||
| 64 | - log.error("Unable to parse topology configuration", e); | ||
| 65 | - return Response.status(INTERNAL_SERVER_ERROR).entity(e.toString()).build(); | ||
| 66 | - } | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | -} |
| ... | @@ -40,7 +40,6 @@ public class CoreWebApplication extends AbstractWebApplication { | ... | @@ -40,7 +40,6 @@ public class CoreWebApplication extends AbstractWebApplication { |
| 40 | GroupsWebResource.class, | 40 | GroupsWebResource.class, |
| 41 | MetersWebResource.class, | 41 | MetersWebResource.class, |
| 42 | TopologyWebResource.class, | 42 | TopologyWebResource.class, |
| 43 | - ConfigWebResource.class, | ||
| 44 | PathsWebResource.class, | 43 | PathsWebResource.class, |
| 45 | StatisticsWebResource.class, | 44 | StatisticsWebResource.class, |
| 46 | MetricsWebResource.class, | 45 | MetricsWebResource.class, | ... | ... |
-
Please register or login to post a comment