Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/origin.py
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | |||||
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. | ||||
The search is performed in a case insensitive way. | The search is performed in a case insensitive way. | ||||
.. warning:: | |||||
This endpoint used to provide an `offset` query parameter, | |||||
and guarantee an order on results. This is no longer true, | |||||
and only the Link header should be used for paginating through | |||||
results. | |||||
:param string url_pattern: a string pattern or a regular expression | :param string url_pattern: a string pattern or a regular expression | ||||
:query int offset: the number of found origins to skip before returning | |||||
results | |||||
:query int limit: the maximum number of found origins to return | :query int limit: the maximum number of found origins to return | ||||
:query boolean regexp: if true, consider provided pattern as a regular | :query boolean regexp: if true, consider provided pattern as a regular | ||||
expression and search origins whose urls match it | expression and search origins whose urls match it | ||||
:query boolean with_visit: if true, only return origins with at least | :query boolean with_visit: if true, only return origins with at least | ||||
one visit by Software heritage | one visit by Software heritage | ||||
{return_origin_array} | {return_origin_array} | ||||
{common_headers} | {common_headers} | ||||
{resheader_link} | |||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | **Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | ||||
:http:method:`options` | :http:method:`options` | ||||
:statuscode 200: no error | :statuscode 200: no error | ||||
**Example:** | **Example:** | ||||
▲ Show 20 Lines • Show All 293 Lines • Show Last 20 Lines |