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
policyNamestringThe name of the lifecycle policy.
policyIndexLifecyclePolicyThe lifecycle policy configuration.
cancellationTokenCancellationTokenThe 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
policyNamestringThe name of the lifecycle policy to delete.
cancellationTokenCancellationTokenThe 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
indexPatternstringThe index pattern to check. If null, checks all indices.
cancellationTokenCancellationTokenThe 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
indexPatternstringThe pattern of indices to move to next phase.
cancellationTokenCancellationTokenThe 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
aliasNamestringThe alias name to rollover.
rolloverConditionsRolloverConditionsThe conditions for rollover.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<IndexRolloverResult>
A Task<TResult> containing rollover results.