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

[ILM] Absolute to relative time conversion #87822

Merged
19 changes: 0 additions & 19 deletions x-pack/plugins/index_lifecycle_management/common/types/policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,6 @@ export interface PhaseWithMinAge {
selectedMinimumAgeUnits: string;
}

/**
* Different types of allocation markers we use in deserialized policies.
*
* default - use data tier based data allocation based on node roles -- this is ES best practice mode.
* custom - use node_attrs to allocate data to specific nodes
* none - do not move data anywhere when entering a phase
*/
export type DataTierAllocationType = 'default' | 'custom' | 'none';

export interface PhaseWithAllocationAction {
selectedNodeAttrs: string;
selectedReplicaCount: string;
/**
* A string value indicating allocation type. If unspecified we assume the user
* wants to use default allocation.
*/
dataTierAllocationType: DataTierAllocationType;
}

export interface PhaseWithIndexPriority {
phaseIndexPriority: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { DataTierAllocationType, AllocateAction, MigrateAction } from '../../../../common/types';

/**
* Determine what deserialized state the policy config represents.
*
* See {@DataTierAllocationType} for more information.
*/
export const determineDataTierAllocationTypeLegacy = (
actions: {
allocate?: AllocateAction;
migrate?: MigrateAction;
} = {}
): DataTierAllocationType => {
const { allocate, migrate } = actions;

if (migrate?.enabled === false) {
return 'none';
}

if (!allocate) {
return 'default';
}

if (
(allocate.require && Object.keys(allocate.require).length) ||
(allocate.include && Object.keys(allocate.include).length) ||
(allocate.exclude && Object.keys(allocate.exclude).length)
) {
return 'custom';
}

return 'default';
};
import { AllocateAction, MigrateAction } from '../../../../common/types';

export const determineDataTierAllocationType = (
actions: {
Expand Down
Loading