Skip to content

feat: Add /eventResources and report resource counts in the EventTrigger details - #195

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:event-matching-resources
Oct 17, 2026
Merged

gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:event-matching-resources

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

An EventTrigger can match hundreds of resources per cluster. /event returned all of them for every matching cluster in a single response, which made the payload large and the dashboard page slow. This change returns only the number of matching resources per cluster, and adds a paginated endpoint to list them on demand.

Changes

  • /event: each entry in clusterEventMatches now has matchingResourcesCount instead of the resources array. This is a breaking change to the response. The dashboard is the only consumer: mcp-server reads EventReports directly.
  • New GET /eventResources?event_name=&namespace=&name=&type=<capi|sveltos>:
    • Returns totalResources and one page of resources, ordered by group, kind, namespace and name.
    • Supports limit and skip.
    • Supports filters resource_kind, resource_namespace and resource_name, as a case-insensitive substring match. totalResources is counted after filtering and before pagination.
    • The user needs permission to get both the EventTrigger and the cluster. The response is 400 for a bad request, 404 for an unknown EventTrigger and 401 without permission. A cluster with no EventReport returns an empty list.
  • README updated for both endpoints.

…ger details

An EventTrigger can match hundreds of resources per cluster. /event returned all of them for every
matching cluster in a single response, which made the payload large and the dashboard page slow.
This change returns only the number of matching resources per cluster, and adds a paginated endpoint
to list them on demand.

Changes
- /event: each entry in clusterEventMatches now has matchingResourcesCount instead of the resources array.
This is a breaking change to the response. The dashboard is the only consumer: mcp-server reads EventReports directly.
- New GET /eventResources?event_name=<eventTrigger>&namespace=<cluster-namespace>&name=<cluster-name>&type=<capi|sveltos>:
  - Returns totalResources and one page of resources, ordered by group, kind, namespace and name.
  - Supports limit and skip.
  - Supports filters resource_kind, resource_namespace and resource_name, as a case-insensitive substring match. totalResources is
counted after filtering and before pagination.
  - The user needs permission to get both the EventTrigger and the cluster. The response is 400 for a bad request, 404 for an unknown EventTrigger
and 401 without permission. A cluster with no EventReport returns an empty list.
- README updated for both endpoints.
@gianlucam76
gianlucam76 merged commit ee7ec85 into projectsveltos:main Oct 17, 2026
5 checks passed
@gianlucam76
gianlucam76 deleted the event-matching-resources branch October 17, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant