mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 16:10:43 +00:00
fix: v2 alert APIs (#5563)
Try to match on the v2 alert endpoints in the router **before** the v1
endpoints.
If we try to match on the v1 endpoints first then a call to a v2
endpoint such as
`GET: /api/v2/my-org/alerts`
will actually match with the v1 endpoint
`GET: /api/{org_id}/alerts`
where `v2` will be bound to `{org_id}`.
If we swap the matching order then requests to v2 endpoints will be
correctly routed to v2 endpoints and requests to v1 endpoints will be
correctly routed to v1 endpoints.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Refactor**
- Reorganized alert-related service routes in the application
- Removed and re-added existing alert service routes without changing
their core functionality
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -433,6 +433,13 @@ pub fn get_service_routes(cfg: &mut web::ServiceConfig) {
|
||||
.service(folders::deprecated::update_folder)
|
||||
.service(folders::deprecated::get_folder)
|
||||
.service(folders::deprecated::delete_folder)
|
||||
.service(alerts::create_alert)
|
||||
.service(alerts::get_alert)
|
||||
.service(alerts::update_alert)
|
||||
.service(alerts::delete_alert)
|
||||
.service(alerts::list_alerts)
|
||||
.service(alerts::enable_alert)
|
||||
.service(alerts::trigger_alert)
|
||||
.service(alerts::deprecated::save_alert)
|
||||
.service(alerts::deprecated::update_alert)
|
||||
.service(alerts::deprecated::get_alert)
|
||||
@@ -441,13 +448,6 @@ pub fn get_service_routes(cfg: &mut web::ServiceConfig) {
|
||||
.service(alerts::deprecated::delete_alert)
|
||||
.service(alerts::deprecated::enable_alert)
|
||||
.service(alerts::deprecated::trigger_alert)
|
||||
.service(alerts::create_alert)
|
||||
.service(alerts::get_alert)
|
||||
.service(alerts::update_alert)
|
||||
.service(alerts::delete_alert)
|
||||
.service(alerts::list_alerts)
|
||||
.service(alerts::enable_alert)
|
||||
.service(alerts::trigger_alert)
|
||||
.service(alerts::templates::save_template)
|
||||
.service(alerts::templates::update_template)
|
||||
.service(alerts::templates::get_template)
|
||||
|
||||
Reference in New Issue
Block a user