elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.76k stars 8.17k forks source link

[ResponseOps][Rules][Meta] Add OAS support for Rules APIs #187356

Open cnasikas opened 3 months ago

cnasikas commented 3 months ago

The Core team added support for OAS in the Kibana routes. To provide users with an up-to-date OAS for the documented public Rules API we need to a) version the remaining HTTP routes b) move the parameters schema of all rule types in a package and c) register the OAS schema on each route. Below, for each category, all steps to achieve our goal are listed.

Related: https://github.com/elastic/kibana/issues/157883, https://github.com/elastic/kibana/issues/187572, https://github.com/elastic/kibana/issues/187574 Example PR that registers OAS schema: https://github.com/elastic/kibana/pull/181277

### Version HTTP routes
- [x] `POST /api/alerting/rule/{id}/_disable` https://github.com/elastic/kibana/issues/187572
- [x] `POST /api/alerting/rule/{id}/_enable` https://github.com/elastic/kibana/issues/187572
- [ ] `GET /api/alerting/rule_types`
- [ ] `POST /api/alerting/rule/{id}/_mute_all`
- [ ] `POST /api/alerting/rule/{id}/_unmute_all`
- [x] `POST /api/alerting/rule/{id}/_update_api_key` https://github.com/elastic/kibana/issues/187572
- [x] `POST /api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute` https://github.com/elastic/kibana/issues/187572
- [ ] `GET /api/alerting/_health`
### OAS schema registration (<https://github.com/elastic/kibana/issues/187574>)
- [x] `POST /api/alerting/rule/{id?}` https://github.com/elastic/kibana/issues/187574
- [x] `GET /api/alerting/rule/{id}` https://github.com/elastic/kibana/issues/187574
- [x] `DELETE /api/alerting/rule/{id}` https://github.com/elastic/kibana/issues/187574
- [x] `PUT /api/alerting/rule/{id}` https://github.com/elastic/kibana/issues/187574
- [x] `GET /api/alerting/rules/_find` https://github.com/elastic/kibana/issues/187574
- [x] `POST /api/alerting/rule/{id}/_disable` https://github.com/elastic/kibana/issues/187574
- [x] `POST /api/alerting/rule/{id}/_enable` https://github.com/elastic/kibana/issues/187574
- [ ] `GET /api/alerting/rule_types`
- [ ] `POST /api/alerting/rule/{id}/_mute_all`
- [ ] `POST /api/alerting/rule/{id}/_unmute_all`
- [x] `POST /api/alerting/rule/{id}/_update_api_key` https://github.com/elastic/kibana/issues/187574
- [x] `POST /api/alerting/rule/{rule_id}/alert/{alert_id}/_mute` https://github.com/elastic/kibana/issues/187574
- [x] `POST /api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute` https://github.com/elastic/kibana/issues/187574
- [ ] `GET /api/alerting/_health`
### Rule params.
- [ ] Create a package where are rule params will exist. The alerting plugin treats it as a blackbox.
- [ ] Enforce new rule types to define a schema in the new package.
- [ ] Move anomaly detection rule type params to the new package.
- [ ] Move anomaly detection jobs health params to the new package.
- [ ] Move APM anomaly rule type params to the new package.
- [ ] Move CCR read exceptions rule type params to the new package.
- [ ] Move cluster health rule type params to the new package.
- [ ] Move CPU usage rule type params to the new package.
- [ ] Move custom threshold rule type params to the new package.
- [ ] Move disk usage rule type params to the new package.
- [ ] Move ES query rule type params to the new package.
- [ ] Move ES version mismatch type params to the new package.
- [ ] Move error count threshold rule type params to the new package.
- [ ] Move failed transaction rate threshold rule type params to the new package.
- [ ] Move index threshold rule type params to the new package.
- [ ] Move inventory rule type params to the new package.
- [ ] Move Kibana version mismatch rule type params to the new package.
- [ ] Move latency threshold rule type params to the new package.
- [ ] Move license expiration threshold rule type params to the new package.
- [ ] Move log threshold rule type params to the new package.
- [ ] Move logstash version mismatch rule type params to the new package.
- [ ] Move memory usage (JVM) rule type params to the new package.
- [ ] Move metric threshold rule type params to the new package.
- [ ] Move missing monitoring data rule type params to the new package.
- [ ] Move nodes changed rule type params to the new package.
- [ ] Move shard size rule type params to the new package.
- [ ] Move SLO burn rate rule type params to the new package.
- [ ] Move synthetics monitoring status rule type params to the new package.
- [ ] Move synthetics TSL certificate rule type params to the new package.
- [ ] Move thread pool search rejections rule type params to the new package.
- [ ] Move thread pool write rejections rule type params to the new package.
- [ ] Move tracking containment rule type params to the new package.
- [ ] Move transform health rule type params to the new package.
- [ ] Move uptime duration anomaly rule type params to the new package.
- [ ] Move uptime monitor status rule type params to the new package.
- [ ] Move uptime TSL rule type params to the new package.
elasticmachine commented 3 months ago

Pinging @elastic/response-ops (Team:ResponseOps)

adcoelho commented 1 month ago

I added the GET /api/alerting/_health endpoint to the tasks.

jcger commented 1 month ago

I miss the tasks to update params param to use the definition created in the new package

cnasikas commented 1 month ago

Good point @jcger! I will update the issue accordingly.