events: fix schema for top_per_user

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-14 21:08:15 +01:00
parent 77d6242cce
commit 64a10e9a46
2 changed files with 36 additions and 46 deletions

View file

@ -110,7 +110,15 @@ class EventViewSet(ModelViewSet):
@extend_schema( @extend_schema(
methods=["GET"], methods=["GET"],
responses={200: EventTopPerUserSerializer(many=True)}, responses={200: EventTopPerUserSerializer(many=True)},
filters=[],
parameters=[ parameters=[
OpenApiParameter(
"action",
type=OpenApiTypes.STR,
location=OpenApiParameter.QUERY,
enum=[action for action in EventAction],
required=False,
),
OpenApiParameter( OpenApiParameter(
"top_n", "top_n",
type=OpenApiTypes.INT, type=OpenApiTypes.INT,

View file

@ -3918,56 +3918,38 @@ paths:
name: action name: action
schema: schema:
type: string type: string
- in: query enum:
name: client_ip - authorize_application
schema: - configuration_error
type: string - custom_
- in: query - email_sent
name: context_authorized_app - flow_execution
schema: - impersonation_ended
type: string - impersonation_started
description: Context Authorized application - invitation_used
- in: query - login
name: context_model_app - login_failed
schema: - logout
type: string - model_created
description: Context Model App - model_deleted
- in: query - model_updated
name: context_model_name - password_set
schema: - policy_exception
type: string - policy_execution
description: Context Model Name - property_mapping_exception
- in: query - secret_rotate
name: context_model_pk - secret_view
schema: - source_linked
type: string - suspicious_request
description: Context Model Primary Key - system_exception
- name: ordering - system_task_exception
required: false - system_task_execution
in: query - update_available
description: Which field to use when ordering the results. - user_write
schema:
type: string
- name: search
required: false
in: query
description: A search term.
schema:
type: string
- in: query
name: tenant_name
schema:
type: string
description: Tenant name
- in: query - in: query
name: top_n name: top_n
schema: schema:
type: integer type: integer
- in: query
name: username
schema:
type: string
description: Username
tags: tags:
- events - events
security: security: