Skip to content

Commit

Permalink
[DOCS] Add specifications for deprecated alert APIs (elastic#149655)
Browse files Browse the repository at this point in the history
(cherry picked from commit 59488af)
  • Loading branch information
lcawl committed Feb 2, 2023
1 parent 5838cd7 commit eb3e650
Show file tree
Hide file tree
Showing 15 changed files with 4,189 additions and 21 deletions.
1,118 changes: 1,118 additions & 0 deletions docs/api-generated/rules/rule-apis-passthru.asciidoc

Large diffs are not rendered by default.

1,313 changes: 1,313 additions & 0 deletions x-pack/plugins/alerting/docs/openapi/bundled.json

Large diffs are not rendered by default.

858 changes: 858 additions & 0 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
@@ -0,0 +1,82 @@
title: Legacy alert response properties
type: object
properties:
actions:
type: array
items:
type: object
alertTypeId:
type: string
example: ".index-threshold"
apiKeyOwner:
type: string
nullable: true
example: elastic
createdAt:
type: string
description: The date and time that the alert was created.
format: date-time
example: '2022-12-05T23:36:58.284Z'
createdBy:
type: string
description: The identifier for the user that created the alert.
example: elastic
enabled:
type: boolean
description: Indicates whether the alert is currently enabled.
example: true
executionStatus:
type: object
properties:
lastExecutionDate:
type: string
format: date-time
example: '2022-12-06T00:13:43.890Z'
status:
type: string
example: ok
id:
type: string
description: The identifier for the alert.
example: b530fed0-74f5-11ed-9801-35303b735aef
muteAll:
type: boolean
example: false
mutedInstanceIds:
type: array
nullable: true
items:
type: string
name:
type: string
description: The name of the alert.
example: my alert
notifyWhen:
type: string
example: onActionGroupChange
params:
type: object
additionalProperties: true
schedule:
type: object
properties:
interval:
type: string
scheduledTaskId:
type: string
example: b530fed0-74f5-11ed-9801-35303b735aef
tags:
type: array
items:
type: string
throttle:
type: string
nullable: true
updatedAt:
type: string
example: '2022-12-05T23:36:58.284Z'
updatedBy:
type: string
description: The identifier for the user that updated this alert most recently.
nullable: true
example: elastic
41 changes: 20 additions & 21 deletions x-pack/plugins/alerting/docs/openapi/entrypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,27 @@ paths:
$ref: 'paths/s@{spaceid}@api@alerting@rule@{ruleid}@alert@{alertid}@_mute.yaml'
'/s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute':
$ref: 'paths/s@{spaceid}@api@alerting@rule@{ruleid}@alert@{alertid}@_unmute.yaml'

# Deprecated APIs
# '/s/{spaceId}/api/alerts/alert/{alertId}':
# $ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}.yaml'
# '/s/{spaceId}/api/alerts/alert/{alertId}/_disable':
# $ref: 'paths/s@{spaceid}@api@alertss@alert@{alertid}@_disable.yaml'
# '/s/{spaceId}/api/alerts/alert/{alertId}/_enable':
# $ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_enable.yaml'
# '/s/{spaceId}/api/alerts/alert/{alertId}/_mute_all':
# $ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_mute_all.yaml'
# '/s/{spaceId}/api/alerts/alert/{alertId}/_unmute_all':
# $ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_unmute_all.yaml'
# '/s/{spaceId}/api/alerts/alerts/_find':
# $ref: 'paths/s@{spaceid}@api@alerts@_find.yaml'
# '/s/{spaceId}/api/alerts/alerts/_health':
# $ref: 'paths/s@{spaceid}@api@alerts@_health.yaml'
# '/s/{spaceId}/api/alerts/alerts/list_alert_types':
# $ref: 'paths/s@{spaceid}@api@alerts@list_alert_types.yaml'
# '/s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute':
# $ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@alert_instance@{alertinstanceid}@_mute.yaml'
# '/s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute':
# $ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@alert_instance@{alertinstanceid}@_unmute.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}/_disable':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_disable.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}/_enable':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_enable.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}/_mute_all':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_mute_all.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}/_unmute_all':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@_unmute_all.yaml'
'/s/{spaceId}/api/alerts/alerts/_find':
$ref: 'paths/s@{spaceid}@api@alerts@_find.yaml'
'/s/{spaceId}/api/alerts/alerts/_health':
$ref: 'paths/s@{spaceid}@api@alerts@_health.yaml'
'/s/{spaceId}/api/alerts/alerts/list_alert_types':
$ref: 'paths/s@{spaceid}@api@alerts@list_alert_types.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_mute':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@alert_instance@{alertinstanceid}@_mute.yaml'
'/s/{spaceId}/api/alerts/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute':
$ref: 'paths/s@{spaceid}@api@alerts@alert@{alertid}@alert_instance@{alertinstanceid}@_unmute.yaml'

components:
securitySchemes:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
get:
summary: Retrieves a paginated set of alerts.
operationId: legacyFindAlerts
deprecated: true
description: >
Deprecated in 7.13.0. Use the find rules API instead.
NOTE: Alert `params` are stored as a flattened field type and analyzed as keywords.
As alerts change in Kibana, the results on each page of the response also change.
Use the find API for traditional paginated results, but avoid using it to export large amounts of data.
tags:
- alerting
parameters:
- $ref: '../components/parameters/space_id.yaml'
- name: default_search_operator
in: query
description: The default operator to use for the `simple_query_string`.
schema:
type: string
default: OR
example: OR
- name: fields
in: query
description: The fields to return in the `attributes` key of the response.
schema:
type: array
items:
type: string
- name: filter
in: query
description: >
A KQL string that you filter with an attribute from your saved object.
It should look like `savedObjectType.attributes.title: "myTitle"`.
However, if you used a direct attribute of a saved object, such as
`updatedAt`, you must define your filter, for example,
`savedObjectType.updatedAt > 2018-12-22`.
schema:
type: string
- name: has_reference
in: query
description: Filters the rules that have a relation with the reference objects with a specific type and identifier.
schema:
type: object
properties:
id:
type: string
type:
type: string
- name: page
in: query
description: The page number to return.
schema:
type: integer
default: 1
example: 1
- name: per_page
in: query
description: The number of alerts to return per page.
schema:
type: integer
default: 20
example: 20
- name: search
in: query
description: An Elasticsearch `simple_query_string` query that filters the alerts in the response.
schema:
type: string
- name: search_fields
in: query
description: The fields to perform the `simple_query_string` parsed query against.
schema:
oneOf:
- type: string
- type: array
items:
type: string
- name: sort_field
in: query
description: >
Determines which field is used to sort the results. The field must exist
in the `attributes` key of the response.
schema:
type: string
- name: sort_order
in: query
description: Determines the sort order.
schema:
type: string
enum:
- asc
- desc
default: desc
example: asc
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../components/schemas/alert_response_properties.yaml'
page:
type: integer
perPage:
type: integer
total:
type: integer
'401':
description: Authorization information is missing or invalid.
content:
application/json:
schema:
$ref: '../components/schemas/401_response.yaml'
servers:
- url: https://localhost:5601
servers:
- url: https://localhost:5601
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
get:
summary: Retrieves the health status of the alerting framework.
operationId: legacyGetAlertingHealth
deprecated: true
description: Deprecated in 7.13.0. Use the get alerting framework health API instead.
tags:
- alerting
parameters:
- $ref: '../components/parameters/space_id.yaml'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
alertingFrameworkHealth:
type: object
description: >
Three substates identify the health of the alerting framework: `decryptionHealth`, `executionHealth`, and `readHealth`.
properties:
decryptionHealth:
type: object
description: The timestamp and status of the alert decryption.
properties:
status:
type: string
example: ok
enum:
- error
- ok
- warn
timestamp:
type: string
format: date-time
example: "2023-01-13T01:28:00.280Z"
executionHealth:
type: object
description: The timestamp and status of the alert execution.
properties:
status:
type: string
example: ok
enum:
- error
- ok
- warn
timestamp:
type: string
format: date-time
example: "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
enum:
- error
- ok
- warn
timestamp:
type: string
format: date-time
example: "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
isSufficientlySecure:
type: boolean
description: If `false`, security is enabled but TLS is not.
example: true
'401':
description: Authorization information is missing or invalid.
content:
application/json:
schema:
$ref: '../components/schemas/401_response.yaml'
servers:
- url: https://localhost:5601
Loading

0 comments on commit eb3e650

Please sign in to comment.