Naoki Shiota | 862cc3b | 2013-12-13 15:42:50 -0800 | [diff] [blame] | 1 | package net.onrc.onos.graph.web; |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 2 | |
| 3 | import java.util.Iterator; |
| 4 | |
yoshi | ed0a6eb | 2013-12-05 16:54:27 -0800 | [diff] [blame] | 5 | import net.onrc.onos.graph.DBOperation; |
| 6 | import net.onrc.onos.graph.GraphDBManager; |
HIGUCHI Yuta | 2051490 | 2013-06-12 11:24:16 -0700 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject; |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 8 | |
| 9 | import org.restlet.resource.Get; |
| 10 | import org.restlet.resource.ServerResource; |
| 11 | |
| 12 | public class TopoDevicesResource extends ServerResource { |
| 13 | |
| 14 | @Get("json") |
| 15 | public Iterator<IDeviceObject> retrieve() { |
yoshi | ed0a6eb | 2013-12-05 16:54:27 -0800 | [diff] [blame] | 16 | DBOperation op = GraphDBManager.getDBOperation("ramcloud", "/tmp/ramcloudconf"); |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 17 | |
Toshio Koide | a778d8d | 2013-06-13 13:41:16 -0700 | [diff] [blame] | 18 | return op.getDevices().iterator(); |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 19 | } |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 20 | } |