Follow the attribution requirements of the Apache License 2.0 for this fork of ICTU/netbox_slm: - add a NOTICE file with the original copyright (ICTU) and the fork's notice - mark every file changed since upstream 1.9.0 as modified (section 4b); the original copyright header in __init__.py is kept - add a visible fork notice and a section on origin, credits, changes and license to the README - point project URLs to this fork (with an Upstream link), list ICTU as author and MrBlake as maintainer, and stop showing ICTU's email address as the plugin contact - ship NOTICE in the package and drop the MANIFEST entry for the removed SECURITY.md Bump version to 1.14.1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
62 lines
2.0 KiB
Python
62 lines
2.0 KiB
Python
# Modified by MrBlake for the NetBox-SLM fork: https://git.mrblake.cc/MrBlake/NetBox-SLM
|
|
# Based on ICTU/netbox_slm (Apache License 2.0). See the LICENSE and NOTICE files.
|
|
from rest_framework.routers import APIRootView
|
|
|
|
from netbox.api.viewsets import NetBoxModelViewSet
|
|
from netbox_slm.api.serializers import (
|
|
SoftwareProductSerializer,
|
|
SoftwareProductVersionSerializer,
|
|
SoftwareProductInstallationSerializer,
|
|
SoftwareLicenseSerializer,
|
|
CertificateSerializer,
|
|
)
|
|
from netbox_slm.filtersets import (
|
|
SoftwareProductFilterSet,
|
|
SoftwareProductVersionFilterSet,
|
|
SoftwareProductInstallationFilterSet,
|
|
SoftwareLicenseFilterSet,
|
|
CertificateFilterSet,
|
|
)
|
|
from netbox_slm.models import (
|
|
SoftwareProduct,
|
|
SoftwareProductVersion,
|
|
SoftwareProductInstallation,
|
|
SoftwareLicense,
|
|
Certificate,
|
|
)
|
|
|
|
|
|
class NetboxSLMRootView(APIRootView):
|
|
def get_view_name(self):
|
|
return "NetboxSLM"
|
|
|
|
|
|
class SoftwareProductViewSet(NetBoxModelViewSet):
|
|
queryset = SoftwareProduct.objects.all().order_by("id")
|
|
serializer_class = SoftwareProductSerializer
|
|
filterset_class = SoftwareProductFilterSet
|
|
|
|
|
|
class SoftwareProductVersionViewSet(NetBoxModelViewSet):
|
|
queryset = SoftwareProductVersion.objects.all().order_by("id")
|
|
serializer_class = SoftwareProductVersionSerializer
|
|
filterset_class = SoftwareProductVersionFilterSet
|
|
|
|
|
|
class SoftwareProductInstallationViewSet(NetBoxModelViewSet):
|
|
queryset = SoftwareProductInstallation.objects.all().order_by("id")
|
|
serializer_class = SoftwareProductInstallationSerializer
|
|
filterset_class = SoftwareProductInstallationFilterSet
|
|
|
|
|
|
class SoftwareLicenseViewSet(NetBoxModelViewSet):
|
|
queryset = SoftwareLicense.objects.all().order_by("id")
|
|
serializer_class = SoftwareLicenseSerializer
|
|
filterset_class = SoftwareLicenseFilterSet
|
|
|
|
|
|
class CertificateViewSet(NetBoxModelViewSet):
|
|
queryset = Certificate.objects.all().order_by("id")
|
|
serializer_class = CertificateSerializer
|
|
filterset_class = CertificateFilterSet
|