Skip to content

Commit

Permalink
[OAS] Add mute_all and unmute_all response codes (elastic#190265)
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio <antoniodcoelho@gmail.com>
Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent 17ee494 commit 945784b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const createParamsSchema = schema.object({
id: schema.maybe(
schema.string({
meta: {
description: 'The identifier for the rule.',
description: 'The identifier for the rule. If it is omitted, an ID is randomly generated.',
},
})
),
Expand Down
15 changes: 13 additions & 2 deletions x-pack/plugins/alerting/server/routes/mute_all_rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../types'
import { trackDeprecatedRouteUsage } from '../lib/track_deprecated_route_usage';

const paramSchema = schema.object({
id: schema.string(),
id: schema.string({
meta: {
description: 'The identifier for the rule.',
},
}),
});

export const muteAllRuleRoute = (
Expand All @@ -31,7 +35,14 @@ export const muteAllRuleRoute = (
tags: ['oas-tag:alerting'],
},
validate: {
params: paramSchema,
request: {
params: paramSchema,
},
response: {
204: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(
Expand Down
15 changes: 13 additions & 2 deletions x-pack/plugins/alerting/server/routes/unmute_all_rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import { verifyAccessAndContext } from './lib';
import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../types';

const paramSchema = schema.object({
id: schema.string(),
id: schema.string({
meta: {
description: 'The identifier for the rule.',
},
}),
});

export const unmuteAllRuleRoute = (
Expand All @@ -28,7 +32,14 @@ export const unmuteAllRuleRoute = (
tags: ['oas-tag:alerting'],
},
validate: {
params: paramSchema,
request: {
params: paramSchema,
},
response: {
204: {
description: 'Indicates a successful call.',
},
},
},
},
router.handleLegacyErrors(
Expand Down

0 comments on commit 945784b

Please sign in to comment.