Skip to content

Commit

Permalink
Merge pull request #33 from cpaillet/snmp
Browse files Browse the repository at this point in the history
fix(snmp): add paginator for API output
  • Loading branch information
kpetremann authored Jun 13, 2024
2 parents d5457f3 + acaa02d commit 3994754
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions netbox_cmdb/netbox_cmdb/api/snmp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SNMPViewSet(CustomNetBoxModelViewSet):
"device__name",
] + filtersets.device_location_filterset

def list(self, request):
queryset = SNMP.objects.all()
serializer = SNMPReadSerializer(queryset, many=True)
return Response(serializer.data)
def get_serializer_class(self):
if self.action == "list":
return SNMPReadSerializer
return SNMPSerializer

0 comments on commit 3994754

Please sign in to comment.