src/dirbs/api/__init__.py
def _metrics_type_from_req_ctxt(req: callable) -> str:
    """
    Utility method to get a metrics path for the API type.

    Arguments:
        req: intercepted http request object
    Returns:
        str: representing API type & version
    """
    p = req.path.split('/')
    if (p[1] == 'api') and len(p) > 3:
        # Metrics are in format of 'imei.v1' to allow metrics to be aggregated across versions for the same API
        api_type = p[3]
        api_version = p[2]
        return '{0}.{1}'.format(api_type, api_version)
    else:
        return 'unknown'

    Utility method to get a metrics path for the API type.

    Arguments:
        req: intercepted http request object
    Returns:
        str: representing API type & version
    
Utility method to get a metrics path for the API type.
Utility method to get a metrics path for the API type .
def _metrics_type_from_req_ctxt(req: callable) -> str:
    p = req.path.split('/')
    if (p[1] == 'api') and len(p) > 3:
        api_type = p[3]
        api_version = p[2]
        return '{0}.{1}'.format(api_type, api_version)
    else:
        return 'unknown'
def _metrics_type_from_req_ctxt ( req : callable ) -> str : p = req . path . split ( '/' ) if ( p [ 1 ] == 'api' ) and len ( p ) > 3 : api_type = p [ 3 ] api_version = p [ 2 ] return '{0}.{1}' . format ( api_type , api_version ) else : return 'unknown'
Utility method to get a metrics path for the API type.
Utility method to get a metrics path for the API type .
"""
    Utility method to get a metrics path for the API type.

    Arguments:
        req: intercepted http request object
    Returns:
        str: representing API type & version
    """ # Metrics are in format of 'imei.v1' to allow metrics to be aggregated across versions for the same API
representing API type & version
representing API type & version
str
req
callable
intercepted http request object
intercepted http request object