'Retrieve and format the current V3 service catalog.
The default implementation builds the V3 catalog from the V2 catalog.
Example::
"endpoints": [
"interface": "public",
"id": "--endpoint-id--",
"region": "RegionOne",
"url": "http://external:8776/v1/--project-id--"
"interface": "internal",
"id": "--endpoint-id--",
"region": "RegionOne",
"url": "http://internal:8776/v1/--project-id--"
"id": "--service-id--",
"type": "volume"
:returns: A list representing the service catalog or an empty list
:raises keystone.exception.NotFound: If the endpoint doesn\'t exist.'

def get_v3_catalog(self, user_id, project_id):

    v2_catalog = self.get_catalog(user_id, project_id)
    v3_catalog = []
    for (region_name, region) in v2_catalog.items():
        for (service_type, service) in region.items():
            service_v3 = {'type': service_type, 'endpoints': []}
            for (attr, value) in service.items():
                if attr.endswith('URL'):
                    v3_interface = attr[:(- len('URL'))]
                    service_v3['endpoints'].append({'interface': v3_interface, 'region': region_name, 'url': value})
                    continue
                service_v3[attr] = value
            v3_catalog.append(service_v3)
    return v3_catalog
