'Creates a router with a given name and params.'

def _CreateRouter(self, name, params=None):

    try:
        router_cls = api_call_router.ApiCallRouter.classes[name]
    except KeyError:
        raise ApiCallRouterNotFoundError(('%s    not    a    valid    router' % name))
    if ((not router_cls.params_type) and params):
        raise ApiCallRouterDoesNotExpectParameters(('%s    is    not    configurable' % name))
    rdf_params = None
    if router_cls.params_type:
        rdf_params = router_cls.params_type()
        if params:
            rdf_params.FromDict(params)
    return router_cls(params=rdf_params)
