swh.web.provenance.api_views module#
- swh.web.provenance.api_views.api_provenance_whereis(request: Request, target: str)[source]#
- GET /api/1/provenance/whereis/(target)/#
Given a core SWHID return a qualified SWHID with some provenance info:
the release or revision containing that content or directory
the url of the origin containing that content or directory
This can also be called for revision, release or snapshot to retrieve origin url information if any. When using a revision, the anchor will be an associated release if any.
Note
The quality of the result is not guaranteed whatsoever. Since the definition of “best” likely vary from one usage to the next, this API will evolve in the futur when this notion get better defined.
Warning
That endpoint is not publicly available and requires authentication and special user permission in order to request it.
- Parameters:
target (string) – a core SWHID targeting an archived object
The response is a string containing a qualified SWHID with provenance info.
- Request Headers:
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers:
Content-Type – this depends on Accept header of request
- Status Codes:
200 OK – no error
400 Bad Request – provided core SWHID is invalid
401 Unauthorized – request is not authenticated
403 Forbidden – user does not have permission to query the endpoint
Example:
https://archive.softwareheritage.org/api/1/provenance/whereis/swh:1:cnt:dcb2d732994e615aab0777bfe625bd1f07e486ac/
- swh.web.provenance.api_views.api_provenance_whereare(request: Request)[source]#
- POST /api/1/provenance/whereare/#
Given a list of core SWHIDs return qualified SWHIDs with some provenance info.
See
GET /api/1/provenance/whereis/(target)/
documentation for more details.Warning
That endpoint is not publicly available and requires authentication and special user permission in order to request it.
- Request JSON Array of Objects:
- (string) – input array of core SWHIDs
The response is a JSON array of strings containing qualified SWHIDs with provenance info.
- Request Headers:
Accept – the requested response content type, either
application/json
(default) orapplication/yaml
- Response Headers:
Content-Type – this depends on Accept header of request
- Status Codes:
200 OK – no error
400 Bad Request – provided core SWHID is invalid
401 Unauthorized – request is not authenticated
403 Forbidden – user does not have permission to query the endpoint