From eb3c26a45e8abda691fe20acee023731f6c0d8b8 Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Tue, 8 Feb 2022 18:58:37 +0200 Subject: [PATCH] Log warnings about deprecated endpoints --- x-pack/plugins/cases/server/routes/api/cases/get_case.ts | 4 ++++ .../cases/server/routes/api/comments/get_all_comment.ts | 1 + x-pack/plugins/cases/server/routes/api/stats/get_status.ts | 2 ++ .../server/routes/api/user_actions/get_all_user_actions.ts | 2 ++ 4 files changed, 9 insertions(+) diff --git a/x-pack/plugins/cases/server/routes/api/cases/get_case.ts b/x-pack/plugins/cases/server/routes/api/cases/get_case.ts index 5e45b30f626f7..4f121a66b29f7 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/get_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/get_case.ts @@ -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; diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts index 9b311013ca2fa..7b739005fcd2f 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts @@ -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({ diff --git a/x-pack/plugins/cases/server/routes/api/stats/get_status.ts b/x-pack/plugins/cases/server/routes/api/stats/get_status.ts index 4be7bf6472da1..bf5f9206ab28b 100644 --- a/x-pack/plugins/cases/server/routes/api/stats/get_status.ts +++ b/x-pack/plugins/cases/server/routes/api/stats/get_status.ts @@ -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: { diff --git a/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts b/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts index 113596e560ab1..bde1c818e0547 100644 --- a/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts +++ b/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts @@ -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;