Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/metadata.py
Show All 25 Lines | @api_route( | ||||
"api-1-raw-extrinsic-metadata-swhid", | "api-1-raw-extrinsic-metadata-swhid", | ||||
) | ) | ||||
@api_doc("/raw-extrinsic-metadata/swhid/") | @api_doc("/raw-extrinsic-metadata/swhid/") | ||||
@format_docstring() | @format_docstring() | ||||
def api_raw_extrinsic_metadata_swhid(request, target): | def api_raw_extrinsic_metadata_swhid(request, target): | ||||
""" | """ | ||||
.. http:get:: /api/1/raw-extrinsic-metadata/swhid/(target) | .. http:get:: /api/1/raw-extrinsic-metadata/swhid/(target) | ||||
Returns raw `extrinsic metadata`_ collected on a given object. | Returns raw `extrinsic metadata <https://docs.softwareheritage.org/devel/glossary.html#term-extrinsic-metadata>`__ collected on a given object. | ||||
.. _extrinsic metadata: https://docs.softwareheritage.org/devel/glossary.html#term-extrinsic-metadata | |||||
:param string target: The SWHID of the object whose metadata should be returned | :param string target: The SWHID of the object whose metadata should be returned | ||||
:query string authority: A metadata authority identifier, formatted as | :query string authority: A metadata authority identifier, formatted as | ||||
`<type> <IRI>`. Required. | ``<type> <IRI>``. Required. | ||||
:query string after: An ISO representation of the minimum timestamp of metadata | :query string after: An ISO representation of the minimum timestamp of metadata | ||||
to fetch. Defaults to allowing all metadata. | to fetch. Defaults to allowing all metadata. | ||||
:query int limit: Maximum number of metadata objects to return. | :query int limit: Maximum number of metadata objects to return. | ||||
{common_headers} | {common_headers} | ||||
:>jsonarr string target: SWHID of the object described by this metadata | :>jsonarr string target: SWHID of the object described by this metadata | ||||
:>jsonarr string discovery_date: ISO8601 timestamp of the moment this | :>jsonarr string discovery_date: ISO8601 timestamp of the moment this | ||||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | |||||
@api_doc("/raw-extrinsic-metadata/swhid/authorities/") | @api_doc("/raw-extrinsic-metadata/swhid/authorities/") | ||||
@format_docstring() | @format_docstring() | ||||
def api_raw_extrinsic_metadata_swhid_authorities(request, target): | def api_raw_extrinsic_metadata_swhid_authorities(request, target): | ||||
""" | """ | ||||
.. http:get:: /api/1/raw-extrinsic-metadata/swhid/(target)/authorities/ | .. http:get:: /api/1/raw-extrinsic-metadata/swhid/(target)/authorities/ | ||||
Returns a list of metadata authorities that provided metadata on | Returns a list of metadata authorities that provided metadata on | ||||
the given target. | the given target. | ||||
They can then be used to get the raw `extrinsic metadata`_ collected on | They can then be used to get the raw `extrinsic metadata <https://docs.softwareheritage.org/devel/glossary.html#term-extrinsic-metadata>`__ collected on | ||||
that object from each of the authorities. | that object from each of the authorities. | ||||
.. _extrinsic metadata: https://docs.softwareheritage.org/devel/glossary.html#term-extrinsic-metadata | |||||
:param string target: The SWHID of the object whose metadata-providing | :param string target: The SWHID of the object whose metadata-providing | ||||
authorities should be returned | authorities should be returned | ||||
{common_headers} | {common_headers} | ||||
:>jsonarr string type: Type of authority (deposit_client, forge, registry) | :>jsonarr string type: Type of authority (deposit_client, forge, registry) | ||||
:>jsonarr string url: Unique IRI identifying the authority | :>jsonarr string url: Unique IRI identifying the authority | ||||
:>jsonarr object metadata_list_url: URL to get the list of metadata objects | :>jsonarr object metadata_list_url: URL to get the list of metadata objects | ||||
Show All 35 Lines |