Skip to content

Commit

Permalink
update response with description
Browse files Browse the repository at this point in the history
  • Loading branch information
js-jankisalvi committed Jul 23, 2024
1 parent 81196f6 commit 6cf0ed7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
19 changes: 13 additions & 6 deletions x-pack/plugins/alerting/common/routes/rule/response/schemas/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,19 @@ export const monitoringSchema = schema.object(
}),
{ meta: { description: 'History of the rule run.' } }
),
calculated_metrics: schema.object({
p50: schema.maybe(schema.number()),
p95: schema.maybe(schema.number()),
p99: schema.maybe(schema.number()),
success_ratio: schema.number(),
}),
calculated_metrics: schema.object(
{
p50: schema.maybe(schema.number()),
p95: schema.maybe(schema.number()),
p99: schema.maybe(schema.number()),
success_ratio: schema.number(),
},
{
meta: {
description: 'Calculation of different percentiles and success ratio.',
},
}
),
last_run: schema.object({
timestamp: schema.string({
meta: { description: 'Time when the rule was run last.' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const createRuleRoute = ({ router, licenseState, usageCounter }: RouteOpt
response: {
200: {
body: () => ruleResponseSchemaV1,
description: 'Indicates a successful call.',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export const deleteRuleRoute = (
request: {
params: deleteRuleRequestParamsSchemaV1,
},
response: {
204: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const buildFindRulesRoute = ({
response: {
200: {
body: () => ruleResponseSchemaV1,
description: 'Indicates a successful call.',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const buildGetRuleRoute = ({
response: {
200: {
body: () => ruleResponseSchemaV1,
description: 'Indicates a successful call.',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export const muteAlertRoute = (
request: {
params: muteAlertParamsSchemaV1,
},
response: {
204: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const updateRuleRoute = (
response: {
200: {
body: () => ruleResponseSchemaV1,
description: 'Indicates a successful call.',
},
},
},
Expand Down

0 comments on commit 6cf0ed7

Please sign in to comment.