Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/private/urls.py
# Copyright (C) 2017-2018 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 | ||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from ...config import ( | from ...config import ( | ||||
PRIVATE_GET_RAW_CONTENT, | PRIVATE_GET_RAW_CONTENT, | ||||
PRIVATE_PUT_DEPOSIT, | PRIVATE_PUT_DEPOSIT, | ||||
PRIVATE_GET_DEPOSIT_METADATA, | PRIVATE_GET_DEPOSIT_METADATA, | ||||
PRIVATE_CHECK_DEPOSIT, | PRIVATE_CHECK_DEPOSIT, | ||||
PRIVATE_LIST_DEPOSITS, | PRIVATE_LIST_DEPOSITS, | ||||
) | ) | ||||
from .deposit_read import SWHDepositReadArchives | from .deposit_read import APIReadArchives | ||||
from .deposit_read import SWHDepositReadMetadata | from .deposit_read import APIReadMetadata | ||||
from .deposit_update_status import SWHUpdateStatusDeposit | from .deposit_update_status import APIUpdateStatus | ||||
from .deposit_check import SWHChecksDeposit | from .deposit_check import APIChecks | ||||
from .deposit_list import DepositList | from .deposit_list import APIList | ||||
urlpatterns = [ | urlpatterns = [ | ||||
# Retrieve deposit's raw archives' content | # Retrieve deposit's raw archives' content | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/raw/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/raw/$", | ||||
SWHDepositReadArchives.as_view(), | APIReadArchives.as_view(), | ||||
name=PRIVATE_GET_RAW_CONTENT, | name=PRIVATE_GET_RAW_CONTENT, | ||||
), | ), | ||||
# Update deposit's status | # Update deposit's status | ||||
# -> PUT | # -> PUT | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/update/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/update/$", | ||||
SWHUpdateStatusDeposit.as_view(), | APIUpdateStatus.as_view(), | ||||
name=PRIVATE_PUT_DEPOSIT, | name=PRIVATE_PUT_DEPOSIT, | ||||
), | ), | ||||
# Retrieve metadata information on a specific deposit | # Retrieve metadata information on a specific deposit | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/meta/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/meta/$", | ||||
SWHDepositReadMetadata.as_view(), | APIReadMetadata.as_view(), | ||||
name=PRIVATE_GET_DEPOSIT_METADATA, | name=PRIVATE_GET_DEPOSIT_METADATA, | ||||
), | ), | ||||
# Check archive and metadata information on a specific deposit | # Check archive and metadata information on a specific deposit | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/check/$", | r"^(?P<collection_name>[^/]+)/(?P<deposit_id>[^/]+)/check/$", | ||||
SWHChecksDeposit.as_view(), | APIChecks.as_view(), | ||||
name=PRIVATE_CHECK_DEPOSIT, | name=PRIVATE_CHECK_DEPOSIT, | ||||
), | ), | ||||
# Retrieve deposit's raw archives' content | # Retrieve deposit's raw archives' content | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<deposit_id>[^/]+)/raw/$", | r"^(?P<deposit_id>[^/]+)/raw/$", | ||||
SWHDepositReadArchives.as_view(), | APIReadArchives.as_view(), | ||||
name=PRIVATE_GET_RAW_CONTENT + "-nc", | name=PRIVATE_GET_RAW_CONTENT + "-nc", | ||||
), | ), | ||||
# Update deposit's status | # Update deposit's status | ||||
# -> PUT | # -> PUT | ||||
url( | url( | ||||
r"^(?P<deposit_id>[^/]+)/update/$", | r"^(?P<deposit_id>[^/]+)/update/$", | ||||
SWHUpdateStatusDeposit.as_view(), | APIUpdateStatus.as_view(), | ||||
name=PRIVATE_PUT_DEPOSIT + "-nc", | name=PRIVATE_PUT_DEPOSIT + "-nc", | ||||
), | ), | ||||
# Retrieve metadata information on a specific deposit | # Retrieve metadata information on a specific deposit | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<deposit_id>[^/]+)/meta/$", | r"^(?P<deposit_id>[^/]+)/meta/$", | ||||
SWHDepositReadMetadata.as_view(), | APIReadMetadata.as_view(), | ||||
name=PRIVATE_GET_DEPOSIT_METADATA + "-nc", | name=PRIVATE_GET_DEPOSIT_METADATA + "-nc", | ||||
), | ), | ||||
# Check archive and metadata information on a specific deposit | # Check archive and metadata information on a specific deposit | ||||
# -> GET | # -> GET | ||||
url( | url( | ||||
r"^(?P<deposit_id>[^/]+)/check/$", | r"^(?P<deposit_id>[^/]+)/check/$", | ||||
SWHChecksDeposit.as_view(), | APIChecks.as_view(), | ||||
name=PRIVATE_CHECK_DEPOSIT + "-nc", | name=PRIVATE_CHECK_DEPOSIT + "-nc", | ||||
), | ), | ||||
url(r"^deposits/$", DepositList.as_view(), name=PRIVATE_LIST_DEPOSITS), | url(r"^deposits/$", APIList.as_view(), name=PRIVATE_LIST_DEPOSITS), | ||||
] | ] |