Ejemplo n.º 1
0
    for viewsets in app_config.named_viewsets.values():
        all_viewsets.extend(viewsets)
    if app_config.urls_module:
        plugin_patterns.append(app_config.urls_module)

sorted_by_depth = sorted(all_viewsets, key=lambda vs: vs._get_nest_depth())
vs_tree = ViewSetNode()
for viewset in sorted_by_depth:
    vs_tree.add_decendent(ViewSetNode(viewset))

#: The Pulp Platform v3 API router, which can be used to manually register ViewSets with the API.
root_router = routers.DefaultRouter()

urlpatterns = [
    path(f"{API_ROOT}repair/", RepairView.as_view()),
    path(f"{API_ROOT}status/", StatusView.as_view()),
    path(
        f"{API_ROOT}orphans/cleanup/",
        OrphansCleanupViewset.as_view({"post": "cleanup"}),
    ),
    path(f"{API_ROOT}orphans/", OrphansView.as_view()),
    path(
        f"{API_ROOT}repository_versions/",
        ListRepositoryVersionViewSet.as_view({"get": "list"}),
    ),
    path(
        f"{API_ROOT}repositories/reclaim_space/",
        ReclaimSpaceViewSet.as_view({"post": "reclaim"}),
    ),
    path(
        f"{API_ROOT}importers/core/pulp/import-check/",
Ejemplo n.º 2
0
    for viewsets in app_config.named_viewsets.values():
        all_viewsets.extend(viewsets)
    if app_config.urls_module:
        plugin_patterns.append(app_config.urls_module)

sorted_by_depth = sorted(all_viewsets, key=lambda vs: vs._get_nest_depth())
vs_tree = ViewSetNode()
for viewset in sorted_by_depth:
    vs_tree.add_decendent(ViewSetNode(viewset))

#: The Pulp Platform v3 API router, which can be used to manually register ViewSets with the API.
root_router = routers.DefaultRouter()

urlpatterns = [
    url(r"^{api_root}repair/".format(api_root=API_ROOT), RepairView.as_view()),
    url(r"^{api_root}status/".format(api_root=API_ROOT), StatusView.as_view()),
    url(r"^{api_root}orphans/".format(api_root=API_ROOT),
        OrphansView.as_view()),
    url(r"^auth/", include("rest_framework.urls")),
    path(settings.ADMIN_SITE_URL, admin.site.urls),
]

urlpatterns.append(
    url(
        r"^{api_root}docs/api.json".format(api_root=API_ROOT),
        SpectacularJSONAPIView.as_view(),
        name="schema",
    ))

urlpatterns.append(
    url(
Ejemplo n.º 3
0
    for viewset in app_config.named_viewsets.values():
        all_viewsets.append(viewset)
    if app_config.urls_module:
        plugin_patterns.append(app_config.urls_module)

sorted_by_depth = sorted(all_viewsets, key=lambda vs: vs._get_nest_depth())
vs_tree = ViewSetNode()
for viewset in sorted_by_depth:
    vs_tree.add_decendent(ViewSetNode(viewset))

#: The Pulp Platform v3 API router, which can be used to manually register ViewSets with the API.
root_router = routers.DefaultRouter()

urlpatterns = [
    url(r'^{}/'.format(ContentView.BASE_PATH), ContentView.as_view(), name='content-app'),
    url(r'^{api_root}status/'.format(api_root=API_ROOT), StatusView.as_view()),
    url(r'^{api_root}orphans/'.format(api_root=API_ROOT), OrphansView.as_view()),
    url(r'^auth/', include('rest_framework.urls')),
]

docs_schema_view = yasg_get_schema_view(
    openapi.Info(
        title="Pulp3 API",
        default_version='v3',
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
    generator_class=PulpOpenAPISchemaGenerator,
)
urlpatterns.append(url(
    r'^{api_root}docs/api(?P<format>\.json|\.yaml)'.format(api_root=API_ROOT),