Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [ResponseOps][Rules] Add OAS schema for handled 4xx errors on rule apis (#192616) #193454

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Delete a rule",
Expand Down Expand Up @@ -2399,6 +2408,15 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Get rule details",
Expand Down Expand Up @@ -3586,6 +3604,15 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"409": {
"description": "Indicates that the rule id is already in use."
}
},
"summary": "Create a rule",
Expand Down Expand Up @@ -4756,6 +4783,18 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
},
"409": {
"description": "Indicates that the rule has already been updated by another user."
}
},
"summary": "Update a rule",
Expand Down Expand Up @@ -4821,6 +4860,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Disable a rule",
Expand Down Expand Up @@ -4868,6 +4916,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Enable a rule",
Expand Down Expand Up @@ -5009,6 +5066,18 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
},
"409": {
"description": "Indicates that the rule has already been updated by another user."
}
},
"summary": "Update the API key for a rule",
Expand Down Expand Up @@ -5065,6 +5134,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule or alert with the given ID does not exist."
}
},
"summary": "Mute an alert",
Expand Down Expand Up @@ -5121,6 +5199,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule or alert with the given ID does not exist."
}
},
"summary": "Unmute an alert",
Expand Down Expand Up @@ -6162,6 +6249,12 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
}
},
"summary": "Get information about rules",
Expand Down
93 changes: 93 additions & 0 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Delete a rule",
Expand Down Expand Up @@ -2399,6 +2408,15 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Get rule details",
Expand Down Expand Up @@ -3586,6 +3604,15 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"409": {
"description": "Indicates that the rule id is already in use."
}
},
"summary": "Create a rule",
Expand Down Expand Up @@ -4756,6 +4783,18 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
},
"409": {
"description": "Indicates that the rule has already been updated by another user."
}
},
"summary": "Update a rule",
Expand Down Expand Up @@ -4821,6 +4860,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Disable a rule",
Expand Down Expand Up @@ -4868,6 +4916,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
}
},
"summary": "Enable a rule",
Expand Down Expand Up @@ -5009,6 +5066,18 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule with the given ID does not exist."
},
"409": {
"description": "Indicates that the rule has already been updated by another user."
}
},
"summary": "Update the API key for a rule",
Expand Down Expand Up @@ -5065,6 +5134,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule or alert with the given ID does not exist."
}
},
"summary": "Mute an alert",
Expand Down Expand Up @@ -5121,6 +5199,15 @@
"responses": {
"204": {
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
},
"404": {
"description": "Indicates a rule or alert with the given ID does not exist."
}
},
"summary": "Unmute an alert",
Expand Down Expand Up @@ -6162,6 +6249,12 @@
}
},
"description": "Indicates a successful call."
},
"400": {
"description": "Indicates an invalid schema or parameters."
},
"403": {
"description": "Indicates that this call is forbidden."
}
},
"summary": "Get information about rules",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
*/

import { IRouter } from '@kbn/core/server';
import { verifyAccessAndContext, handleDisabledApiKeysError } from '../../../lib';
import { ILicenseState, RuleTypeDisabledError } from '../../../../lib';
import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types';
import { handleDisabledApiKeysError, verifyAccessAndContext } from '../../../lib';

import {
bulkDisableRulesRequestBodySchemaV1,
BulkDisableRulesRequestBodyV1,
BulkDisableRulesResponseV1,
} from '../../../../../common/routes/rule/apis/bulk_disable';
import type { RuleParamsV1 } from '../../../../../common/routes/rule/response';
import { transformRuleToRuleResponseV1 } from '../../transforms';
import { Rule } from '../../../../application/rule/types';
import { transformRuleToRuleResponseV1 } from '../../transforms';

export const bulkDisableRulesRoute = ({
router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
import { IRouter } from '@kbn/core/server';

import { ILicenseState, RuleTypeDisabledError } from '../../../../lib';
import { verifyAccessAndContext, handleDisabledApiKeysError } from '../../../lib';
import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../../../../types';
import { handleDisabledApiKeysError, verifyAccessAndContext } from '../../../lib';

import {
bulkEditRulesRequestBodySchemaV1,
BulkEditRulesRequestBodyV1,
BulkEditRulesResponseV1,
} from '../../../../../common/routes/rule/apis/bulk_edit';
import { Rule } from '../../../../application/rule/types';
import type { RuleParamsV1 } from '../../../../../common/routes/rule/response';
import { Rule } from '../../../../application/rule/types';

import { transformRuleToRuleResponseV1 } from '../../transforms';
import { transformOperationsV1 } from './transforms';
import { validateRequiredGroupInDefaultActionsV1 } from '../../validation';
import { transformOperationsV1 } from './transforms';

interface BuildBulkEditRulesRouteParams {
licenseState: ILicenseState;
Expand Down
Loading