diff options
Diffstat (limited to 'pydis_site/apps/api')
| -rw-r--r-- | pydis_site/apps/api/viewsets.py | 28 | 
1 files changed, 27 insertions, 1 deletions
diff --git a/pydis_site/apps/api/viewsets.py b/pydis_site/apps/api/viewsets.py index b97f19b6..47915256 100644 --- a/pydis_site/apps/api/viewsets.py +++ b/pydis_site/apps/api/viewsets.py @@ -282,7 +282,33 @@ class InfractionViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge  class LogEntryViewSet(CreateModelMixin, GenericViewSet): -    # TODO: doc me foobar baz boom bang crow caw caw caw +    """ +    View providing support for creating log entries in the site database +    for viewing via the log browser. + +    ## Routes +    ### POST /logs +    Create a new log entry. + +    #### Request body +    >>> { +    ...     'application': str,  # 'bot' | 'seasonalbot' | 'site' +    ...     'logger_name': str,  # such as 'bot.cogs.moderation' +    ...     'timestamp': Optional[str],  # from `datetime.utcnow().isoformat()` +    ...     'level': str,  # 'debug' | 'info' | 'warning' | 'error' | 'critical' +    ...     'module': str,  # such as 'pydis_site.apps.api.serializers' +    ...     'line': int,  # > 0 +    ...     'message': str,  # textual formatted content of the logline +    ... } + +    #### Status codes +    - 201: returned on success +    - 400: if the request body has invalid fields, see the response for details + +    ## Authentication +    Requires a API token. +    """ +      queryset = LogEntry.objects.all()      serializer_class = LogEntrySerializer  |