WIP: feat: add ML calendar and calendar event resources#1969
Draft
edsavage wants to merge 10 commits intoelastic:mainfrom
Draft
WIP: feat: add ML calendar and calendar event resources#1969edsavage wants to merge 10 commits intoelastic:mainfrom
edsavage wants to merge 10 commits intoelastic:mainfrom
Conversation
Add two new Terraform resources for managing Elasticsearch ML calendars: - `elasticstack_elasticsearch_ml_calendar` — manages calendar lifecycle and job associations via individual PutCalendarJob/DeleteCalendarJob endpoints for in-place job_ids updates. - `elasticstack_elasticsearch_ml_calendar_event` — manages individual scheduled events with RFC3339 time handling and server-generated event IDs. All attributes require replacement (no update API). Both resources support import and follow the existing Plugin Framework patterns. Includes requirements doc, unit tests (16 cases), acceptance tests (5 cases), and generated documentation. Made-with: Cursor
Made-with: Cursor
Update calendar and calendar_event packages to match upstream API renames: ApiClient→APIClient, CompositeIdFromStr→CompositeIDFromStr, ResourceId→ResourceID, GetEsFWConnectionBlock signature change. Made-with: Cursor
Replace defer with immediate Close() calls inside the job add/remove loops to avoid keeping all response bodies open until function return. Made-with: Cursor
- Break long lines in schema descriptions to stay under 200 char limit (lll) - Rename exported types to avoid stuttering (revive): CalendarTFModel→TFModel, CalendarCreateAPIModel→CreateAPIModel, CalendarAPIModel→APIModel - Fix gofmt alignment after renames Made-with: Cursor
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_calendarresource for managing ML calendars and job associationselasticstack_elasticsearch_ml_calendar_eventresource for managing individual scheduled events with RFC3339 timesDetails
Calendar resource: Creates/deletes via PUT/DELETE calendar API. Updates job associations in-place by diffing
job_idsand calling individual PutCalendarJob/DeleteCalendarJob endpoints.descriptionrequires replacement (PUT is create-only).Calendar event resource: Creates via POST calendar events API, deletes via DELETE. No update API exists — all attributes use RequiresReplace. Server-generated
event_idis discovered by diffing events before/after creation.Test plan
make buildpasses (including doc generation)Made with Cursor
Note
Add
elasticstack_elasticsearch_ml_calendarandelasticstack_elasticsearch_ml_calendar_eventTerraform resources<cluster_uuid>/<calendar_id>/<event_id>; event IDs are assigned by Elasticsearch and discovered by diffing pre/post-create event lists.start_time,end_time) use RFC3339 strings in Terraform state and are converted to/from epoch milliseconds for the API.📊 Macroscope summarized 5a294b1. 29 files reviewed, 5 issues evaluated, 0 issues filtered, 1 comment posted
(Automatic summaries will resume when PR exits draft mode or review begins).🗂️ Filtered Issues