Skip to content

[ResponseOps][MW] Create Maintenance Window API #208879

@adcoelho

Description

@adcoelho

Summary

Users should be able to get information on a specific maintenance window by ID.

Implementation Notes

  • The existing maintenance window client should be used.
    • x-pack/platform/plugins/shared/alerting/server/maintenance_window_client/maintenance_window_client.ts
  • The route will call a transform function that converts from CreateMaintenanceWindowRequest into CreateMaintenanceWindowParams.

DoD

  • A POST maintenance window API is implemented.
  • Request validation is implemented.
  • The API is properly documented.
  • The schema below should be followed for the requests:

Request

title: string;
scope?: {
  query: {
    kql?: string;
  }
}

// TBD recurring schedule
duration: string; // 30m, 1h, 2m, etc
start: string; // includes timezone
repeating?: { // for clarity?
  end?: string;
  every?: string; // 1d, 2w, etc
  onWeekDay?: string[];
  onMonthDay?: number[];
  onMonth?: string[];
}

Response

title: string;

created_by?: string;
updated_by?: string;
created_at: string;
updated_at: string;

status: 'running' | 'upcoming' | 'upcoming' | 'archived';
scope?: {
  query: {
    kql?: string;
  }
}

// TBD recurring schedule
duration: string; // 30m, 1h, 2m, etc
start: string; // includes timezone
repeating?: { // for clarity?
  end?: string;
  every?: string; // 1d, 2w, etc
  onWeekDay?: string[];
  onMonthDay?: number[];
  onMonth?: string[];
}

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions