Esempio n. 1
0
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, ),
)
urlpatterns.append(
    url(r'^{api_root}docs/api(?P<format>\.json|\.yaml)'.format(
        api_root=API_ROOT),
        docs_schema_view.without_ui(cache_timeout=None),
        name='schema-json'))

urlpatterns.append(
    url(r'^{api_root}docs/'.format(api_root=API_ROOT),
        docs_schema_view.with_ui('redoc', cache_timeout=None),
        name='schema-redoc'))

schema_view = get_schema_view(title='Pulp API')
Esempio n. 2
0
    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')),
]

api_info = openapi.Info(
    title="Pulp 3 API",
    default_version='v3',
    logo={
        "url":
        "https://pulp.plan.io/attachments/download/517478/pulp_logo_word_rectangle.svg"
    })

docs_schema_view = yasg_get_schema_view(
    public=True,
    permission_classes=(permissions.AllowAny, ),
)
urlpatterns.append(
    url(r'^{api_root}docs/api(?P<format>\.json|\.yaml)'.format(
        api_root=API_ROOT),
        docs_schema_view.without_ui(cache_timeout=None),
        name='schema-json'))

urlpatterns.append(
    url(r'^{api_root}docs/'.format(api_root=API_ROOT),
        docs_schema_view.with_ui('redoc', cache_timeout=None),
        name='schema-redoc'))

schema_view = get_schema_view(
    title='Pulp API',
    permission_classes=[permissions.AllowAny],
Esempio n. 3
0
#: 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),
    docs_schema_view.without_ui(cache_timeout=None),
    name='schema-json')
)

urlpatterns.append(url(
    r'^{api_root}docs/'.format(api_root=API_ROOT),
    docs_schema_view.with_ui('redoc', cache_timeout=None),
    name='schema-redoc')
)
Esempio n. 4
0
from users.api.login import ObtainAuthTokenAndLogging, obtainJwtTokenAndLogging
from .settings import MEDIA_ROOT
from users.urls import router as user_router
from resources.urls import router as resources_router
from .api import devops_info

schema_view = get_schema_view(
    title="Devops API", renderer_classes=[SwaggerUIRenderer, OpenAPIRenderer])

yasg_schema_view = yasg_get_schema_view(
    openapi.Info(
        title="Devops API",
        default_version='v1',
        description="Test description",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="BSD License"),
    ),
    validators=['flex', 'ssv'],
    public=True,
    permission_classes=(permissions.IsAuthenticatedOrReadOnly, ),
)

router = DefaultRouter()
router.registry.extend(user_router.registry)
router.registry.extend(resources_router.registry)

api_patterns = [
    url(
        r'^resources/v1/',
        include('resources.urls',
Esempio n. 5
0
#
# Copyright (C) 2016-2020 TU Muenchen and contributors of ANEXIA Internetdienstleistungs GmbH
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from django.conf.urls import url
from drf_yasg import openapi as yasg_openapi
from drf_yasg.views import get_schema_view as yasg_get_schema_view
from rest_framework.permissions import AllowAny

schema_view = yasg_get_schema_view(
    yasg_openapi.Info(
        title='eWorkbench API',
        default_version='1.x',
        description='Backend API documentation',
    ),
    public=False,  # True = Include endpoints the current user has no access to
    permission_classes=(AllowAny, ),
)

urlpatterns = [
    url(r'^swagger(?P<format>\.json|\.yaml)$',
        schema_view.without_ui(cache_timeout=0),
        name='schema-json'),
    url(r'^swagger/$',
        schema_view.with_ui('swagger', cache_timeout=0),
        name='schema-swagger-ui'),
    url(r'^redoc/$',
        schema_view.with_ui('redoc', cache_timeout=0),
        name='schema-redoc'),
]