Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/release.py
Show All 33 Lines | .. http:get:: /api/1/release/(sha1_git)/ | ||||
:>json string message: the message associated to the release | :>json string message: the message associated to the release | ||||
:>json string name: the name of the release | :>json string name: the name of the release | ||||
:>json string target: the target identifier of the release | :>json string target: the target identifier of the release | ||||
:>json string target_type: the type of the target, can be either | :>json string target_type: the type of the target, can be either | ||||
**release**, **revision**, **content**, **directory** | **release**, **revision**, **content**, **directory** | ||||
:>json string target_url: a link to the adequate api url based on the | :>json string target_url: a link to the adequate api url based on the | ||||
target type | target type | ||||
**Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, | |||||
:http:method:`options` | |||||
:statuscode 200: no error | :statuscode 200: no error | ||||
:statuscode 400: an invalid **sha1_git** value has been provided | :statuscode 400: an invalid **sha1_git** value has been provided | ||||
:statuscode 404: requested release can not be found in the archive | :statuscode 404: requested release can not be found in the archive | ||||
**Example:** | **Example:** | ||||
.. parsed-literal:: | .. parsed-literal:: | ||||
:swh_web_api:`release/208f61cc7a5dbc9879ae6e5c2f95891e270f09ef/` | :swh_web_api:`release/208f61cc7a5dbc9879ae6e5c2f95891e270f09ef/` | ||||
""" | """ | ||||
error_msg = 'Release with sha1_git %s not found.' % sha1_git | error_msg = 'Release with sha1_git %s not found.' % sha1_git | ||||
return api_lookup( | return api_lookup( | ||||
service.lookup_release, sha1_git, | service.lookup_release, sha1_git, | ||||
notfound_msg=error_msg, | notfound_msg=error_msg, | ||||
enrich_fn=utils.enrich_release, | enrich_fn=utils.enrich_release, | ||||
request=request) | request=request) |