management.views.loggingΒΆ

Logging setting specific views.

Module ContentsΒΆ

class management.views.logging.IndexView(**kwargs)[source]ΒΆ

Bases: django.views.generic.base.RedirectView

Index view.

permanent = True[source]ΒΆ
pattern_name = 'management:language'[source]ΒΆ
management.views.logging.language(request)[source]ΒΆ

Handle language Configuration.

Returns: HTTPResponse

Parameters:

request (django.http.HttpRequest)

Return type:

django.http.HttpResponse

class management.views.logging.LoggingFilesTableView(**kwargs)[source]ΒΆ

Bases: trustpoint.page_context.PageContextMixin, trustpoint.logger.LoggerMixin, trustpoint.views.base.SortableTableFromListMixin, django.views.generic.list.ListView

View to display all log files in the log directory in a table.

http_method_names = ('get',)[source]ΒΆ
template_name = 'management/logging/logging_files.html'[source]ΒΆ
context_object_name = 'log_files'[source]ΒΆ
default_sort_param = 'updated_at'[source]ΒΆ
paginate_by = None[source]ΒΆ
page_category = 'management'[source]ΒΆ
page_name = 'logging'[source]ΒΆ
get_queryset()[source]ΒΆ

Gets a queryset of all valid Trustpoint log files in the log directory.

Return type:

list[dict[str, str]]

class management.views.logging.LoggingFilesDetailsView(**kwargs)[source]ΒΆ

Bases: trustpoint.page_context.PageContextMixin, trustpoint.logger.LoggerMixin, django.views.generic.TemplateView

Log file detail view, allows to view the content of a single log file without download.

http_method_names = ('get',)[source]ΒΆ
template_name = 'management/logging/logging_files_details.html'[source]ΒΆ
log_directory[source]ΒΆ
page_category = 'settings'[source]ΒΆ
page_name = 'logging'[source]ΒΆ
get_context_data(**kwargs)[source]ΒΆ

Get the context data for the view.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

class management.views.logging.LoggingFilesDownloadView(**kwargs)[source]ΒΆ

Bases: trustpoint.page_context.PageContextMixin, trustpoint.logger.LoggerMixin, django.views.generic.TemplateView

View to download a single log file.

http_method_names = ('get',)[source]ΒΆ
page_category = 'settings'[source]ΒΆ
page_name = 'logging'[source]ΒΆ
get(*_args, **kwargs)[source]ΒΆ

The HTTP GET method for the view.

Parameters:
  • _args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

class management.views.logging.LoggingFilesDownloadMultipleView(**kwargs)[source]ΒΆ

Bases: trustpoint.page_context.PageContextMixin, trustpoint.logger.LoggerMixin, django.views.generic.View

View to download multiple log files as a single archive.

http_method_names = ('get',)[source]ΒΆ
page_category = 'settings'[source]ΒΆ
page_name = 'logging'[source]ΒΆ
classmethod get(*_args, **kwargs)[source]ΒΆ

The HTTP GET method for the view.

Parameters:
  • _args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

class management.views.logging.LoggingViewSet(**kwargs)[source]ΒΆ

Bases: rest_framework.viewsets.GenericViewSet[Any]

ViewSet for managing Backup instances.

Supports standard CRUD operations such as list, retrieve, create, update, and delete.

serializer_class[source]ΒΆ
filter_backends = ()[source]ΒΆ
list_files(_request)[source]ΒΆ

Retrieve detailed info for all log files.

Parameters:

_request (rest_framework.request.Request)

Return type:

rest_framework.response.Response

download(_request, file_name)[source]ΒΆ

Download a log file by name.

/logs/download/trustpoint.log/

Parameters:
  • _request (rest_framework.request.Request)

  • file_name (str)

Return type:

django.http.FileResponse | rest_framework.response.Response

delete(_request, file_name)[source]ΒΆ

Delete a log file by name.

DELETE /logs/delete/trustpoint.log/

Parameters:
  • _request (rest_framework.request.Request)

  • file_name (str)

Return type:

rest_framework.response.Response