blob: 70818c9cdc624fca754b6734d615c2f830d31748 [file] [log] [blame]
package net.onrc.onos.apps.proxyarp;
import java.util.List;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
/**
* REST resource to view the IP to MAC mappings in the ARP cache.
*/
public class ArpCacheResource extends ServerResource {
/**
* Handler for a REST call to retrieve the ARP cache.
*
* @return list of mappings formatted as a human-readable string.
*/
@Get("json")
public List<String> getArpCache() {
IProxyArpService arp = (IProxyArpService) getContext().getAttributes()
.get(IProxyArpService.class.getCanonicalName());
return arp.getMappings();
}
}