Package ganeti :: Package rapi :: Module connector :: Class Mapper
[hide private]
[frames] | no frames]

Class Mapper

source code

Map resource to method.

Instance Methods [hide private]
 
__init__(self, connector=None)
Resource mapper constructor.
source code
 
getController(self, uri)
Find method for a given URI.
source code
Method Details [hide private]

__init__(self, connector=None)
(Constructor)

source code 

Resource mapper constructor.

Parameters:
  • connector - a dictionary, mapping method name with URL path regexp

getController(self, uri)

source code 

Find method for a given URI.

Parameters:
  • uri - string with URI
Returns:
None if no method is found or a tuple containing the following fields:
  • method: name of method mapped to URI
  • items: a list of variable intems in the path
  • args: a dictionary with additional parameters from URL