Skip to content

Commit

Permalink
Revert "Elasticsearch indices data source (elastic#686)"
Browse files Browse the repository at this point in the history
This reverts commit 17859f3.
  • Loading branch information
daemitus committed Sep 11, 2024
1 parent 3920004 commit d34d5e7
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 1,189 deletions.
135 changes: 0 additions & 135 deletions docs/data-sources/elasticsearch_indices.md

This file was deleted.

This file was deleted.

14 changes: 2 additions & 12 deletions internal/clients/elasticsearch/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,6 @@ func DeleteIndex(ctx context.Context, apiClient *clients.ApiClient, name string)
}

func GetIndex(ctx context.Context, apiClient *clients.ApiClient, name string) (*models.Index, fwdiags.Diagnostics) {
indices, diags := GetIndices(ctx, apiClient, name)
if diags.HasError() {
return nil, diags
}

index := indices[name]
return &index, diags
}

func GetIndices(ctx context.Context, apiClient *clients.ApiClient, name string) (map[string]models.Index, fwdiags.Diagnostics) {
esClient, err := apiClient.GetESClient()
if err != nil {
return nil, fwdiags.Diagnostics{
Expand Down Expand Up @@ -343,8 +333,8 @@ func GetIndices(ctx context.Context, apiClient *clients.ApiClient, name string)
fwdiags.NewErrorDiagnostic(err.Error(), err.Error()),
}
}

return indices, nil
index := indices[name]
return &index, nil
}

func DeleteIndexAlias(ctx context.Context, apiClient *clients.ApiClient, index string, aliases []string) fwdiags.Diagnostics {
Expand Down
46 changes: 0 additions & 46 deletions internal/elasticsearch/index/indices/data_source.go

This file was deleted.

36 changes: 0 additions & 36 deletions internal/elasticsearch/index/indices/data_source_test.go

This file was deleted.

Loading

0 comments on commit d34d5e7

Please sign in to comment.