'Retrieve a single endpoint using the provided criteria.
Note: If no or more than one matching endpoint is found, an exception
is thrown.'

def get_endpoint(self, service_type=None, name=None, region=None, endpoint_type=OpenStackIdentityEndpointType.EXTERNAL):

    endpoints = []
    for entry in self._entries:
        if (service_type and (entry.service_type != service_type)):
            continue
        if (name and (entry.service_name != name)):
            continue
        for endpoint in entry.endpoints:
            if (region and (endpoint.region != region)):
                continue
            if (endpoint_type and (endpoint.endpoint_type != endpoint_type)):
                continue
            endpoints.append(endpoint)
    if (len(endpoints) == 1):
        return endpoints[0]
    elif (len(endpoints) > 1):
        raise ValueError('Found    more    than    1    matching    endpoint')
    else:
        raise LibcloudError('Could    not    find    specified    endpoint')
