[ResponseOps][Rules] OAS schema registration for Rule APIs#188445
[ResponseOps][Rules] OAS schema registration for Rule APIs#188445js-jankisalvi merged 12 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
| }), | ||
| { meta: { description: 'History of the rule run.' } } | ||
| ), | ||
| calculated_metrics: schema.object({ |
There was a problem hiding this comment.
Couldn't find any docs, comments or example which could help explain this metrics. Would be great if someone can suggest description for calculated_metrics object.
There was a problem hiding this comment.
How about "Calculation of different percentiles and success ratio"?
cnasikas
left a comment
There was a problem hiding this comment.
Tested and it is working as expected!
x-pack/plugins/alerting/server/routes/rule/apis/create/create_rule_route.ts
Outdated
Show resolved
Hide resolved
💚 Build Succeeded
Metrics [docs]
History
|
| validate: { | ||
| params: muteAlertParamsSchemaV1, | ||
| request: { | ||
| params: muteAlertParamsSchemaV1, |
There was a problem hiding this comment.
Should we specify the 403 here? Since we have the RuleTypeDisabledError in 42, which sends out a custom error body. If so we should version that schema well
| }, | ||
| response: { | ||
| 200: { | ||
| body: () => ruleResponseSchemaV1, |
There was a problem hiding this comment.
Same here this can also 403
lcawl
left a comment
There was a problem hiding this comment.
Awesome! Added some feedback on the strings but otherwise LGTM!
x-pack/plugins/alerting/common/routes/alerts_filter_query/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/r_rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/r_rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/r_rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/r_rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/server/routes/rule/apis/find/find_rules_route.ts
Outdated
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Issue: #187574
This PR updates
requestandresponseschemas below for rule APIs to generate OAS documentation:POST /api/alerting/rule/{id?}GET /api/alerting/rule/{id}DELETE /api/alerting/rule/{id}PUT /api/alerting/rule/{id}GET /api/alerting/rules/_findPOST /api/alerting/rule/{rule_id}/alert/{alert_id}/_muteHow to test
server.oas.enabled: truetokibana.dev.ymlyarn start --no-base-pathcurl -s -uelastic:changeme http://localhost:5601/api/oas\?pathStartsWith\=/api/alerting/rule/ | jqcurl -s -uelastic:changeme http://localhost:5601/api/oas\?pathStartsWith\=/api/alerting/rules/ | jq