Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/+v4-api.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started adding plugin-specific support for the Pulp "v4" API - these endpoints should not yet be considered actively supported.
22 changes: 19 additions & 3 deletions pulp_deb/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@
# If there are problems with the copy API, or domain support should be added, consult pulp_rpm.

from django.conf import settings
from django.urls import path
from django.urls import path, include

from .viewsets import CopyViewSet

V3_API_ROOT = settings.V3_API_ROOT_NO_FRONT_SLASH
if settings.DOMAIN_ENABLED:
V3_API_ROOT = settings.V3_DOMAIN_API_ROOT_NO_FRONT_SLASH
else:
V3_API_ROOT = settings.V3_API_ROOT_NO_FRONT_SLASH

additional_deb_apis = [
path("copy/", CopyViewSet.as_view({"post": "create"})),
]

urlpatterns = [
path(f"{V3_API_ROOT}deb/copy/", CopyViewSet.as_view({"post": "create"})),
path(f"{V3_API_ROOT}deb/", include(additional_deb_apis)),
]

if getattr(settings, "ENABLE_V4_API", False):
V4_API_ROOT = settings.V4_DOMAIN_API_ROOT_NO_FRONT_SLASH

additional_deb_apis = [
path("copy/", CopyViewSet.as_view({"post": "create"}, name="deb-copy")),
]

path(f"{V4_API_ROOT}rpm/", include((additional_deb_apis, "deb"), namespace="v4"))