Draft
Conversation
Add `elasticstack_elasticsearch_ml_filter` for managing Elasticsearch ML filters used in anomaly detection job custom_rules. Supports full CRUD with in-place updates via the Update filter API — description changes and items diffs (add_items/remove_items) are computed from the Terraform set diff. Import supported via composite ID. Includes requirements doc, unit tests (8 cases), acceptance tests (3 cases), and generated documentation. Made-with: Cursor
Update filter package to match upstream API renames: ApiClient→APIClient, CompositeIdFromStr→CompositeIDFromStr, ResourceId→ResourceID, GetEsFWConnectionBlock signature change. Made-with: Cursor
- Break long lines in schema.go to stay under 200 char limit (lll) - Rename exported types to avoid stuttering (revive): FilterTFModel→TFModel, FilterCreateAPIModel→CreateAPIModel, FilterAPIModel→APIModel, FilterUpdateAPIModel→UpdateAPIModel - Fix gofmt alignment after renames Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
elasticstack_elasticsearch_ml_filterresource for managing ML filters used in anomaly detection jobcustom_rulesDetails
Supports full CRUD with in-place updates via the dedicated Update filter API.
descriptionanditems(set of strings) can both be updated in-place — items diffs are computed and sent asadd_items/remove_items.filter_idrequires replacement.Test plan
make buildpasses (including doc generation)Made with Cursor
Note
Add
elasticstack_elasticsearch_ml_filterresource for Elasticsearch ML filtersPUT /_ml/filters/{filter_id},GET /_ml/filters/{filter_id},POST /_ml/filters/{filter_id}/_update, andDELETE /_ml/filters/{filter_id}.add_items/remove_itemsfor the update API.filter_idwith length (1–64) and regex constraints; changingfilter_idforces replacement.Macroscope summarized 5c80f89. (Automatic summaries will resume when PR exits draft mode or review begins).