Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/origin.py
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | .. http:get:: /api/1/origins/ | ||||
:query int origin_count: The maximum number of origins to return | :query int origin_count: The maximum number of origins to return | ||||
(default to 100, can not exceed 10000) | (default to 100, can not exceed 10000) | ||||
{return_origin_array} | {return_origin_array} | ||||
{common_headers} | {common_headers} | ||||
{resheader_link} | {resheader_link} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`origins?origin_count=500` | :swh_web_api:`origins?origin_count=500` | ||||
""" | """ | ||||
Show All 28 Lines | .. http:get:: /api/1/origin/(origin_url)/get/ | ||||
Get information about a software origin. | Get information about a software origin. | ||||
:param string origin_url: the origin url | :param string origin_url: the origin url | ||||
{return_origin} | {return_origin} | ||||
{common_headers} | {common_headers} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
:statuscode 404: requested origin can not be found in the archive | :statuscode 404: requested origin can not be found in the archive | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`origin/https://github.com/python/cpython/get/` | :swh_web_api:`origin/https://github.com/python/cpython/get/` | ||||
Show All 38 Lines | .. http:get:: /api/1/origin/search/(url_pattern)/ | ||||
: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} | {resheader_link} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`origin/search/python/?limit=2` | :swh_web_api:`origin/search/python/?limit=2` | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | .. http:get:: /api/1/origin/metadata-search/ | ||||
ones. | ones. | ||||
:query int limit: the maximum number of found origins to return | :query int limit: the maximum number of found origins to return | ||||
(bounded to 100) | (bounded to 100) | ||||
{return_origin_array} | {return_origin_array} | ||||
{common_headers} | {common_headers} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`origin/metadata-search/?limit=2&fulltext=Jane%20Doe` | :swh_web_api:`origin/metadata-search/?limit=2&fulltext=Jane%20Doe` | ||||
""" | """ | ||||
Show All 30 Lines | .. http:get:: /api/1/origin/(origin_url)/visits/ | ||||
:query int last_visit: visit to start listing from, for pagination | :query int last_visit: visit to start listing from, for pagination | ||||
purposes | purposes | ||||
{common_headers} | {common_headers} | ||||
{resheader_link} | {resheader_link} | ||||
{return_origin_visit_array} | {return_origin_visit_array} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
:statuscode 404: requested origin can not be found in the archive | :statuscode 404: requested origin can not be found in the archive | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`origin/https://github.com/hylang/hy/visits/` | :swh_web_api:`origin/https://github.com/hylang/hy/visits/` | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | .. http:get:: /api/1/origin/(origin_url)/visit/latest/ | ||||
:param str origin_url: a software origin URL | :param str origin_url: a software origin URL | ||||
:query boolean require_snapshot: if true, only return a visit | :query boolean require_snapshot: if true, only return a visit | ||||
with a snapshot | with a snapshot | ||||
{common_headers} | {common_headers} | ||||
{return_origin_visit} | {return_origin_visit} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
:statuscode 404: requested origin or visit can not be found in the | :statuscode 404: requested origin or visit can not be found in the | ||||
archive | archive | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
Show All 23 Lines | .. http:get:: /api/1/origin/(origin_url)/visit/(visit_id)/ | ||||
:param str origin_url: a software origin URL | :param str origin_url: a software origin URL | ||||
:param int visit_id: a visit identifier | :param int visit_id: a visit identifier | ||||
{common_headers} | {common_headers} | ||||
{return_origin_visit} | {return_origin_visit} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
:statuscode 404: requested origin or visit can not be found in the | :statuscode 404: requested origin or visit can not be found in the | ||||
archive | archive | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
Show All 20 Lines | .. http:get:: /api/1/origin/(origin_url)/intrinsic-metadata | ||||
Get intrinsic metadata of a software origin (as a JSON-LD/CodeMeta dictionary). | Get intrinsic metadata of a software origin (as a JSON-LD/CodeMeta dictionary). | ||||
:param string origin_url: the origin url | :param string origin_url: the origin url | ||||
:>json string ???: intrinsic metadata field of the origin | :>json string ???: intrinsic metadata field of the origin | ||||
{common_headers} | {common_headers} | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
:statuscode 404: requested origin can not be found in the archive | :statuscode 404: requested origin can not be found in the archive | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`origin/https://github.com/python/cpython/intrinsic-metadata` | :swh_web_api:`origin/https://github.com/python/cpython/intrinsic-metadata` | ||||
Show All 12 Lines |