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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

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
Overrides: object.__init__

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