'List all endpoints associated with a project.
:param project_id: project identifier to check
:type project_id: string
:returns: a list of endpoint ids or an empty list.'

def list_endpoints_for_project(self, project_id):

    refs = self.driver.list_endpoints_for_project(project_id)
    filtered_endpoints = {}
    for ref in refs:
        try:
            endpoint = self.get_endpoint(ref['endpoint_id'])
            filtered_endpoints.update({ref['endpoint_id']: endpoint})
        except exception.EndpointNotFound:
            self.remove_endpoint_from_project(ref['endpoint_id'], project_id)
    endpoint_groups = self.get_endpoint_groups_for_project(project_id)
    for endpoint_group in endpoint_groups:
        endpoint_refs = self.get_endpoints_filtered_by_endpoint_group(endpoint_group['id'])
        for endpoint_ref in endpoint_refs:
            if (endpoint_ref['id'] not in filtered_endpoints):
                filtered_endpoints[endpoint_ref['id']] = endpoint_ref
    return filtered_endpoints
