/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React, { ChangeEvent } from "react"; import { EuiCheckbox, EuiSpacer, EuiText } from "@elastic/eui"; import { CheckBoxLabel } from "../../helper" import IndexSettingsInput from "../../components/IndexSettingsInput"; import { RESTORE_OPTIONS } from "../../../../models/interfaces"; interface SnapshotAdvancedOptionsProps { getIndexSettings: (indexSettings: string, ignore: boolean) => void; restoreAliases: boolean; onRestoreAliasesToggle: (e: ChangeEvent) => void; restoreClusterState: boolean; onRestoreClusterStateToggle: (e: ChangeEvent) => void; ignoreUnavailable: boolean; onIgnoreUnavailableToggle: (e: ChangeEvent) => void; customizeIndexSettings: boolean; onCustomizeIndexSettingsToggle: (e: ChangeEvent) => void; ignoreIndexSettings: boolean; onIgnoreIndexSettingsToggle: (e: ChangeEvent) => void; width?: string; badJSONInput: boolean; badIgnoreInput: boolean; } const SnapshotRestoreAdvancedOptions = ({ getIndexSettings, restoreAliases, onRestoreAliasesToggle, ignoreUnavailable, onIgnoreUnavailableToggle, restoreClusterState, onRestoreClusterStateToggle, customizeIndexSettings, onCustomizeIndexSettingsToggle, ignoreIndexSettings, onIgnoreIndexSettingsToggle, width, badJSONInput, badIgnoreInput }: SnapshotAdvancedOptionsProps) => { const { restore_aliases, include_global_state, ignore_unavailable, customize_index_settings, ignore_index_settings, } = RESTORE_OPTIONS; const JSONerror = "Please enter valid JSON between curly brackets." const ignoreListError = "Please enter a comma separated list of valid settings to ignore." return (
} checked={restoreAliases} onChange={onRestoreAliasesToggle} /> Restore cluster state from snapshots} checked={restoreClusterState} onChange={onRestoreClusterStateToggle} /> } checked={ignoreUnavailable} onChange={onIgnoreUnavailableToggle} />
Custom index settings

By default, index settings are restored from indices in snapshots. You can choose to
customize index settings on restore.

} checked={customizeIndexSettings} onChange={onCustomizeIndexSettingsToggle} /> {customizeIndexSettings && } } checked={ignoreIndexSettings} onChange={onIgnoreIndexSettingsToggle} /> {ignoreIndexSettings && }
); }; export default SnapshotRestoreAdvancedOptions;