Skip to content

Commit

Permalink
Log warnings about deprecated endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Feb 8, 2022
1 parent 3bebd6b commit eb3c26a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/cases/server/routes/api/cases/get_case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export function initGetCaseApi({ router, logger, kibanaVersion }: RouteDeps) {
},
async (context, request, response) => {
try {
logger.warn(
`The query parameter 'includeComments' of the get case API '${CASE_DETAILS_URL}' is deprecated`
);

const casesClient = await context.cases.getCasesClient();
const id = request.params.case_id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function initGetAllCommentsApi({ router, logger, kibanaVersion }: RouteDe
},
async (context, request, response) => {
try {
logger.warn(`The get all cases comments API '${CASE_COMMENTS_URL}' is deprecated.`);
const client = await context.cases.getCasesClient();

return response.ok({
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/cases/server/routes/api/stats/get_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export function initGetCasesStatusApi({ router, logger, kibanaVersion }: RouteDe
},
async (context, request, response) => {
try {
logger.warn(`The get cases status API '${CASE_STATUS_URL}' is deprecated.`);

const client = await context.cases.getCasesClient();
return response.ok({
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export function initGetAllCaseUserActionsApi({ router, logger, kibanaVersion }:
return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' });
}

logger.warn(`The get all cases user actions API '${CASE_USER_ACTIONS_URL}' is deprecated.`);

const casesClient = await context.cases.getCasesClient();
const caseId = request.params.case_id;

Expand Down

0 comments on commit eb3c26a

Please sign in to comment.