jumpserver/apps/assets/api/gathered_user.py

21 lines
587 B
Python
Raw Normal View History

2019-09-18 14:06:46 +00:00
# -*- coding: utf-8 -*-
#
from orgs.mixins.api import OrgModelViewSet
from assets.models import GatheredUser
from ..serializers import GatheredUserSerializer
from ..filters import AssetRelatedByNodeFilterBackend
2019-09-18 14:06:46 +00:00
__all__ = ['GatheredUserViewSet']
class GatheredUserViewSet(OrgModelViewSet):
model = GatheredUser
2019-09-18 14:06:46 +00:00
serializer_class = GatheredUserSerializer
extra_filter_backends = [AssetRelatedByNodeFilterBackend]
2019-09-18 14:06:46 +00:00
2022-08-19 10:49:00 +00:00
filterset_fields = ['asset', 'username', 'present', 'asset__ip', 'asset__name', 'asset_id']
search_fields = ['username', 'asset__ip', 'asset__name']