Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/urls.py
# Copyright (C) 2017-2020 The Software Heritage developers | # Copyright (C) 2017-2020 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's deposit api URL Configuration | """SWH's deposit api URL Configuration | ||||
""" | """ | ||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from django.shortcuts import render | from django.shortcuts import render | ||||
from ..config import COL_IRI, CONT_FILE_IRI, EDIT_SE_IRI, EM_IRI, SD_IRI, STATE_IRI | from ..config import COL_IRI, CONT_FILE_IRI, EDIT_IRI, EM_IRI, SD_IRI, SE_IRI, STATE_IRI | ||||
from .collection import CollectionAPI | from .collection import CollectionAPI | ||||
from .content import ContentAPI | from .content import ContentAPI | ||||
from .edit import EditAPI | from .edit import EditAPI | ||||
from .edit_media import EditMediaAPI | from .edit_media import EditMediaAPI | ||||
from .service_document import ServiceDocumentAPI | from .service_document import ServiceDocumentAPI | ||||
from .state import StateAPI | from .state import StateAPI | ||||
from .sword_edit import SwordEditAPI | |||||
def api_view(req): | def api_view(req): | ||||
return render(req, "api.html") | return render(req, "api.html") | ||||
# PUBLIC API | # PUBLIC API | ||||
urlpatterns = [ | urlpatterns = [ | ||||
Show All 9 Lines | urlpatterns = [ | ||||
# -> PUT (update-in-place existing archive) | # -> PUT (update-in-place existing archive) | ||||
# -> POST (add new archive) | # -> POST (add new archive) | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/media/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/media/$", | ||||
EditMediaAPI.as_view(), | EditMediaAPI.as_view(), | ||||
name=EM_IRI, | name=EM_IRI, | ||||
), | ), | ||||
# Edit IRI - Atom Entry Edit IRI (update metadata IRI) | # Edit IRI - Atom Entry Edit IRI (update metadata IRI) | ||||
# SE IRI - Sword Edit IRI ;; possibly same as Edit IRI | |||||
# -> PUT (update in place) | # -> PUT (update in place) | ||||
# -> DELETE (delete container) | |||||
url( | |||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/atom/$", | |||||
EditAPI.as_view(), | |||||
name=EDIT_IRI, | |||||
), | |||||
# SE IRI - Sword Edit IRI ;; possibly same as Edit IRI | |||||
# -> POST (add new metadata) | # -> POST (add new metadata) | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/metadata/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/metadata/$", | ||||
EditAPI.as_view(), | SwordEditAPI.as_view(), | ||||
name=EDIT_SE_IRI, | name=SE_IRI, | ||||
), | ), | ||||
# State IRI | # State IRI | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/status/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/status/$", | ||||
StateAPI.as_view(), | StateAPI.as_view(), | ||||
name=STATE_IRI, | name=STATE_IRI, | ||||
), | ), | ||||
Show All 10 Lines |