Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/origin.py
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | def api_origin(request, origin_url): | ||||
return api_lookup( | return api_lookup( | ||||
service.lookup_origin, ori_dict, | service.lookup_origin, ori_dict, | ||||
notfound_msg=error_msg, | notfound_msg=error_msg, | ||||
enrich_fn=_enrich_origin) | enrich_fn=_enrich_origin) | ||||
@api_route(r'/origin/search/(?P<url_pattern>.+)/', | @api_route(r'/origin/search/(?P<url_pattern>.+)/', | ||||
'api-1-origin-search') | 'api-1-origin-search', | ||||
throttle_scope='swh_api_origin_search') | |||||
@api_doc('/origin/search/') | @api_doc('/origin/search/') | ||||
@format_docstring(return_origin_array=DOC_RETURN_ORIGIN_ARRAY) | @format_docstring(return_origin_array=DOC_RETURN_ORIGIN_ARRAY) | ||||
def api_origin_search(request, url_pattern): | def api_origin_search(request, url_pattern): | ||||
""" | """ | ||||
.. http:get:: /api/1/origin/search/(url_pattern)/ | .. http:get:: /api/1/origin/search/(url_pattern)/ | ||||
Search for software origins whose urls contain a provided string | Search for software origins whose urls contain a provided string | ||||
pattern or match a provided regular expression. | pattern or match a provided regular expression. | ||||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |