-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from nautobot/next-2.0
Updates for Nautobot 2.0
- Loading branch information
Showing
43 changed files
with
1,691 additions
and
1,346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
griffe=0.30.1 | ||
mkdocs==1.3.1 | ||
mkdocs-material==8.4.2 | ||
mkdocstrings==0.19 | ||
mkdocstrings-python==0.7.1 | ||
mkdocstrings==0.22.0 | ||
mkdocstrings-python==1.1.2 | ||
mkdocs-version-annotations==1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
"""REST API URLs for device onboarding.""" | ||
|
||
from rest_framework import routers | ||
from nautobot_device_onboarding.api.views import OnboardingTaskView | ||
from nautobot.apps.api import OrderedDefaultRouter | ||
|
||
router = routers.DefaultRouter() | ||
from nautobot_device_onboarding.api import views | ||
|
||
router.register(r"onboarding", OnboardingTaskView) | ||
router = OrderedDefaultRouter() | ||
router.register("onboarding", views.OnboardingTaskViewSet) | ||
|
||
|
||
app_name = "nautobot_device_onboarding-api" | ||
urlpatterns = router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,23 @@ | ||
"""Django REST Framework API views for device onboarding.""" | ||
|
||
# from drf_yasg.openapi import Parameter, TYPE_STRING | ||
# from drf_yasg.utils import swagger_auto_schema | ||
from rest_framework import status | ||
from rest_framework.response import Response | ||
|
||
from rest_framework import mixins, viewsets | ||
|
||
# from rest_framework.decorators import action | ||
# from rest_framework.response import Response | ||
|
||
# from nautobot.utilities.api import IsAuthenticatedOrLoginNotRequired | ||
|
||
# from nautobot.dcim.models import Device, Site, Platform, DeviceRole | ||
from nautobot.apps.api import NautobotModelViewSet | ||
|
||
from nautobot_device_onboarding.models import OnboardingTask | ||
from nautobot_device_onboarding.filters import OnboardingTaskFilterSet | ||
|
||
# from nautobot_device_onboarding.choices import OnboardingStatusChoices | ||
from nautobot_device_onboarding.api.serializers import OnboardingTaskSerializer | ||
|
||
|
||
class OnboardingTaskView( # pylint: disable=too-many-ancestors | ||
mixins.CreateModelMixin, | ||
mixins.ListModelMixin, | ||
mixins.RetrieveModelMixin, | ||
mixins.DestroyModelMixin, | ||
viewsets.GenericViewSet, | ||
): | ||
"""Create, check status of, and delete onboarding tasks. | ||
In-place updates (PUT, PATCH) of tasks are not permitted. | ||
""" | ||
class OnboardingTaskViewSet(NautobotModelViewSet): | ||
"""API Viewset.""" | ||
|
||
queryset = OnboardingTask.objects.all() | ||
filterset_class = OnboardingTaskFilterSet | ||
serializer_class = OnboardingTaskSerializer | ||
|
||
def update(self, request, *args, **kwargs): | ||
"""Override the update method to disallow put/patch.""" | ||
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.