Skip to content

Commit ad29bb3

Browse files
committed
Add initial plugin-specific support for "v4" API endpoints
1 parent 90ea5ff commit ad29bb3

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

CHANGES/+v4-api.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Started adding plugin-specific support for the Pulp "v4" API - these endpoints should not yet be considered actively supported.

pulp_deb/app/urls.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,24 @@
66

77
from .viewsets import CopyViewSet
88

9-
V3_API_ROOT = settings.V3_API_ROOT_NO_FRONT_SLASH
9+
if settings.DOMAIN_ENABLED:
10+
V3_API_ROOT = settings.V3_DOMAIN_API_ROOT_NO_FRONT_SLASH
11+
else:
12+
V3_API_ROOT = settings.V3_API_ROOT_NO_FRONT_SLASH
13+
14+
additional_deb_apis = [
15+
path(f"copy/", CopyViewSet.as_view({"post": "create"})),
16+
]
1017

1118
urlpatterns = [
12-
path(f"{V3_API_ROOT}deb/copy/", CopyViewSet.as_view({"post": "create"})),
19+
path(f"{V3_API_ROOT}deb/", include(additional_deb_apis)),
1320
]
21+
22+
if getattr(settings, "ENABLE_V4_API", False):
23+
V4_API_ROOT = settings.V4_API_ROOT_NO_FRONT_SLASH
24+
25+
additional_deb_apis = [
26+
path(f"copy/", CopyViewSet.as_view({"post": "create"}, name="deb-copy")),
27+
]
28+
29+
path(f"{V4_API_ROOT}rpm/", include((additional_deb_apis, "deb"), namespace="v4"))

0 commit comments

Comments
 (0)