def add_endpoints(self, template, endpoints):
    endpoint_resources = {}
    logger.debug('Injecting %d endpoints.', len(endpoints))
    for (name, params) in endpoints.items():
        factory = self._factory_for_type(params, name)
        if (not factory):
            continue
        actions = factory.add_endpoints(template, name, params)
        if actions:
            endpoint_resources[name] = {'name': factory.resource_name(name), 'actions': actions}
        else:
            logger.debug('Endpoint %s was invalid.', name)
    if endpoint_resources:
        logger.debug('Built endpoints: %s', endpoint_resources)
    return endpoint_resources
def add_endpoints(self, template, endpoints):
    endpoint_resources = {}
    logger.debug('Injecting %d endpoints.', len(endpoints))
    for (name, params) in endpoints.items():
        factory = self._factory_for_type(params, name)
        if (not factory):
            continue
        actions = factory.add_endpoints(template, name, params)
        if actions:
            endpoint_resources[name] = {'name': factory.resource_name(name), 'actions': actions}
        else:
            logger.debug('Endpoint %s was invalid.', name)
    if endpoint_resources:
        logger.debug('Built endpoints: %s', endpoint_resources)
    return endpoint_resources