diff --git a/src/sentry/api/urls.py b/src/sentry/api/urls.py index 2aad918c3f3a79..9bc34e4c8a598d 100644 --- a/src/sentry/api/urls.py +++ b/src/sentry/api/urls.py @@ -695,18 +695,26 @@ MonitorStatsEndpoint.as_view(), name="sentry-api-0-monitor-stats", ), + ] + ), + ), + # TODO: include in the /organizations/ route tree + remove old dupes once hybrid cloud launches + url( + r"^organizations/(?P[^\/]+)/monitors/", + include( + [ url( - r"^(?P[^\/]+)/(?P[^\/]+)/$", + r"^(?P[^\/]+)/$", MonitorDetailsEndpoint.as_view(), name="sentry-api-0-monitor-details-with-org", ), url( - r"^(?P[^\/]+)/(?P[^\/]+)/checkins/$", + r"^(?P[^\/]+)/checkins/$", MonitorCheckInsEndpoint.as_view(), name="sentry-api-0-monitor-check-in-index-with-org", ), url( - r"^(?P[^\/]+)/(?P[^\/]+)/stats/$", + r"^(?P[^\/]+)/stats/$", MonitorStatsEndpoint.as_view(), name="sentry-api-0-monitor-stats-with-org", ), diff --git a/tests/sentry/api/endpoints/test_monitor_checkins.py b/tests/sentry/api/endpoints/test_monitor_checkins.py index c0788141b00d16..6ecaabd8546545 100644 --- a/tests/sentry/api/endpoints/test_monitor_checkins.py +++ b/tests/sentry/api/endpoints/test_monitor_checkins.py @@ -156,7 +156,7 @@ def test_with_dsn_auth_invalid_project(self): def test_mismatched_org_slugs(self): monitor = self._create_monitor() - path = f"/api/0/monitors/asdf/{monitor.guid}/checkins/" + path = f"/api/0/organizations/asdf/monitors/{monitor.guid}/checkins/" self.login_as(user=self.user) resp = self.client.post(path) diff --git a/tests/sentry/api/endpoints/test_monitor_details.py b/tests/sentry/api/endpoints/test_monitor_details.py index ac67842741fab8..b99983b3ea7077 100644 --- a/tests/sentry/api/endpoints/test_monitor_details.py +++ b/tests/sentry/api/endpoints/test_monitor_details.py @@ -24,7 +24,7 @@ def test_simple(self): def test_mismatched_org_slugs(self): monitor = self._create_monitor() - path = f"/api/0/monitors/asdf/{monitor.guid}/" + path = f"/api/0/organizations/asdf/monitors/{monitor.guid}/" self.login_as(user=self.user) resp = self.client.get(path) @@ -230,7 +230,7 @@ def test_cronjob_interval_invalid_inteval(self): def test_mismatched_org_slugs(self): monitor = self._create_monitor() - path = f"/api/0/monitors/asdf/{monitor.guid}/" + path = f"/api/0/organizations/asdf/monitors/{monitor.guid}/" self.login_as(user=self.user) resp = self.client.put( @@ -267,7 +267,7 @@ def test_simple(self): def test_mismatched_org_slugs(self): monitor = self._create_monitor() - path = f"/api/0/monitors/asdf/{monitor.guid}/" + path = f"/api/0/organizations/asdf/monitors/{monitor.guid}/" self.login_as(user=self.user) resp = self.client.delete(path)