Skip to content

Commit

Permalink
[OAS] Migrate alerting APIs to v3.1.0 (elastic#171587)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Nov 22, 2023
1 parent 15866c0 commit a50cad6
Show file tree
Hide file tree
Showing 34 changed files with 918 additions and 439 deletions.
560 changes: 400 additions & 160 deletions x-pack/plugins/alerting/docs/openapi/bundled.json

Large diffs are not rendered by default.

403 changes: 261 additions & 142 deletions x-pack/plugins/alerting/docs/openapi/bundled.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ description: An identifier for the alert. The identifier is generated by the rul
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
examples:
- ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ description: An identifier for the rule.
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
examples:
- ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ description: An identifier for the space. If `/s/` and the identifier are omitte
required: true
schema:
type: string
example: default
examples:
- default
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ title: Unsuccessful rule API response
properties:
error:
type: string
example: Unauthorized
examples:
- Unauthorized
enum:
- Unauthorized
message:
type: string
statusCode:
type: integer
example: 401
examples:
- 401
enum:
- 401
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ type: object
properties:
error:
type: string
example: Not Found
examples:
- Not Found
enum:
- Not Found
message:
type: string
example: "Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found"
examples:
- "Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found"
statusCode:
type: integer
example: 404
examples:
- 404
enum:
- 404
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
type: array
type:
- "array"
- "null"
default: []
nullable: true
items:
type: object
required:
Expand Down Expand Up @@ -37,7 +38,8 @@ items:
description: Defines the days of the week that the action can run, represented as an array of numbers. For example, `1` represents Monday. An empty array is equivalent to specifying all the days of the week.
items:
type: integer
example: [1,2,3,4,5]
examples:
- [1,2,3,4,5]
hours:
type: object
description: >
Expand All @@ -47,21 +49,25 @@ items:
end:
type: string
description: The end of the time frame in 24-hour notation (`hh:mm`).
example: 17:00
examples:
- 17:00
start:
type: string
description: The start of the time frame in 24-hour notation (`hh:mm`).
example: 08:00
examples:
- 08:00
timezone:
type: string
description: >
The ISO time zone for the `hours` values.
Values such as `UTC` and `UTC+1` also work but lack built-in daylight savings time support and are not recommended.
example: Europe/Madrid
examples:
- Europe/Madrid
connector_type_id:
type: string
description: The type of connector. This property appears in responses but cannot be set in requests.
example: .server-log
examples:
- .server-log
readOnly: true
frequency:
type: object
Expand All @@ -87,16 +93,19 @@ items:
The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered).
Each rule type has a list of valid action group names.
If you don't need to group actions, set to `default`.
example: default
examples:
- default
id:
type: string
description: The identifier for the connector saved object.
example: 9dca3e00-74f5-11ed-9801-35303b735aef
examples:
- 9dca3e00-74f5-11ed-9801-35303b735aef
params:
type: object
description: The parameters for the action, which are sent to the connector. The `params` are handled as Mustache templates and passed a default set of context.
additionalProperties: true
uuid:
type: string
description: A universally unique identifier (UUID) for the action.
example: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61
examples:
- 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,66 @@ properties:
type: object
alertTypeId:
type: string
example: ".index-threshold"
examples:
- ".index-threshold"
apiKeyOwner:
type: string
nullable: true
example: elastic
type:
- "string"
- "null"
examples:
- elastic
createdAt:
type: string
description: The date and time that the alert was created.
format: date-time
example: '2022-12-05T23:36:58.284Z'
examples:
- '2022-12-05T23:36:58.284Z'
createdBy:
type: string
description: The identifier for the user that created the alert.
example: elastic
examples:
- elastic
enabled:
type: boolean
description: Indicates whether the alert is currently enabled.
example: true
examples:
- true
executionStatus:
type: object
properties:
lastExecutionDate:
type: string
format: date-time
example: '2022-12-06T00:13:43.890Z'
examples:
- '2022-12-06T00:13:43.890Z'
status:
type: string
example: ok
examples:
- ok
id:
type: string
description: The identifier for the alert.
example: b530fed0-74f5-11ed-9801-35303b735aef
examples:
- b530fed0-74f5-11ed-9801-35303b735aef
muteAll:
type: boolean
example: false
examples:
- false
mutedInstanceIds:
type: array
nullable: true
type:
- "array"
- "null"
items:
type: string
name:
type: string
description: The name of the alert.
example: my alert
examples:
- my alert
notifyWhen:
type: string
example: onActionGroupChange
examples:
- onActionGroupChange
params:
type: object
additionalProperties: true
Expand All @@ -64,19 +77,24 @@ properties:
type: string
scheduledTaskId:
type: string
example: b530fed0-74f5-11ed-9801-35303b735aef
examples:
- b530fed0-74f5-11ed-9801-35303b735aef
tags:
type: array
items:
type: string
throttle:
type: string
nullable: true
type:
- "string"
- "null"
updatedAt:
type: string
example: '2022-12-05T23:36:58.284Z'
examples:
- '2022-12-05T23:36:58.284Z'
updatedBy:
type: string
type:
- "string"
- "null"
description: The identifier for the user that updated this alert most recently.
nullable: true
example: elastic
examples:
- elastic
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ properties:
type: object
properties:
alias:
type: string
nullable: true
type:
- "string"
- "null"
controlledBy:
type: string
disabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ enum:
- onActionGroupChange
- onActiveAlert
- onThrottleInterval
example: onActiveAlert
examples:
- onActiveAlert
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ oneOf:
type: string
enum:
- esqlQuery
example: esqlQuery
examples:
- esqlQuery
size:
type: integer
description: >
When `searchType` is `esqlQuery`, this property is required but it does not affect the rule behavior.
example: 0
examples:
- 0
termSize:
$ref: 'termsize.yaml'
threshold:
Expand All @@ -60,7 +62,8 @@ oneOf:
Since the `threshold` value must be `0`, the result is that an alert occurs whenever the query returns results.
enum:
- ">"
example: ">"
examples:
- ">"
timeField:
$ref: 'timefield.yaml'
timeWindowSize:
Expand Down Expand Up @@ -105,15 +108,17 @@ oneOf:
properties:
language:
type: string
example: kuery
examples:
- kuery
query:
type: string
searchType:
description: The type of query, in this case a text-based query that uses KQL or Lucene.
type: string
enum:
- searchSource
example: searchSource
examples:
- searchSource
size:
$ref: 'size.yaml'
termField:
Expand Down Expand Up @@ -165,7 +170,8 @@ oneOf:
enum:
- esQuery
default: esQuery
example: esQuery
examples:
- esQuery
size:
$ref: 'size.yaml'
termField:
Expand Down
Loading

0 comments on commit a50cad6

Please sign in to comment.