def _get_providers_by_type_and_id(source_id_type, source_id):
""" get the matching providers for a given source_id_type and source_id
:param source_id_type: str
:param source_id: str
:returns: list of organisations
:raises: koi.exceptsion.HTTPError
"""
client = API(options.url_query, ssl_options=ssl_server_options())
try:
res = yield client.query.licensors.get(source_id_type=source_id_type, source_id=source_id)
raise Return(res['data'])
except httpclient.HTTPError as exc:
if exc.code == 404:
msg = 'No matching providers found'
else:
msg = 'Unexpected error ' + exc.message
raise exceptions.HTTPError(exc.code, msg, source='query')
redirect_handler.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录