Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OnWeek] Maintenance Window API #1037

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

adcoelho
Copy link
Contributor

@adcoelho adcoelho commented Feb 26, 2025

Summary

As my On Week project, I wanted to figure out how to support new resources/APIs in the terraform provider.

Change summary

No tests or validation, just a proof of concept.

I generated the documentation for the MW API and merged the bundle with generated/alerting/bundled.yaml in the elasticstack project.

Re-generated mocks.

make generate-alerting-api to update the alerting client in the provider project.

Change the following code:

  1. Model - internal/models/maintenance_window.go
  2. Client - internal/clients/kibana/maintenance_window.go
  3. Resource - ResourceAlertingMaintenanceWindow
    1. ResourceAlertingMaintenanceWindow returns a schema.Resource
    2. implements Create, Read and Delete (Update in the future)

Example

resource "elasticstack_kibana_maintenance_window" "my_maintenance_window" {
  title    = "Foobar Maintenance Window"
  enabled  = true
  start    = "1992-01-01T05:00:00.200Z"
  duration = 3600000

}

@adcoelho adcoelho changed the title [OnWeek] Maintenance Window APi [OnWeek] Maintenance Window API Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant