Table of Contents

Interface IIndexLifecycleManager

Namespace
Excalibur.Data.ElasticSearch.IndexManagement
Assembly
Excalibur.Data.ElasticSearch.dll

Provides functionality for managing the lifecycle of Elasticsearch indices including rollover, aging, and deletion.

public interface IIndexLifecycleManager

Methods

CreateLifecyclePolicyAsync(string, IndexLifecyclePolicy, CancellationToken)

Creates an index lifecycle policy in Elasticsearch.

Task<bool> CreateLifecyclePolicyAsync(string policyName, IndexLifecyclePolicy policy, CancellationToken cancellationToken)

Parameters

policyName string

The name of the lifecycle policy.

policy IndexLifecyclePolicy

The lifecycle policy configuration.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the operation was successful.

DeleteLifecyclePolicyAsync(string, CancellationToken)

Deletes an index lifecycle policy from Elasticsearch.

Task<bool> DeleteLifecyclePolicyAsync(string policyName, CancellationToken cancellationToken)

Parameters

policyName string

The name of the lifecycle policy to delete.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the operation was successful.

GetIndexLifecycleStatusAsync(string?, CancellationToken)

Gets the status of indices managed by lifecycle policies.

Task<IEnumerable<IndexLifecycleStatus>> GetIndexLifecycleStatusAsync(string? indexPattern, CancellationToken cancellationToken)

Parameters

indexPattern string

The index pattern to check. If null, checks all indices.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<IEnumerable<IndexLifecycleStatus>>

A Task<TResult> containing index lifecycle status information.

MoveToNextPhaseAsync(string, CancellationToken)

Forces a lifecycle policy to move to the next phase for specified indices.

Task<bool> MoveToNextPhaseAsync(string indexPattern, CancellationToken cancellationToken)

Parameters

indexPattern string

The pattern of indices to move to next phase.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the operation was successful.

RolloverIndexAsync(string, RolloverConditions, CancellationToken)

Performs index rollover based on the specified conditions.

Task<IndexRolloverResult> RolloverIndexAsync(string aliasName, RolloverConditions rolloverConditions, CancellationToken cancellationToken)

Parameters

aliasName string

The alias name to rollover.

rolloverConditions RolloverConditions

The conditions for rollover.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<IndexRolloverResult>

A Task<TResult> containing rollover results.