Frun1na opened a new pull request, #4765:
URL: https://github.com/apache/rocketmq-dashboard/pull/4765

   ### Which Issue(s) This PR Fixes
   
   ### Brief Description
   
   The endpoint list in §APIs of `docs/studio-native-alerting-design.md` was 
written before the
   implementation landed and never updated — six of its eight lines describe 
calls that do not exist:
   
   | document | implementation |
   |---|---|
   | `GET/POST/PUT /api/business-alert-rules`, `GET/POST/PUT 
/api/cluster-alert-rules` | no `PUT` mapping exists; listing is `GET .../page`, 
and writes are `POST .../create` and `POST .../update` (`AlertRuleController`, 
`ClusterAlertRuleController`) |
   | `POST /api/business-alert-rules/{id}/test`, 
`.../cluster-alert-rules/{id}/test` | `POST .../test` takes the full rule body 
— there is no `{id}` path variable |
   | `GET /api/system-alerts?domain=&status=&severity=&instanceId=&page=` | the 
parameters are `level`, `domain`, `instanceId`, `transition` 
(`SystemAlertController.listAlerts`); there is no `status`/`severity`, and 
pagination lives at `GET /api/system-alerts/page` — the documented parameters 
are optional `@RequestParam`s, so they would be silently ignored |
   | `POST /api/system-alerts/{id}/acknowledge` | `POST 
/api/system-alerts/acknowledge` with the id in the body 
(`AcknowledgeSystemAlertDTO`) |
   | `GET /api/alert-metric-catalog?instanceId=&domain=` | `GET 
/api/native-alert-metrics?instanceId=&domain=` 
(`NativeAlertMetricCatalogController`) |
   | "Both delegate to the same `AlertRuleService`" | the class is 
`AlertService`; no `AlertRuleService` exists anywhere in the tree |
   
   `/api/alert-silences` and `/api/alert-collector-status` were checked and are 
correct as written.
   
   A client integrating against this list would hit 404s or silently 
ineffective filters on every rule
   and system-alert call.
   
   ### How Did You Test This Change?
   
   Documentation only, so the Maven and Vitest suites were not re-run. Every 
line was read off the
   controllers:
   
   ```
   $ grep -n "RequestMapping\|Mapping(" .../ops/alert/AlertRuleController.java
       @RequestMapping({"/api/alert-rules", "/api/business-alert-rules"})
       @GetMapping("/page")  @PostMapping("/create")  @PostMapping("/update")  
@PostMapping("/test")
       (no @PutMapping anywhere in the two rule controllers)
   
   $ sed -n '43,52p' .../ops/alert/SystemAlertController.java
       public Result<List<SystemAlertVO>> listAlerts(
               @RequestParam(required = false) String level,
               @RequestParam(required = false) AlertDomain domain,
               @RequestParam(required = false) String instanceId,
               @RequestParam(required = false) String transition)
   
   $ grep -n "RequestMapping" 
.../ops/alert/NativeAlertMetricCatalogController.java
       @RequestMapping("/api/native-alert-metrics")
   
   $ ls .../ops/alert/ | grep Service
       AlertService.java  AlertSilenceService.java  ...   (no AlertRuleService)
   ```
   
   `/api/alert-silences` (`AlertSilenceController`) and 
`/api/alert-collector-status`
   (`cluster/metrics/CollectorStatusController`) were verified to exist as 
documented.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`docs:`)
   - [ ] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to