Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/urls.py
# Copyright (C) 2017-2018 The Software Heritage developers | # Copyright (C) 2017-2019 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 General Public License version 3, or any later version | # License: GNU 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 | ||||
"""swh URL Configuration | """SWH's deposit api URL Configuration | ||||
anlambert: I would rather write `SWH's deposit api URL configuration` here | |||||
""" | """ | ||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from django.shortcuts import render | |||||
from ..config import EDIT_SE_IRI, EM_IRI, CONT_FILE_IRI | from ..config import EDIT_SE_IRI, EM_IRI, CONT_FILE_IRI | ||||
from ..config import SD_IRI, COL_IRI, STATE_IRI | from ..config import SD_IRI, COL_IRI, STATE_IRI | ||||
from .deposit import SWHDeposit | from .deposit import SWHDeposit | ||||
from .deposit_status import SWHDepositStatus | from .deposit_status import SWHDepositStatus | ||||
from .deposit_update import SWHUpdateMetadataDeposit | from .deposit_update import SWHUpdateMetadataDeposit | ||||
from .deposit_update import SWHUpdateArchiveDeposit | from .deposit_update import SWHUpdateArchiveDeposit | ||||
from .deposit_content import SWHDepositContent | from .deposit_content import SWHDepositContent | ||||
from .service_document import SWHServiceDocument | from .service_document import SWHServiceDocument | ||||
urlpatterns = [ | |||||
# PUBLIC API | |||||
def api_view(req): | |||||
return render(req, "api.html") | |||||
# PUBLIC API | |||||
urlpatterns = [ | |||||
# simple view on the api | |||||
url(r'^$', api_view, name='api'), | |||||
# SD IRI - Service Document IRI | # SD IRI - Service Document IRI | ||||
# -> GET | # -> GET | ||||
url(r'^servicedocument/', SWHServiceDocument.as_view(), | url(r'^servicedocument/', SWHServiceDocument.as_view(), | ||||
name=SD_IRI), | name=SD_IRI), | ||||
# Col IRI - Collection IRI | # Col IRI - Collection IRI | ||||
# -> POST | # -> POST | ||||
url(r'^(?P<collection_name>[^/]+)/$', SWHDeposit.as_view(), | url(r'^(?P<collection_name>[^/]+)/$', SWHDeposit.as_view(), | ||||
name=COL_IRI), | name=COL_IRI), | ||||
Show All 26 Lines |
I would rather write SWH's deposit api URL configuration here