[OAS] Add mute_all and unmute_all response codes (#190265)

Co-authored-by: Antonio <antoniodcoelho@gmail.com>
Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
This commit is contained in:
Lisa Cawley 2024-08-12 08:57:59 -07:00 committed by GitHub
parent 17ee494f04
commit 945784b465
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 5 deletions

View file

@ -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.',
},
})
),

View file

@ -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 = (
@ -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(

View file

@ -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 = (
@ -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(