diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index fd4d9663b001b..a0856a9d8de8d 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -22348,7 +22348,6 @@ "xpack.idxMgmt.indexActionsMenu.showIndexOverviewLabel": "Afficher l'aperçu des index", "xpack.idxMgmt.indexActionsMenu.showIndexSettingsLabel": "Afficher les paramètres des index", "xpack.idxMgmt.indexActionsMenu.showIndexStatsLabel": "Afficher les statistiques des index", - "xpack.idxMgmt.indexActionsMenu.unfreezeIndexLabel": "Dégeler {selectedIndexCount, plural, one {l'index} other {les index} }", "xpack.idxMgmt.indexDetails.backToIndicesButtonLabel": "Retour aux index", "xpack.idxMgmt.indexDetails.errorDescription": "Une erreur s'est produite lors du chargement des données pour l'index {indexName}. Assurez-vous que le nom de l'index dans l'URL est correct, puis réessayez.", "xpack.idxMgmt.indexDetails.errorTitle": "Impossible de charger les détails d'index", @@ -23248,8 +23247,6 @@ "xpack.idxMgmt.templateValidation.templateNameRequiredError": "Nom de modèle obligatoire.", "xpack.idxMgmt.templateValidation.templateNameSpacesError": "Les espaces ne sont pas autorisés dans un nom de modèle.", "xpack.idxMgmt.templateValidation.templateNameUnderscoreError": "Un nom de modèle ne doit pas commencer par un trait de soulignement.", - "xpack.idxMgmt.unfreezeIndicesAction.indexUnfrozenMessage": "L'index {indexNames} a été débloqué.", - "xpack.idxMgmt.unfreezeIndicesAction.successfullyUnfrozeIndicesMessage": "Déverrouillage terminé : [{indexNames}]", "xpack.idxMgmt.validators.string.invalidJSONError": "Format JSON non valide.", "xpack.indexLifecycleMgmt.addLifecyclePolicyActionButtonLabel": "Ajouter une stratégie de cycle de vie", "xpack.indexLifecycleMgmt.appTitle": "Stratégies de cycle de vie des index", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index b164ffdd835c7..08a6b2022e08f 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -22206,7 +22206,6 @@ "xpack.idxMgmt.indexActionsMenu.showIndexOverviewLabel": "インデックス概要を表示", "xpack.idxMgmt.indexActionsMenu.showIndexSettingsLabel": "インデックス設定を表示", "xpack.idxMgmt.indexActionsMenu.showIndexStatsLabel": "インデックス統計を表示", - "xpack.idxMgmt.indexActionsMenu.unfreezeIndexLabel": "{selectedIndexCount, plural, other {個のインデックス} }の凍結を解除", "xpack.idxMgmt.indexDetails.backToIndicesButtonLabel": "インデックスに戻る", "xpack.idxMgmt.indexDetails.errorDescription": "インデックス{indexName}のデータを読み込む際にエラーが発生しました。URLのインデックス名が正しいことを確認し、もう一度試してください。", "xpack.idxMgmt.indexDetails.errorTitle": "インデックス詳細を読み込めません", @@ -23107,8 +23106,6 @@ "xpack.idxMgmt.templateValidation.templateNameRequiredError": "テンプレート名が必要です。", "xpack.idxMgmt.templateValidation.templateNameSpacesError": "テンプレート名にスペースは使用できません。", "xpack.idxMgmt.templateValidation.templateNameUnderscoreError": "テンプレート名はアンダーラインで始めることはできません。", - "xpack.idxMgmt.unfreezeIndicesAction.indexUnfrozenMessage": "インデックス{indexNames}が凍結解除されました。", - "xpack.idxMgmt.unfreezeIndicesAction.successfullyUnfrozeIndicesMessage": "[{indexNames}] の凍結が解除されました", "xpack.idxMgmt.validators.string.invalidJSONError": "無効な JSON フォーマット。", "xpack.indexLifecycleMgmt.addLifecyclePolicyActionButtonLabel": "ライフサイクルポリシーを追加", "xpack.indexLifecycleMgmt.appTitle": "インデックスライフサイクルポリシー", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index fb7f4917583a6..1f522395a38b2 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -21851,7 +21851,6 @@ "xpack.idxMgmt.indexActionsMenu.showIndexOverviewLabel": "显示索引概览", "xpack.idxMgmt.indexActionsMenu.showIndexSettingsLabel": "显示索引设置", "xpack.idxMgmt.indexActionsMenu.showIndexStatsLabel": "显示索引统计信息", - "xpack.idxMgmt.indexActionsMenu.unfreezeIndexLabel": "取消冻结{selectedIndexCount, plural, other {索引} }", "xpack.idxMgmt.indexDetails.backToIndicesButtonLabel": "返回到索引", "xpack.idxMgmt.indexDetails.errorDescription": "加载索引 {indexName} 的数据时出现错误。请确保 URL 中的索引名称正确,然后重试。", "xpack.idxMgmt.indexDetails.errorTitle": "无法加载索引详情", @@ -22744,8 +22743,6 @@ "xpack.idxMgmt.templateValidation.templateNameRequiredError": "模板名称必填。", "xpack.idxMgmt.templateValidation.templateNameSpacesError": "模板名称不允许包含空格。", "xpack.idxMgmt.templateValidation.templateNameUnderscoreError": "模板名称不得以下划线开头。", - "xpack.idxMgmt.unfreezeIndicesAction.indexUnfrozenMessage": "索引 {indexNames} 已取消冻结。", - "xpack.idxMgmt.unfreezeIndicesAction.successfullyUnfrozeIndicesMessage": "成功取消冻结:[{indexNames}]", "xpack.idxMgmt.validators.string.invalidJSONError": "JSON 格式无效。", "xpack.indexLifecycleMgmt.addLifecyclePolicyActionButtonLabel": "添加生命周期策略", "xpack.indexLifecycleMgmt.appTitle": "索引生命周期策略", diff --git a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/helpers/test_subjects.ts b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/helpers/test_subjects.ts index b623d2e754b61..bfb59bcab973d 100644 --- a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/helpers/test_subjects.ts +++ b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/helpers/test_subjects.ts @@ -60,7 +60,6 @@ export type TestSubjects = | 'templatesTab' | 'templateTable' | 'title' - | 'unfreezeIndexMenuButton' | 'updateEditIndexSettingsButton' | 'updateIndexSettingsErrorCallout' | 'viewButton' diff --git a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/indices_tab.test.tsx b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/indices_tab.test.tsx index a8256a2e00b27..5bc5a4e6282f6 100644 --- a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/indices_tab.test.tsx +++ b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/indices_tab.test.tsx @@ -336,38 +336,6 @@ describe('', () => { ); }); - test('should be able to unfreeze a frozen index', async () => { - const { actions, exists, find } = testBed; - - httpRequestsMockHelpers.setReloadIndicesResponse([{ ...indexMockA, isFrozen: false }]); - - // Open context menu - await actions.clickManageContextMenuButton(); - // Check that the unfreeze action exists for the current index and unfreeze it - expect(exists('unfreezeIndexMenuButton')).toBe(true); - await actions.clickContextMenuOption('unfreezeIndexMenuButton'); - - // After the index is unfrozen, we imediately do a reload. So we need to expect to see - // a reload server call also. - expect(httpSetup.post).toHaveBeenCalledWith( - `${API_BASE_PATH}/indices/unfreeze`, - expect.anything() - ); - expect(httpSetup.post).toHaveBeenCalledWith( - `${API_BASE_PATH}/indices/reload`, - expect.anything() - ); - - find('indexTableRowCheckbox') - .at(0) - .simulate('change', { target: { checked: true } }); - - // Open context menu once again, since clicking an action will close it. - await actions.clickManageContextMenuButton(); - // The unfreeze action should not be present anymore - expect(exists('unfreezeIndexMenuButton')).toBe(false); - }); - test('should be able to force merge an index', async () => { const { actions, exists } = testBed; diff --git a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx index 4badcc04540b1..1c252fa96fffc 100644 --- a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx +++ b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx @@ -1203,29 +1203,6 @@ describe('', () => { expect(testBed.routerMock.history.push).toHaveBeenCalledTimes(1); expect(testBed.routerMock.history.push).toHaveBeenCalledWith('/indices'); }); - - it(`unfreezes a frozen index`, async () => { - httpRequestsMockHelpers.setLoadIndexDetailsResponse(testIndexName, { - ...testIndexMock, - isFrozen: true, - }); - - await act(async () => { - testBed = await setup({ httpSetup }); - }); - testBed.component.update(); - - // already sent 6 requests while setting up the component - const numberOfRequests = 6; - expect(httpSetup.get).toHaveBeenCalledTimes(numberOfRequests); - - await testBed.actions.contextMenu.clickManageIndexButton(); - await testBed.actions.contextMenu.clickIndexAction('unfreezeIndexMenuButton'); - expect(httpSetup.post).toHaveBeenCalledWith(`${API_BASE_PATH}/indices/unfreeze`, { - body: JSON.stringify({ indices: [testIndexName] }), - }); - expect(httpSetup.get).toHaveBeenCalledTimes(numberOfRequests + 1); - }); }); describe('index name with a percent sign', () => { diff --git a/x-pack/platform/plugins/shared/index_management/__jest__/components/index_table.test.js b/x-pack/platform/plugins/shared/index_management/__jest__/components/index_table.test.js index 0a59fef7be6e6..2e0040eff87b1 100644 --- a/x-pack/platform/plugins/shared/index_management/__jest__/components/index_table.test.js +++ b/x-pack/platform/plugins/shared/index_management/__jest__/components/index_table.test.js @@ -492,7 +492,6 @@ describe('index table', () => { expect(findTestSubject(rendered, 'refreshIndexMenuButton').length).toBe(0); expect(findTestSubject(rendered, 'clearCacheIndexMenuButton').length).toBe(0); expect(findTestSubject(rendered, 'flushIndexMenuButton').length).toBe(0); - expect(findTestSubject(rendered, 'unfreezeIndexMenuButton').length).toBe(0); }); }); }); diff --git a/x-pack/platform/plugins/shared/index_management/common/constants/index.ts b/x-pack/platform/plugins/shared/index_management/common/constants/index.ts index 81e50fa8b75be..42a65429363de 100644 --- a/x-pack/platform/plugins/shared/index_management/common/constants/index.ts +++ b/x-pack/platform/plugins/shared/index_management/common/constants/index.ts @@ -36,8 +36,6 @@ export { UIM_INDEX_OPEN_MANY, UIM_INDEX_REFRESH, UIM_INDEX_REFRESH_MANY, - UIM_INDEX_UNFREEZE, - UIM_INDEX_UNFREEZE_MANY, UIM_INDEX_SETTINGS_EDIT, UIM_TEMPLATE_LIST_LOAD, UIM_TEMPLATE_DELETE, diff --git a/x-pack/platform/plugins/shared/index_management/common/constants/ui_metric.ts b/x-pack/platform/plugins/shared/index_management/common/constants/ui_metric.ts index 26a8a5e65c739..5914b85c7e86f 100644 --- a/x-pack/platform/plugins/shared/index_management/common/constants/ui_metric.ts +++ b/x-pack/platform/plugins/shared/index_management/common/constants/ui_metric.ts @@ -24,8 +24,6 @@ export const UIM_INDEX_OPEN_MANY = 'index_open_many'; export const UIM_INDEX_REFRESH = 'index_refresh'; export const UIM_INDEX_REFRESH_MANY = 'index_refresh_many'; export const UIM_INDEX_SETTINGS_EDIT = 'index_settings_edit'; -export const UIM_INDEX_UNFREEZE = 'index_unfreeze'; -export const UIM_INDEX_UNFREEZE_MANY = 'index_unfreeze_many'; export const UIM_TEMPLATE_LIST_LOAD = 'template_list_load'; export const UIM_TEMPLATE_DELETE = 'template_delete'; export const UIM_TEMPLATE_DELETE_MANY = 'template_delete_many'; diff --git a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/details_page/manage_index_button.tsx b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/details_page/manage_index_button.tsx index 7de07493ef78e..aedd0315c5aa0 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/details_page/manage_index_button.tsx +++ b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/details_page/manage_index_button.tsx @@ -18,7 +18,6 @@ import { forcemergeIndices as forcemergeIndicesRequest, openIndices as openIndicesRequest, refreshIndices as refreshIndicesRequest, - unfreezeIndices as unfreezeIndicesRequest, } from '../../../../services'; import { notificationService } from '../../../../services/notification'; import { httpService } from '../../../../services/http'; @@ -162,24 +161,6 @@ export const ManageIndexButton: FunctionComponent = ({ } }, [reloadIndices, indexNames]); - const unfreezeIndices = useCallback(async () => { - setIsLoading(true); - try { - await unfreezeIndicesRequest(indexNames); - await reloadIndices(); - setIsLoading(false); - notificationService.showSuccessToast( - i18n.translate('xpack.idxMgmt.unfreezeIndicesAction.indexUnfrozenMessage', { - defaultMessage: 'The index {indexNames} was unfrozen.', - values: { indexNames: indexNames.join(', ') }, - }) - ); - } catch (error) { - setIsLoading(false); - notificationService.showDangerToast(error.body.message); - } - }, [reloadIndices, indexNames]); - const forcemergeIndices = useCallback( async (maxNumSegments: string) => { setIsLoading(true); @@ -251,7 +232,6 @@ export const ManageIndexButton: FunctionComponent = ({ flushIndices={flushIndices} refreshIndices={refreshIndices} clearCacheIndices={clearCacheIndices} - unfreezeIndices={unfreezeIndices} forcemergeIndices={forcemergeIndices} deleteIndices={deleteIndices} performExtensionAction={performExtensionAction} diff --git a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.container.js b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.container.js index 4b41c5929d7a0..8630788bd60d7 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.container.js +++ b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.container.js @@ -17,7 +17,6 @@ import { refreshIndices, performExtensionAction, reloadIndices, - unfreezeIndices, } from '../../../../store/actions'; import { getIndexStatusByIndexName, getIndicesByName } from '../../../../store/selectors'; @@ -53,9 +52,6 @@ const mapDispatchToProps = (dispatch, { indexNames }) => { refreshIndices: () => { dispatch(refreshIndices({ indexNames })); }, - unfreezeIndices: () => { - dispatch(unfreezeIndices({ indexNames })); - }, forcemergeIndices: (maxNumSegments) => { dispatch(forcemergeIndices({ indexNames, maxNumSegments })); }, diff --git a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.d.ts b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.d.ts index eeff487e22f3a..fd84d2fca4c7f 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.d.ts +++ b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.d.ts @@ -33,7 +33,6 @@ export interface IndexActionsContextMenuProps { flushIndices: () => Promise; refreshIndices: () => Promise; clearCacheIndices: () => Promise; - unfreezeIndices: () => Promise; forcemergeIndices: (maxNumSegments: string) => Promise; deleteIndices: () => Promise; diff --git a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js index d733fdfd2f6e6..21f77ae11337d 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js +++ b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js @@ -67,13 +67,12 @@ export class IndexActionsContextMenu extends Component { performExtensionAction, indices, reloadIndices, - unfreezeIndices, indicesListURLParams, } = this.props; const allOpen = every(indexNames, (indexName) => { return indexStatusByName[indexName] === INDEX_OPEN; }); - const allFrozen = every(indices, (index) => index.isFrozen); + const selectedIndexCount = indexNames.length; const items = []; if (isOnListView && selectedIndexCount === 1) { @@ -191,18 +190,6 @@ export class IndexActionsContextMenu extends Component { this.closePopoverAndExecute(flushIndices); }, }); - if (allFrozen) { - items.push({ - 'data-test-subj': 'unfreezeIndexMenuButton', - name: i18n.translate('xpack.idxMgmt.indexActionsMenu.unfreezeIndexLabel', { - defaultMessage: 'Unfreeze {selectedIndexCount, plural, one {index} other {indices} }', - values: { selectedIndexCount }, - }), - onClick: () => { - this.closePopoverAndExecute(unfreezeIndices); - }, - }); - } } else if (!allOpen && enableIndexActions) { items.push({ 'data-test-subj': 'openIndexMenuButton', diff --git a/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts b/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts index f2600220612e7..78f8942ba72fa 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts +++ b/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts @@ -28,8 +28,6 @@ import { UIM_INDEX_OPEN_MANY, UIM_INDEX_REFRESH, UIM_INDEX_REFRESH_MANY, - UIM_INDEX_UNFREEZE, - UIM_INDEX_UNFREEZE_MANY, UIM_TEMPLATE_DELETE, UIM_TEMPLATE_DELETE_MANY, UIM_TEMPLATE_CREATE, @@ -214,17 +212,6 @@ export async function clearCacheIndices(indices: string[]) { return response; } -export async function unfreezeIndices(indices: string[]) { - const body = JSON.stringify({ - indices, - }); - const response = await httpService.httpClient.post(`${API_BASE_PATH}/indices/unfreeze`, { body }); - // Only track successful requests. - const eventName = indices.length > 1 ? UIM_INDEX_UNFREEZE_MANY : UIM_INDEX_UNFREEZE; - uiMetricService.trackMetric(METRIC_TYPE.COUNT, eventName); - return response; -} - export async function loadIndexSettings(indexName: string) { const response = await httpService.httpClient.get( `${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}` diff --git a/x-pack/platform/plugins/shared/index_management/public/application/services/index.ts b/x-pack/platform/plugins/shared/index_management/public/application/services/index.ts index 5c34d83186c6a..09d9065b2b729 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/services/index.ts +++ b/x-pack/platform/plugins/shared/index_management/public/application/services/index.ts @@ -15,7 +15,6 @@ export { flushIndices, forcemergeIndices, clearCacheIndices, - unfreezeIndices, loadIndexSettings, updateIndexSettings, loadIndexStats, diff --git a/x-pack/platform/plugins/shared/index_management/public/application/store/actions/index.js b/x-pack/platform/plugins/shared/index_management/public/application/store/actions/index.js index 63c15854ceb89..24f5112b494a0 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/store/actions/index.js +++ b/x-pack/platform/plugins/shared/index_management/public/application/store/actions/index.js @@ -14,7 +14,6 @@ export * from './forcemerge_indices'; export * from './load_indices'; export * from './open_indices'; export * from './refresh_indices'; -export * from './unfreeze_indices'; export * from './reload_indices'; export * from './table_state'; export * from './extension_action'; diff --git a/x-pack/platform/plugins/shared/index_management/public/application/store/actions/unfreeze_indices.js b/x-pack/platform/plugins/shared/index_management/public/application/store/actions/unfreeze_indices.js deleted file mode 100644 index dd2c18a1ae810..0000000000000 --- a/x-pack/platform/plugins/shared/index_management/public/application/store/actions/unfreeze_indices.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { createAction } from 'redux-actions'; -import { i18n } from '@kbn/i18n'; -import { unfreezeIndices as request } from '../../services'; -import { clearRowStatus, reloadIndices } from '.'; -import { notificationService } from '../../services/notification'; - -export const unfreezeIndicesStart = createAction('INDEX_MANAGEMENT_UNFREEZE_INDICES_START'); - -export const unfreezeIndices = - ({ indexNames }) => - async (dispatch) => { - dispatch(unfreezeIndicesStart({ indexNames })); - try { - await request(indexNames); - } catch (error) { - notificationService.showDangerToast(error.body.message); - return dispatch(clearRowStatus({ indexNames })); - } - dispatch(reloadIndices(indexNames)); - notificationService.showSuccessToast( - i18n.translate('xpack.idxMgmt.unfreezeIndicesAction.successfullyUnfrozeIndicesMessage', { - defaultMessage: 'Successfully unfroze: [{indexNames}]', - values: { indexNames: indexNames.join(', ') }, - }) - ); - }; diff --git a/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_indices_routes.ts b/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_indices_routes.ts index 5e9a8fd56442e..b4be8054daeeb 100644 --- a/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_indices_routes.ts +++ b/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_indices_routes.ts @@ -16,7 +16,6 @@ import { registerOpenRoute } from './register_open_route'; import { registerRefreshRoute } from './register_refresh_route'; import { registerReloadRoute } from './register_reload_route'; import { registerDeleteRoute } from './register_delete_route'; -import { registerUnfreezeRoute } from './register_unfreeze_route'; import { registerGetRoute } from './register_get_route'; import { registerCreateRoute } from './register_create_route'; @@ -30,7 +29,6 @@ export function registerIndicesRoutes(dependencies: RouteDependencies) { registerRefreshRoute(dependencies); registerReloadRoute(dependencies); registerDeleteRoute(dependencies); - registerUnfreezeRoute(dependencies); registerGetRoute(dependencies); registerCreateRoute(dependencies); } diff --git a/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_unfreeze_route.ts b/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_unfreeze_route.ts deleted file mode 100644 index 49967f8684a2f..0000000000000 --- a/x-pack/platform/plugins/shared/index_management/server/routes/api/indices/register_unfreeze_route.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; - -import { RouteDependencies } from '../../../types'; -import { addBasePath } from '..'; - -const bodySchema = schema.object({ - indices: schema.arrayOf(schema.string()), -}); - -export function registerUnfreezeRoute({ router, lib: { handleEsError } }: RouteDependencies) { - router.post( - { - path: addBasePath('/indices/unfreeze'), - security: { - authz: { - enabled: false, - reason: 'Relies on es client for authorization', - }, - }, - validate: { body: bodySchema }, - }, - async (context, request, response) => { - const { client } = (await context.core).elasticsearch; - const { indices = [] } = request.body as typeof bodySchema.type; - - try { - await client.asCurrentUser.indices.unfreeze({ - index: indices.join(','), - }); - return response.ok(); - } catch (error) { - return handleEsError({ error, response }); - } - } - ); -}