net.floodlightcontroller.debugcounter.web
Class DebugCounterResource

java.lang.Object
  extended by org.restlet.resource.Resource
      extended by org.restlet.resource.ServerResource
          extended by net.floodlightcontroller.debugcounter.web.DebugCounterResourceBase
              extended by net.floodlightcontroller.debugcounter.web.DebugCounterResource

public class DebugCounterResource
extends DebugCounterResourceBase

Web interface for Debug Counters

Author:
Saurav

Nested Class Summary
static class DebugCounterResource.CounterPost
           
 class DebugCounterResource.DebugCounterInfoOutput
          The output JSON model that contains the counter information
static class DebugCounterResource.Option
           
static class DebugCounterResource.ResetOutput
           
 
Field Summary
protected static org.slf4j.Logger logger
           
 
Fields inherited from class net.floodlightcontroller.debugcounter.web.DebugCounterResourceBase
debugCounter
 
Constructor Summary
DebugCounterResource()
           
 
Method Summary
 DebugCounterResource.DebugCounterInfoOutput handleCounterInfoQuery()
          Return the debug counter data for the get rest-api call URI must be in one of the following forms: "http://{controller-hostname}:8080/wm/debugcounter/{param1}/{param2}/{param3}/{param4}" where {param1} must be one of (no quotes): null if nothing is given then by default all module names are returned for which counters have been registered "all" returns value/info on all counters.
 DebugCounterResource.ResetOutput postHandler(DebugCounterResource.CounterPost postData)
          Reset or enable/disable counters If using curl: curl -X POST -d DATA -H "Content-Type: application/json" URL where DATA must be one of the following: {\"reset\":true} to reset counters {\"enable\":true} to enable counter {\"enable\":false} to disable counter and URL must be in one of the following forms: "http://{controller-hostname}:8080/wm/debugcounter/{param1}/{param2}/{param3}/{param4} {param1} can be null, 'all' or the name of a module {moduleName}.
 
Methods inherited from class net.floodlightcontroller.debugcounter.web.DebugCounterResourceBase
doInit
 
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getInfo, getInfo, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
 
Methods inherited from class org.restlet.resource.Resource
doError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toObject, toRepresentation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static org.slf4j.Logger logger
Constructor Detail

DebugCounterResource

public DebugCounterResource()
Method Detail

postHandler

@Post
public DebugCounterResource.ResetOutput postHandler(DebugCounterResource.CounterPost postData)
Reset or enable/disable counters If using curl: curl -X POST -d DATA -H "Content-Type: application/json" URL where DATA must be one of the following: {\"reset\":true} to reset counters {\"enable\":true} to enable counter {\"enable\":false} to disable counter and URL must be in one of the following forms: "http://{controller-hostname}:8080/wm/debugcounter/{param1}/{param2}/{param3}/{param4} {param1} can be null, 'all' or the name of a module {moduleName}. {param2}/{param3}/{param4} refer to hierarchical counter names. The Reset command will reset the counter specified as well as all counters in the hierarchical levels below. For example, if a counter hierarchy exists as switch/00:00:00:00:01:02:03:04/pktin/drops, then a reset command with just the moduleName (param1=switch) and counterHierarchy (param2=00:00:00:00:01:02:03:04) will reset all counters for that switch. Continuing the example - for a counterHierarchy (param2=00:00:00:00:01:02:03:04 and param3=pktin), the reset command will remove all pktin counters for that switch. The enable/disable command will ONLY disable a specific counter (and only if that counter is of CounterType.ON_DEMAND) It will not enable/disable counters at any other hierarchical level.


handleCounterInfoQuery

@Get
public DebugCounterResource.DebugCounterInfoOutput handleCounterInfoQuery()
Return the debug counter data for the get rest-api call URI must be in one of the following forms: "http://{controller-hostname}:8080/wm/debugcounter/{param1}/{param2}/{param3}/{param4}" where {param1} must be one of (no quotes): null if nothing is given then by default all module names are returned for which counters have been registered "all" returns value/info on all counters. "{moduleName}" returns value/info on all counters for the specified module 'moduelName'. & {param2}/{param3}/{param4} refer to hierarchical counter names. eg. 00:00:00:00:01:02:03:04/pktin/drops where leaving out any of the params returns all counters in the hierarchical level below. So giving just the switch dpid will fetch all counters for that switch. A special case => if param2 is null, then all hierarchical counterNames are returned for the given moduleName (in param1)