Allow generating different RAPI resource lookup tables
Until now the RAPI resource table returned by “rapi.connector.GetHandlers” always uses fixed strings or compiled regular expressions as dictionary keys. Now that a table of all RAPI resources (and their access rights) should be written for the documentation, a plain string version of the URIs must be available. The compiled pattern might contain escape sequences and is not suitable. This patch changes “GetHandlers” to accept a hook function which is used to translate non-static resource URIs such as “/2/jobs/[job_id]/wait”. The default implemention retains the original behaviour by translating to compiled regular expressions. Signed-off-by:Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
Loading
Please register or sign in to comment