Interface IIndexAliasManager
- Namespace
- Excalibur.Data.ElasticSearch.IndexManagement
- Assembly
- Excalibur.Data.ElasticSearch.dll
Provides functionality for managing Elasticsearch index aliases.
public interface IIndexAliasManager
Methods
AliasExistsAsync(string, CancellationToken)
Checks if an alias exists in Elasticsearch.
Task<bool> AliasExistsAsync(string aliasName, CancellationToken cancellationToken)
Parameters
aliasNamestringThe name of the alias to check.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<bool>
A Task<TResult> indicating whether the alias exists.
CreateAliasAsync(string, IEnumerable<string>, JsonElement?, CancellationToken)
Creates or updates an alias for the specified indices.
Task<bool> CreateAliasAsync(string aliasName, IEnumerable<string> indexNames, JsonElement? aliasConfigurationJson, CancellationToken cancellationToken)
Parameters
aliasNamestringThe name of the alias.
indexNamesIEnumerable<string>The names of the indices to include in the alias.
aliasConfigurationJsonJsonElement?Optional alias configuration settings as opaque JSON.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<bool>
A Task<TResult> indicating whether the operation was successful.
DeleteAliasAsync(string, IEnumerable<string>?, CancellationToken)
Deletes an alias from Elasticsearch.
Task<bool> DeleteAliasAsync(string aliasName, IEnumerable<string>? indexNames, CancellationToken cancellationToken)
Parameters
aliasNamestringThe name of the alias to delete.
indexNamesIEnumerable<string>The names of the indices to remove the alias from. If null, removes from all indices.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<bool>
A Task<TResult> indicating whether the operation was successful.
GetAliasesAsync(string?, CancellationToken)
Gets all aliases that match the specified pattern.
Task<IEnumerable<AliasDefinition>> GetAliasesAsync(string? aliasPattern, CancellationToken cancellationToken)
Parameters
aliasPatternstringThe pattern to match alias names against. If null, returns all aliases.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<IEnumerable<AliasDefinition>>
A Task<TResult> containing the matching aliases.
UpdateAliasesAsync(IEnumerable<AliasOperation>, CancellationToken)
Performs atomic alias operations to switch indices behind an alias.
Task<bool> UpdateAliasesAsync(IEnumerable<AliasOperation> operations, CancellationToken cancellationToken)
Parameters
operationsIEnumerable<AliasOperation>The alias operations to perform atomically.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<bool>
A Task<TResult> indicating whether the operation was successful.