api.v1.views.DaemonViewSet module

Module with the DaemonViewSet viewset.

class api.v1.views.DaemonViewSet.DaemonViewSet(**kwargs)[source]

Bases: ModelViewSet

Viewset for the core.models.Daemon.

Provides all CRUD actions.

Note

To update instances the user must specify format “json” with the request.

BASENAME = 'daemon'
serializer_class

alias of BaseDaemonSerializer

filter_backends = [<class 'django_filters.rest_framework.backends.DjangoFilterBackend'>, <class 'rest_framework.filters.OrderingFilter'>]
filterset_class

alias of DaemonFilterSet

permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
ordering_fields: Final[list[str]] = ['fetching_criterion', 'interval__every', 'interval__period', 'celery_task__last_run_at', 'celery_task__total_run_count', 'is_healthy', 'mailbox__name', 'mailbox__account__mail_address', 'mailbox__account__mail_host', 'mailbox__account__protocol', 'created', 'updated']
ordering: Final[list[str]] = ['id']
get_queryset()[source]

Filters the data for entries connected to the request user.

Return type:

QuerySet

Returns:

The daemon entries matching the request user.

URL_PATH_TEST = 'test'
URL_NAME_TEST = 'test'
test(request, pk=None)[source]

Action method testing the daemon data of the mailbox.

Parameters:
  • request (Request) – The request triggering the action.

  • pk (int | None) – The private key of the daemon. Defaults to None.

Return type:

Response

Returns:

A response detailing the test result for the daemon.

URL_PATH_START = 'start'
URL_NAME_START = 'start'
start(request, pk=None)[source]

Action method starting the daemon for the mailbox.

Parameters:
  • request (Request) – The request triggering the action.

  • pk (int | None) – The private key of the daemon. Defaults to None.

Return type:

Response

Returns:

A response detailing the start result of the daemon.

URL_PATH_STOP = 'stop'
URL_NAME_STOP = 'stop'
stop(request, pk=None)[source]

Action method stopping the daemon data of the mailbox.

Parameters:
  • request (Request) – The request triggering the action.

  • pk (int | None) – The private key of the daemon. Defaults to None.

Return type:

Response

Returns:

A response detailing the stop result for the daemon.

basename = None
create(request, *args, **kwargs)
description = None
destroy(request, *args, **kwargs)
detail = None
list(request, *args, **kwargs)
name = None
retrieve(request, *args, **kwargs)
suffix = None
update(request, *args, **kwargs)