Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/release.py
# Copyright (C) 2015-2019 The Software Heritage developers | # Copyright (C) 2015-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from rest_framework.request import Request | |||||
from swh.web.api import utils | from swh.web.api import utils | ||||
from swh.web.api.apidoc import api_doc, format_docstring | from swh.web.api.apidoc import api_doc, format_docstring | ||||
from swh.web.api.apiurls import api_route | from swh.web.api.apiurls import api_route | ||||
from swh.web.api.views.utils import api_lookup | from swh.web.api.views.utils import api_lookup | ||||
from swh.web.common import archive | from swh.web.common import archive | ||||
@api_route( | @api_route( | ||||
r"/release/(?P<sha1_git>[0-9a-f]+)/", "api-1-release", checksum_args=["sha1_git"] | r"/release/(?P<sha1_git>[0-9a-f]+)/", "api-1-release", checksum_args=["sha1_git"] | ||||
) | ) | ||||
@api_doc("/release/") | @api_doc("/release/") | ||||
@format_docstring() | @format_docstring() | ||||
def api_release(request, sha1_git): | def api_release(request: Request, sha1_git: str): | ||||
""" | """ | ||||
.. http:get:: /api/1/release/(sha1_git)/ | .. http:get:: /api/1/release/(sha1_git)/ | ||||
Get information about a release in the archive. Releases are identified | Get information about a release in the archive. Releases are identified | ||||
by **sha1** checksums, compatible with Git tag identifiers. See | by **sha1** checksums, compatible with Git tag identifiers. See | ||||
:func:`swh.model.git_objects.release_git_object` in our data model | :func:`swh.model.git_objects.release_git_object` in our data model | ||||
module for details about how they are computed. | module for details about how they are computed. | ||||
Show All 34 Lines |