Skip to content

Commit 990f15e

Browse files
[ResponseOps][Maintenance Window] Find API (#234434)
Closes #208883 ## Summary This PR introduces a public find maintenance window API Search can be done using the following fields: - `title` - `created_by` - `status` Pagination is included. `createdBy` was not part of the mapping, so I had to create a new mapping version for the maintenance window saved object. ## Testing instructions 1. Create a maintenance window via the UI with the title `Foobar`. 2. Try different GET requests: - `https://localhost:5601/api/maintenance_window/_find?title=Foobar` - `https://localhost:5601/api/maintenance_window/_find?created_by=elastic` - `https://localhost:5601/api/maintenance_window/_find?status=upcoming` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
1 parent e655dc5 commit 990f15e

File tree

39 files changed

+2011
-117
lines changed

39 files changed

+2011
-117
lines changed

oas_docs/bundle.json

Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44046,6 +44046,289 @@
4404644046
"x-state": "Generally available; added in 9.1.0"
4404744047
}
4404844048
},
44049+
"/api/maintenance_window/_find": {
44050+
"get": {
44051+
"description": "[Required authorization] Route required privileges: read-maintenance-window.",
44052+
"operationId": "get-maintenance-window-find",
44053+
"parameters": [
44054+
{
44055+
"description": "The title of the maintenance window.",
44056+
"in": "query",
44057+
"name": "title",
44058+
"required": false,
44059+
"schema": {
44060+
"type": "string"
44061+
}
44062+
},
44063+
{
44064+
"description": "The user who created the maintenance window.",
44065+
"in": "query",
44066+
"name": "created_by",
44067+
"required": false,
44068+
"schema": {
44069+
"type": "string"
44070+
}
44071+
},
44072+
{
44073+
"description": "The status of the maintenance window. One of \"running\", \"upcoming\", \"finished\" or \"archived\".",
44074+
"in": "query",
44075+
"name": "status",
44076+
"required": false,
44077+
"schema": {
44078+
"anyOf": [
44079+
{
44080+
"enum": [
44081+
"running",
44082+
"finished",
44083+
"upcoming",
44084+
"archived"
44085+
],
44086+
"type": "string"
44087+
},
44088+
{
44089+
"items": {
44090+
"enum": [
44091+
"running",
44092+
"finished",
44093+
"upcoming",
44094+
"archived"
44095+
],
44096+
"type": "string"
44097+
},
44098+
"type": "array"
44099+
}
44100+
]
44101+
}
44102+
},
44103+
{
44104+
"description": "The page number to return.",
44105+
"in": "query",
44106+
"name": "page",
44107+
"required": false,
44108+
"schema": {
44109+
"default": 1,
44110+
"maximum": 100,
44111+
"minimum": 1,
44112+
"type": "number"
44113+
}
44114+
},
44115+
{
44116+
"description": "The number of maintenance windows to return per page.",
44117+
"in": "query",
44118+
"name": "per_page",
44119+
"required": false,
44120+
"schema": {
44121+
"default": 10,
44122+
"maximum": 100,
44123+
"minimum": 1,
44124+
"type": "number"
44125+
}
44126+
}
44127+
],
44128+
"responses": {
44129+
"200": {
44130+
"content": {
44131+
"application/json": {
44132+
"schema": {
44133+
"additionalProperties": false,
44134+
"properties": {
44135+
"maintenanceWindows": {
44136+
"items": {
44137+
"additionalProperties": false,
44138+
"properties": {
44139+
"created_at": {
44140+
"description": "The date and time when the maintenance window was created.",
44141+
"type": "string"
44142+
},
44143+
"created_by": {
44144+
"description": "The identifier for the user that created the maintenance window.",
44145+
"nullable": true,
44146+
"type": "string"
44147+
},
44148+
"enabled": {
44149+
"description": "Whether the current maintenance window is enabled. Disabled maintenance windows do not suppress notifications.",
44150+
"type": "boolean"
44151+
},
44152+
"id": {
44153+
"description": "The identifier for the maintenance window.",
44154+
"type": "string"
44155+
},
44156+
"schedule": {
44157+
"additionalProperties": false,
44158+
"properties": {
44159+
"custom": {
44160+
"additionalProperties": false,
44161+
"properties": {
44162+
"duration": {
44163+
"description": "The duration of the schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `h`, `m`, or `s` for hours, minutes, seconds. For example: `1d`, `5h`, `30m`, `5000s`.",
44164+
"type": "string"
44165+
},
44166+
"recurring": {
44167+
"additionalProperties": false,
44168+
"properties": {
44169+
"end": {
44170+
"description": "The end date of a recurring schedule, provided in ISO 8601 format and set to the UTC timezone. For example: `2025-04-01T00:00:00.000Z`.",
44171+
"type": "string"
44172+
},
44173+
"every": {
44174+
"description": "The interval and frequency of a recurring schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `w`, `M`, or `y` for days, weeks, months, years. For example: `15d`, `2w`, `3m`, `1y`.",
44175+
"type": "string"
44176+
},
44177+
"occurrences": {
44178+
"description": "The total number of recurrences of the schedule.",
44179+
"type": "number"
44180+
},
44181+
"onMonth": {
44182+
"description": "The specific months for a recurring schedule. Valid values are 1-12.",
44183+
"items": {
44184+
"type": "number"
44185+
},
44186+
"type": "array"
44187+
},
44188+
"onMonthDay": {
44189+
"description": "The specific days of the month for a recurring schedule. Valid values are 1-31.",
44190+
"items": {
44191+
"type": "number"
44192+
},
44193+
"type": "array"
44194+
},
44195+
"onWeekDay": {
44196+
"description": "The specific days of the week (`[MO,TU,WE,TH,FR,SA,SU]`) or nth day of month (`[+1MO, -3FR, +2WE, -4SA, -5SU]`) for a recurring schedule.",
44197+
"items": {
44198+
"type": "string"
44199+
},
44200+
"type": "array"
44201+
}
44202+
},
44203+
"type": "object"
44204+
},
44205+
"start": {
44206+
"description": "The start date and time of the schedule, provided in ISO 8601 format and set to the UTC timezone. For example: `2025-03-12T12:00:00.000Z`.",
44207+
"type": "string"
44208+
},
44209+
"timezone": {
44210+
"description": "The timezone of the schedule. The default timezone is UTC.",
44211+
"type": "string"
44212+
}
44213+
},
44214+
"required": [
44215+
"start",
44216+
"duration"
44217+
],
44218+
"type": "object"
44219+
}
44220+
},
44221+
"required": [
44222+
"custom"
44223+
],
44224+
"type": "object"
44225+
},
44226+
"scope": {
44227+
"additionalProperties": false,
44228+
"properties": {
44229+
"alerting": {
44230+
"additionalProperties": false,
44231+
"properties": {
44232+
"query": {
44233+
"additionalProperties": false,
44234+
"properties": {
44235+
"kql": {
44236+
"description": "A filter written in Kibana Query Language (KQL).",
44237+
"type": "string"
44238+
}
44239+
},
44240+
"required": [
44241+
"kql"
44242+
],
44243+
"type": "object"
44244+
}
44245+
},
44246+
"required": [
44247+
"query"
44248+
],
44249+
"type": "object"
44250+
}
44251+
},
44252+
"required": [
44253+
"alerting"
44254+
],
44255+
"type": "object"
44256+
},
44257+
"status": {
44258+
"description": "The current status of the maintenance window.",
44259+
"enum": [
44260+
"running",
44261+
"upcoming",
44262+
"finished",
44263+
"archived"
44264+
],
44265+
"type": "string"
44266+
},
44267+
"title": {
44268+
"description": "The name of the maintenance window.",
44269+
"type": "string"
44270+
},
44271+
"updated_at": {
44272+
"description": "The date and time when the maintenance window was last updated.",
44273+
"type": "string"
44274+
},
44275+
"updated_by": {
44276+
"description": "The identifier for the user that last updated this maintenance window.",
44277+
"nullable": true,
44278+
"type": "string"
44279+
}
44280+
},
44281+
"required": [
44282+
"id",
44283+
"title",
44284+
"enabled",
44285+
"created_by",
44286+
"updated_by",
44287+
"created_at",
44288+
"updated_at",
44289+
"status",
44290+
"schedule"
44291+
],
44292+
"type": "object"
44293+
},
44294+
"type": "array"
44295+
},
44296+
"page": {
44297+
"type": "number"
44298+
},
44299+
"per_page": {
44300+
"type": "number"
44301+
},
44302+
"total": {
44303+
"type": "number"
44304+
}
44305+
},
44306+
"required": [
44307+
"page",
44308+
"per_page",
44309+
"total",
44310+
"maintenanceWindows"
44311+
],
44312+
"type": "object"
44313+
}
44314+
}
44315+
},
44316+
"description": "Indicates a successful call."
44317+
},
44318+
"400": {
44319+
"description": "Indicates an invalid schema or parameters."
44320+
},
44321+
"403": {
44322+
"description": "Indicates that this call is forbidden."
44323+
}
44324+
},
44325+
"summary": "Search for a maintenance window.",
44326+
"tags": [
44327+
"maintenance-window"
44328+
],
44329+
"x-state": "Generally available; added in 9.2.0"
44330+
}
44331+
},
4404944332
"/api/maintenance_window/{id}": {
4405044333
"delete": {
4405144334
"description": "[Required authorization] Route required privileges: write-maintenance-window.",

0 commit comments

Comments
 (0)