Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): query parameters to trigger events #1064

Merged

Conversation

AleksandrMatsko
Copy link
Member

@AleksandrMatsko AleksandrMatsko commented Jul 23, 2024

Add some query parameters to /api/event/{trigger_id}

Offered query parameters are:

  • from - start of time range
  • to - end of time range
  • metric - regular expression which will be used on NotificationEvent.Metric field
  • states - separated string of states, separator is ','

@AleksandrMatsko AleksandrMatsko marked this pull request as ready for review July 23, 2024 12:41
@AleksandrMatsko AleksandrMatsko requested a review from a team as a code owner July 23, 2024 12:41
api/handler/event.go Outdated Show resolved Hide resolved
api/handler/event.go Outdated Show resolved Hide resolved
api/handler/event.go Outdated Show resolved Hide resolved
api/handler/event.go Outdated Show resolved Hide resolved
api/handler/trigger.go Outdated Show resolved Hide resolved
api/handler/trigger.go Outdated Show resolved Hide resolved
state.go Outdated Show resolved Hide resolved
api/handler/trigger.go Outdated Show resolved Hide resolved
func TestMetricProviderMiddleware(t *testing.T) {
Convey("checking correctness of parameter", t, func() {
responseWriter := httptest.NewRecorder()
defaultMetric := ".*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у тебя вроде бы где-то была на такое публичная константа

Copy link
Member Author

@AleksandrMatsko AleksandrMatsko Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

она не публичная, в handler

api/handler/event.go Outdated Show resolved Hide resolved
api/handler/event.go Outdated Show resolved Hide resolved
@EduardZaydler
Copy link
Member

/build

almostinf
almostinf previously approved these changes Jul 30, 2024
@almostinf
Copy link
Member

/build

@almostinf almostinf merged commit 8560887 into moira-alert:master Aug 14, 2024
6 checks passed
Copy link

Build and push Docker images with tag: 2024-08-14.8560887

1 similar comment
Copy link

Build and push Docker images with tag: 2024-08-14.8560887

almostinf added a commit that referenced this pull request Aug 14, 2024
almostinf added a commit that referenced this pull request Aug 14, 2024
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.

5 participants