Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/views/directory.py
# Copyright (C) 2015-2018 The Software Heritage developers | # Copyright (C) 2015-2018 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 swh.web.common import service | from swh.web.common import service | ||||
from swh.web.api import utils | from swh.web.api import utils | ||||
from swh.web.api.apidoc import api_doc | from swh.web.api.apidoc import api_doc | ||||
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 | ||||
@api_route(r'/directory/(?P<sha1_git>[0-9a-f]+)/', 'api-directory') | @api_route(r'/directory/(?P<sha1_git>[0-9a-fA-F]+)/', 'api-directory') | ||||
@api_route(r'/directory/(?P<sha1_git>[0-9a-f]+)/(?P<path>.+)/', | @api_route(r'/directory/(?P<sha1_git>[0-9a-fA-F]+)/(?P<path>.+)/', | ||||
'api-directory') | 'api-directory') | ||||
@api_doc('/directory/') | @api_doc('/directory/') | ||||
def api_directory(request, sha1_git, path=None): | def api_directory(request, sha1_git, path=None): | ||||
""" | """ | ||||
.. http:get:: /api/1/directory/(sha1_git)/[(path)/] | .. http:get:: /api/1/directory/(sha1_git)/[(path)/] | ||||
Get information about directory objects. | Get information about directory objects. | ||||
Directories are identified by **sha1** checksums, compatible with Git directory identifiers. | Directories are identified by **sha1** checksums, compatible with Git directory identifiers. | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |