[8.11] [OAS] Migrate alerting APIs to v3.1.0 (#171587) (#171799)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[OAS] Migrate alerting APIs to v3.1.0
(#171587)](https://github.com/elastic/kibana/pull/171587)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2023-11-22T20:21:07Z","message":"[OAS]
Migrate alerting APIs to v3.1.0
(#171587)","sha":"a50cad6f78caa607d210cd90e12ab11bc18902bd","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","docs","v8.12.0","v8.11.2"],"number":171587,"url":"https://github.com/elastic/kibana/pull/171587","mergeCommit":{"message":"[OAS]
Migrate alerting APIs to v3.1.0
(#171587)","sha":"a50cad6f78caa607d210cd90e12ab11bc18902bd"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171587","number":171587,"mergeCommit":{"message":"[OAS]
Migrate alerting APIs to v3.1.0
(#171587)","sha":"a50cad6f78caa607d210cd90e12ab11bc18902bd"}},{"branch":"8.11","label":"v8.11.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
This commit is contained in:
Lisa Cawley 2023-11-23 06:12:31 -08:00 committed by GitHub
parent 8300029c75
commit 7f1b79c580
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 918 additions and 439 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
openapi: 3.0.1
openapi: 3.1.0
info:
title: Alerting
description: OpenAPI schema for alerting endpoints
version: '0.1'
version: '0.2'
contact:
name: Alerting Team
license:
@ -147,7 +147,8 @@ paths:
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
examples:
- ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
requestBody:
required: true
content:
@ -303,7 +304,8 @@ paths:
schema:
type: string
default: OR
example: OR
examples:
- OR
- name: fields
in: query
description: The fields to return in the `attributes` key of the response.
@ -333,14 +335,16 @@ paths:
schema:
type: integer
default: 1
example: 1
examples:
- 1
- name: per_page
in: query
description: The number of rules to return per page.
schema:
type: integer
default: 20
example: 20
examples:
- 20
- name: search
in: query
description: An Elasticsearch simple_query_string query that filters the objects in the response.
@ -370,7 +374,8 @@ paths:
- asc
- desc
default: desc
example: asc
examples:
- asc
responses:
'200':
description: Indicates a successful call.
@ -429,7 +434,8 @@ paths:
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -437,14 +443,16 @@ paths:
timestamp:
type: string
format: date-time
example: '2023-01-13T01:28:00.280Z'
examples:
- '2023-01-13T01:28:00.280Z'
execution_health:
type: object
description: The timestamp and status of the rule run.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -452,14 +460,16 @@ paths:
timestamp:
type: string
format: date-time
example: '2023-01-13T01:28:00.280Z'
examples:
- '2023-01-13T01:28:00.280Z'
read_health:
type: object
description: The timestamp and status of the rule reading events.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -467,15 +477,18 @@ paths:
timestamp:
type: string
format: date-time
example: '2023-01-13T01:28:00.280Z'
examples:
- '2023-01-13T01:28:00.280Z'
has_permanent_encryption_key:
type: boolean
description: If `false`, the encrypted saved object plugin does not have a permanent encryption key.
example: true
examples:
- true
is_sufficiently_secure:
type: boolean
description: If `false`, security is enabled but TLS is not.
example: true
examples:
- true
examples:
getAlertingHealthResponse:
$ref: '#/components/examples/get_health_response'
@ -662,14 +675,16 @@ paths:
minimum_license_required:
description: The subscriptions required to use the rule type.
type: string
example: basic
examples:
- basic
name:
description: The descriptive name of the rule type.
type: string
producer:
description: An identifier for the application that produces this rule type.
type: string
example: stackAlerts
examples:
- stackAlerts
recovery_action_group:
description: An action group to use when an alert goes from an active state to an inactive one.
type: object
@ -680,7 +695,8 @@ paths:
type: string
rule_task_timeout:
type: string
example: 5m
examples:
- 5m
examples:
getRuleTypesResponse:
$ref: '#/components/examples/get_rule_types_response'
@ -814,7 +830,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.
@ -839,7 +856,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'200':
description: Indicates a successful call.
@ -868,7 +886,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
- $ref: '#/components/parameters/space_id'
requestBody:
required: true
@ -939,7 +958,8 @@ paths:
interval:
type: string
description: The interval format specifies the interval in seconds, minutes, hours or days at which the alert should execute.
example: 10s
examples:
- 10s
tags:
type: array
items:
@ -978,7 +998,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
requestBody:
required: true
content:
@ -1037,7 +1058,8 @@ paths:
interval:
type: string
description: The interval format specifies the interval in seconds, minutes, hours or days at which the alert should execute.
example: 1d
examples:
- 1d
tags:
type: array
items:
@ -1077,7 +1099,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.
@ -1104,7 +1127,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.
@ -1131,7 +1155,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.
@ -1158,7 +1183,8 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.
@ -1185,7 +1211,8 @@ paths:
schema:
type: string
default: OR
example: OR
examples:
- OR
- name: fields
in: query
description: The fields to return in the `attributes` key of the response.
@ -1215,14 +1242,16 @@ paths:
schema:
type: integer
default: 1
example: 1
examples:
- 1
- name: per_page
in: query
description: The number of alerts to return per page.
schema:
type: integer
default: 20
example: 20
examples:
- 20
- name: search
in: query
description: An Elasticsearch `simple_query_string` query that filters the alerts in the response.
@ -1252,7 +1281,8 @@ paths:
- asc
- desc
default: desc
example: asc
examples:
- asc
responses:
'200':
description: Indicates a successful call.
@ -1306,7 +1336,8 @@ paths:
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -1314,14 +1345,16 @@ paths:
timestamp:
type: string
format: date-time
example: '2023-01-13T01:28:00.280Z'
examples:
- '2023-01-13T01:28:00.280Z'
executionHealth:
type: object
description: The timestamp and status of the alert execution.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -1329,14 +1362,16 @@ paths:
timestamp:
type: string
format: date-time
example: '2023-01-13T01:28:00.280Z'
examples:
- '2023-01-13T01:28:00.280Z'
readHealth:
type: object
description: The timestamp and status of the alert reading events.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -1344,15 +1379,18 @@ paths:
timestamp:
type: string
format: date-time
example: '2023-01-13T01:28:00.280Z'
examples:
- '2023-01-13T01:28:00.280Z'
hasPermanentEncryptionKey:
type: boolean
description: If `false`, the encrypted saved object plugin does not have a permanent encryption key.
example: true
examples:
- true
isSufficientlySecure:
type: boolean
description: If `false`, security is enabled but TLS is not.
example: true
examples:
- true
'401':
description: Authorization information is missing or invalid.
content:
@ -1478,14 +1516,16 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
- in: path
name: alertInstanceId
description: An identifier for the alert instance.
required: true
schema:
type: string
example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
examples:
- dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
responses:
'204':
description: Indicates a successful call.
@ -1512,14 +1552,16 @@ paths:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
- in: path
name: alertInstanceId
description: An identifier for the alert instance.
required: true
schema:
type: string
example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
examples:
- dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
responses:
'204':
description: Indicates a successful call.
@ -1553,7 +1595,8 @@ components:
required: true
schema:
type: string
example: default
examples:
- default
rule_id:
in: path
name: ruleId
@ -1561,7 +1604,8 @@ components:
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
examples:
- ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
alert_id:
in: path
name: alertId
@ -1569,7 +1613,8 @@ components:
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
examples:
- ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
schemas:
filter:
type: object
@ -1579,8 +1624,9 @@ components:
type: object
properties:
alias:
type: string
nullable: true
type:
- string
- 'null'
controlledBy:
type: string
disabled:
@ -1615,18 +1661,22 @@ components:
- onActionGroupChange
- onActiveAlert
- onThrottleInterval
example: onActiveAlert
examples:
- onActiveAlert
throttle:
type: string
type:
- string
- 'null'
description: |
The throttle interval, which defines how often an alert generates repeated actions. It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`. NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.
nullable: true
default: null
example: 10m
examples:
- 10m
actions:
type: array
type:
- array
- 'null'
default: []
nullable: true
items:
type: object
required:
@ -1661,12 +1711,12 @@ components:
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: |
@ -1675,20 +1725,24 @@ components:
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
@ -1709,11 +1763,13 @@ components:
type: string
description: |
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.
@ -1721,7 +1777,8 @@ components:
uuid:
type: string
description: A universally unique identifier (UUID) for the action.
example: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61
examples:
- 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61
consumer:
type: string
description: |
@ -1739,7 +1796,8 @@ components:
properties:
interval:
type: string
example: 1m
examples:
- 1m
tags:
type: array
description: The tags for the rule.
@ -2170,7 +2228,8 @@ components:
description: |
The size of the time window (in `timeWindowUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
type: integer
example: 5
examples:
- 5
timewindowunit:
description: |
The type of units for the time window: seconds, minutes, hours, or days.
@ -2180,7 +2239,8 @@ components:
- m
- h
- d
example: m
examples:
- m
size:
description: |
The number of documents to pass to the configured actions when the threshold condition is met.
@ -2200,7 +2260,8 @@ components:
type: array
items:
type: integer
example: 4000
examples:
- 4000
thresholdcomparator:
description: The comparison function for the threshold. For example, "is above", "is above or equals", "is below", "is below or equals", "is between", and "is not between".
type: string
@ -2211,7 +2272,8 @@ components:
- <=
- between
- notBetween
example: '>'
examples:
- '>'
params_es_query_rule:
oneOf:
- type: object
@ -2248,12 +2310,14 @@ components:
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: '#/components/schemas/termsize'
threshold:
@ -2270,7 +2334,8 @@ components:
The comparison function for the threshold. When `searchType` is `esqlQuery`, this property is required and must be set to ">". Since the `threshold` value must be `0`, the result is that an alert occurs whenever the query returns results.
enum:
- '>'
example: '>'
examples:
- '>'
timeField:
$ref: '#/components/schemas/timefield'
timeWindowSize:
@ -2315,7 +2380,8 @@ components:
properties:
language:
type: string
example: kuery
examples:
- kuery
query:
type: string
searchType:
@ -2323,7 +2389,8 @@ components:
type: string
enum:
- searchSource
example: searchSource
examples:
- searchSource
size:
$ref: '#/components/schemas/size'
termField:
@ -2375,7 +2442,8 @@ components:
enum:
- esQuery
default: esQuery
example: esQuery
examples:
- esQuery
size:
$ref: '#/components/schemas/size'
termField:
@ -4357,48 +4425,60 @@ components:
api_key_created_by_user:
type: boolean
description: Indicates whether the API key that is associated with the rule was created by the user.
example: false
examples:
- false
api_key_owner:
type: string
type:
- string
- 'null'
description: |
The owner of the API key that is associated with the rule and used to run background tasks.
nullable: true
example: elastic
examples:
- elastic
consumer:
type: string
description: The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.
example: alerts
examples:
- alerts
created_at:
type: string
description: The date and time that the rule was created.
format: date-time
example: '2022-12-05T23:36:58.284Z'
examples:
- '2022-12-05T23:36:58.284Z'
created_by:
type: string
type:
- string
- 'null'
description: The identifier for the user that created the rule.
nullable: true
example: elastic
examples:
- elastic
enabled:
type: boolean
description: Indicates whether the rule is currently enabled.
example: true
examples:
- true
execution_status:
type: object
properties:
last_duration:
type: integer
example: 55
examples:
- 55
last_execution_date:
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 rule.
example: b530fed0-74f5-11ed-9801-35303b735aef
examples:
- b530fed0-74f5-11ed-9801-35303b735aef
last_run:
type: object
properties:
@ -4415,39 +4495,49 @@ components:
type: integer
outcome:
type: string
example: succeeded
examples:
- succeeded
outcome_msg:
type: array
type:
- array
- 'null'
items:
type: string
nullable: true
outcome_order:
type: integer
warning:
type: string
nullable: true
example: null
type:
- string
- 'null'
examples:
- null
muted_alert_ids:
type: array
nullable: true
type:
- array
- 'null'
items:
type: string
mute_all:
type: boolean
example: false
examples:
- false
name:
type: string
description: The name of the rule.
example: cluster_health_rule
examples:
- cluster_health_rule
next_run:
type: string
type:
- string
- 'null'
format: date-time
nullable: true
example: '2022-12-06T00:14:43.818Z'
examples:
- '2022-12-06T00:14:43.818Z'
notify_when:
type: string
type:
- string
- 'null'
description: Indicates how often alerts generate actions.
nullable: true
params:
type: object
description: The parameters for the rule.
@ -4459,7 +4549,8 @@ components:
type: string
description: |
The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`.
example: monitoring_alert_cluster_health
examples:
- monitoring_alert_cluster_health
running:
type: boolean
description: Indicates whether the rule is running.
@ -4467,7 +4558,8 @@ components:
$ref: '#/components/schemas/schedule'
scheduled_task_id:
type: string
example: b530fed0-74f5-11ed-9801-35303b735aef
examples:
- b530fed0-74f5-11ed-9801-35303b735aef
tags:
$ref: '#/components/schemas/tags'
throttle:
@ -4475,26 +4567,31 @@ components:
updated_at:
type: string
description: The date and time that the rule was updated most recently.
example: '2022-12-05T23:36:58.284Z'
examples:
- '2022-12-05T23:36:58.284Z'
updated_by:
type: string
type:
- string
- 'null'
description: The identifier for the user that updated this rule most recently.
nullable: true
example: elastic
examples:
- elastic
401_response:
type: object
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
404_response:
@ -4502,15 +4599,18 @@ components:
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
update_rule_request:
@ -4528,7 +4628,8 @@ components:
name:
type: string
description: The name of the rule.
example: cluster_health_rule
examples:
- cluster_health_rule
notify_when:
$ref: '#/components/schemas/notify_when'
params:
@ -4569,53 +4670,66 @@ components:
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
@ -4626,22 +4740,27 @@ components:
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
examples:
create_es_query_esql_rule_request:
summary: Create an Elasticsearch query rule that uses Elasticsearch Query Language (ES|QL).

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,6 +1,7 @@
type: array
type:
- "array"
- "null"
default: []
nullable: true
items:
type: object
required:
@ -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: >
@ -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
@ -87,11 +93,13 @@ 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.
@ -99,4 +107,5 @@ items:
uuid:
type: string
description: A universally unique identifier (UUID) for the action.
example: 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61
examples:
- 1c7a1280-f28c-4e06-96b2-e4e5f05d1d61

View file

@ -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
@ -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

View file

@ -5,8 +5,9 @@ properties:
type: object
properties:
alias:
type: string
nullable: true
type:
- "string"
- "null"
controlledBy:
type: string
disabled:

View file

@ -8,4 +8,5 @@ enum:
- onActionGroupChange
- onActiveAlert
- onThrottleInterval
example: onActiveAlert
examples:
- onActiveAlert

View file

@ -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:
@ -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:
@ -105,7 +108,8 @@ oneOf:
properties:
language:
type: string
example: kuery
examples:
- kuery
query:
type: string
searchType:
@ -113,7 +117,8 @@ oneOf:
type: string
enum:
- searchSource
example: searchSource
examples:
- searchSource
size:
$ref: 'size.yaml'
termField:
@ -165,7 +170,8 @@ oneOf:
enum:
- esQuery
default: esQuery
example: esQuery
examples:
- esQuery
size:
$ref: 'size.yaml'
termField:

View file

@ -25,48 +25,60 @@ properties:
api_key_created_by_user:
type: boolean
description: Indicates whether the API key that is associated with the rule was created by the user.
example: false
examples:
- false
api_key_owner:
type: string
type:
- "string"
- "null"
description: >
The owner of the API key that is associated with the rule and used to run background tasks.
nullable: true
example: elastic
examples:
- elastic
consumer:
type: string
description: The application or feature that owns the rule. For example, `alerts`, `apm`, `discover`, `infrastructure`, `logs`, `metrics`, `ml`, `monitoring`, `securitySolution`, `siem`, `stackAlerts`, or `uptime`.
example: alerts
examples:
- alerts
created_at:
type: string
description: The date and time that the rule was created.
format: date-time
example: '2022-12-05T23:36:58.284Z'
examples:
- '2022-12-05T23:36:58.284Z'
created_by:
type: string
type:
- "string"
- "null"
description: The identifier for the user that created the rule.
nullable: true
example: elastic
examples:
- elastic
enabled:
type: boolean
description: Indicates whether the rule is currently enabled.
example: true
examples:
- true
execution_status:
type: object
properties:
last_duration:
type: integer
example: 55
examples:
- 55
last_execution_date:
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 rule.
example: b530fed0-74f5-11ed-9801-35303b735aef
examples:
- b530fed0-74f5-11ed-9801-35303b735aef
last_run:
type: object
properties:
@ -83,39 +95,49 @@ properties:
type: integer
outcome:
type: string
example: succeeded
examples:
- succeeded
outcome_msg:
type: array
type:
- "array"
- "null"
items:
type: string
nullable: true
outcome_order:
type: integer
warning:
type: string
nullable: true
example: null
type:
- "string"
- "null"
examples:
- null
muted_alert_ids:
type: array
nullable: true
type:
- "array"
- "null"
items:
type: string
mute_all:
type: boolean
example: false
examples:
- false
name:
type: string
description: The name of the rule.
example: cluster_health_rule
examples:
- cluster_health_rule
next_run:
type: string
type:
- "string"
- "null"
format: date-time
nullable: true
example: '2022-12-06T00:14:43.818Z'
examples:
- '2022-12-06T00:14:43.818Z'
notify_when:
type: string
type:
- "string"
- "null"
description: Indicates how often alerts generate actions.
nullable: true
params:
type: object
description: The parameters for the rule.
@ -127,7 +149,8 @@ properties:
type: string
description: >
The identifier for the type of rule. For example, `.es-query`, `.index-threshold`, `logs.alert.document.count`, `monitoring_alert_cluster_health`, `siem.thresholdRule`, or `xpack.ml.anomaly_detection_alert`.
example: monitoring_alert_cluster_health
examples:
- monitoring_alert_cluster_health
running:
type: boolean
description: Indicates whether the rule is running.
@ -135,7 +158,8 @@ properties:
$ref: 'schedule.yaml'
scheduled_task_id:
type: string
example: b530fed0-74f5-11ed-9801-35303b735aef
examples:
- b530fed0-74f5-11ed-9801-35303b735aef
tags:
$ref: 'tags.yaml'
throttle:
@ -143,9 +167,12 @@ properties:
updated_at:
type: string
description: The date and time that the rule was updated most recently.
example: '2022-12-05T23:36:58.284Z'
examples:
- '2022-12-05T23:36:58.284Z'
updated_by:
type: string
type:
- "string"
- "null"
description: The identifier for the user that updated this rule most recently.
nullable: true
example: elastic
examples:
- elastic

View file

@ -3,4 +3,5 @@ description: The check interval, which specifies how frequently the rule conditi
properties:
interval:
type: string
example: 1m
examples:
- 1m

View file

@ -4,4 +4,5 @@ description: >
type: array
items:
type: integer
example: 4000
examples:
- 4000

View file

@ -7,4 +7,5 @@ enum:
- "<="
- between
- notBetween
example: ">"
examples:
- ">"

View file

@ -1,9 +1,11 @@
type: string
type:
- "string"
- "null"
description: >
The throttle interval, which defines how often an alert generates repeated actions.
It is specified in seconds, minutes, hours, or days and is applicable only if `notify_when` is set to `onThrottleInterval`.
NOTE: You cannot specify the throttle interval at both the rule and action level. The recommended method is to set it for each action.
If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.
nullable: true
default: null
example: 10m
examples:
- 10m

View file

@ -2,4 +2,5 @@ description: >
The size of the time window (in `timeWindowUnit` units), which determines how far back to search for documents.
Generally it should be a value higher than the rule check interval to avoid gaps in detection.
type: integer
example: 5
examples:
- 5

View file

@ -6,4 +6,5 @@ enum:
- m
- h
- d
example: "m"
examples:
- "m"

View file

@ -12,7 +12,8 @@ properties:
name:
type: string
description: The name of the rule.
example: cluster_health_rule
examples:
- cluster_health_rule
notify_when:
$ref: 'notify_when.yaml'
params:

View file

@ -1,8 +1,8 @@
openapi: 3.0.1
openapi: 3.1.0
info:
title: Alerting
description: OpenAPI schema for alerting endpoints
version: '0.1'
version: '0.2'
contact:
name: Alerting Team
license:

View file

@ -28,7 +28,8 @@ get:
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -36,14 +37,16 @@ get:
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
examples:
- "2023-01-13T01:28:00.280Z"
execution_health:
type: object
description: The timestamp and status of the rule run.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -51,14 +54,16 @@ get:
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
examples:
- "2023-01-13T01:28:00.280Z"
read_health:
type: object
description: The timestamp and status of the rule reading events.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -66,15 +71,18 @@ get:
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
examples:
- "2023-01-13T01:28:00.280Z"
has_permanent_encryption_key:
type: boolean
description: If `false`, the encrypted saved object plugin does not have a permanent encryption key.
example: true
examples:
- true
is_sufficiently_secure:
type: boolean
description: If `false`, security is enabled but TLS is not.
example: true
examples:
- true
examples:
getAlertingHealthResponse:
$ref: '../components/examples/get_health_response.yaml'

View file

@ -90,7 +90,8 @@ post:
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
examples:
- ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
requestBody:
required: true
content:

View file

@ -186,14 +186,16 @@ get:
minimum_license_required:
description: The subscriptions required to use the rule type.
type: string
example: basic
examples:
- basic
name:
description: The descriptive name of the rule type.
type: string
producer:
description: An identifier for the application that produces this rule type.
type: string
example: stackAlerts
examples:
- stackAlerts
recovery_action_group:
description: An action group to use when an alert goes from an active state to an inactive one.
type: object
@ -204,7 +206,8 @@ get:
type: string
rule_task_timeout:
type: string
example: 5m
examples:
- 5m
examples:
getRuleTypesResponse:
$ref: '../components/examples/get_rule_types_response.yaml'

View file

@ -19,7 +19,8 @@ get:
schema:
type: string
default: OR
example: OR
examples:
- OR
- name: fields
in: query
description: The fields to return in the `attributes` key of the response.
@ -53,14 +54,16 @@ get:
schema:
type: integer
default: 1
example: 1
examples:
- 1
- name: per_page
in: query
description: The number of rules to return per page.
schema:
type: integer
default: 20
example: 20
examples:
- 20
- name: search
in: query
description: An Elasticsearch simple_query_string query that filters the objects in the response.
@ -91,7 +94,8 @@ get:
- asc
- desc
default: desc
example: asc
examples:
- asc
responses:
'200':
description: Indicates a successful call.

View file

@ -17,7 +17,8 @@ get:
schema:
type: string
default: OR
example: OR
examples:
- OR
- name: fields
in: query
description: The fields to return in the `attributes` key of the response.
@ -51,14 +52,16 @@ get:
schema:
type: integer
default: 1
example: 1
examples:
- 1
- name: per_page
in: query
description: The number of alerts to return per page.
schema:
type: integer
default: 20
example: 20
examples:
- 20
- name: search
in: query
description: An Elasticsearch `simple_query_string` query that filters the alerts in the response.
@ -89,7 +92,8 @@ get:
- asc
- desc
default: desc
example: asc
examples:
- asc
responses:
'200':
description: Indicates a successful call.

View file

@ -26,7 +26,8 @@ get:
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -34,14 +35,16 @@ get:
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
examples:
- "2023-01-13T01:28:00.280Z"
executionHealth:
type: object
description: The timestamp and status of the alert execution.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -49,14 +52,16 @@ get:
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
examples:
- "2023-01-13T01:28:00.280Z"
readHealth:
type: object
description: The timestamp and status of the alert reading events.
properties:
status:
type: string
example: ok
examples:
- ok
enum:
- error
- ok
@ -64,15 +69,18 @@ get:
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
examples:
- "2023-01-13T01:28:00.280Z"
hasPermanentEncryptionKey:
type: boolean
description: If `false`, the encrypted saved object plugin does not have a permanent encryption key.
example: true
examples:
- true
isSufficientlySecure:
type: boolean
description: If `false`, security is enabled but TLS is not.
example: true
examples:
- true
'401':
description: Authorization information is missing or invalid.
content:

View file

@ -16,7 +16,8 @@ delete:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.
@ -42,7 +43,8 @@ get:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'200':
description: Indicates a successful call.
@ -72,7 +74,8 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
- $ref: '../components/parameters/space_id.yaml'
requestBody:
required: true
@ -146,7 +149,8 @@ post:
interval:
type: string
description: The interval format specifies the interval in seconds, minutes, hours or days at which the alert should execute.
example: "10s"
examples:
- "10s"
tags:
type: array
items:
@ -189,7 +193,8 @@ put:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
requestBody:
required: true
content:
@ -251,7 +256,8 @@ put:
interval:
type: string
description: The interval format specifies the interval in seconds, minutes, hours or days at which the alert should execute.
example: "1d"
examples:
- "1d"
tags:
type: array
items:

View file

@ -14,7 +14,8 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.

View file

@ -14,7 +14,8 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.

View file

@ -14,7 +14,8 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.

View file

@ -14,7 +14,8 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
responses:
'204':
description: Indicates a successful call.

View file

@ -14,14 +14,16 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
- in: path
name: alertInstanceId
description: An identifier for the alert instance.
required: true
schema:
type: string
example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
examples:
- dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
responses:
'204':
description: Indicates a successful call.

View file

@ -14,14 +14,16 @@ post:
required: true
schema:
type: string
example: 41893910-6bca-11eb-9e0d-85d233e3ee35
examples:
- 41893910-6bca-11eb-9e0d-85d233e3ee35
- in: path
name: alertInstanceId
description: An identifier for the alert instance.
required: true
schema:
type: string
example: dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
examples:
- dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2
responses:
'204':
description: Indicates a successful call.