forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Uptime] Settings public API (elastic#163400)
- Loading branch information
Showing
18 changed files
with
365 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[uptime-apis]] | ||
== Uptime APIs | ||
|
||
The following APIs are available for Uptime. | ||
|
||
* <<get-settings-api, Get settings API>> to get a settings | ||
|
||
* <<update-settings-api, Update settings API>> to update the attributes for existing settings | ||
|
||
include::uptime/get-settings.asciidoc[leveloffset=+1] | ||
include::uptime/update-settings.asciidoc[leveloffset=+1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[[get-settings-api]] | ||
== Get settings API | ||
++++ | ||
<titleabbrev>Get settings</titleabbrev> | ||
++++ | ||
|
||
Retrieve uptime settings existing settings. | ||
|
||
[[get-settings-api-request]] | ||
=== {api-request-title} | ||
|
||
`GET <kibana host>:<port>/api/uptime/settings` | ||
|
||
`GET <kibana host>:<port>/s/<space_id>/api/uptime/settings` | ||
|
||
=== {api-prereq-title} | ||
|
||
You must have `read` privileges for the *uptime* feature in *{observability}* section of the | ||
<<kibana-feature-privileges,{kib} feature privileges>>. | ||
|
||
The API returns the following: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
{ | ||
"heartbeatIndices": "heartbeat-8*", | ||
"certExpirationThreshold": 30, | ||
"certAgeThreshold": 730, | ||
"defaultConnectors": [ | ||
"08990f40-09c5-11ee-97ae-912b222b13d4", | ||
"db25f830-2318-11ee-9391-6b0c030836d6" | ||
], | ||
"defaultEmail": { | ||
"to": [], | ||
"cc": [], | ||
"bcc": [] | ||
} | ||
} | ||
-------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
[[update-settings-api]] | ||
== Update settings API | ||
++++ | ||
<titleabbrev>Update settings</titleabbrev> | ||
++++ | ||
|
||
Updates uptime settings attributes like heartbeatIndices, certExpirationThreshold, certAgeThreshold, defaultConnectors or defaultEmail | ||
|
||
=== {api-request-title} | ||
|
||
`PUT <kibana host>:<port>/api/uptime/settings` | ||
|
||
`PUT <kibana host>:<port>/s/<space_id>/api/uptime/settings` | ||
|
||
=== {api-prereq-title} | ||
|
||
You must have `all` privileges for the *uptime* feature in *{observability}* section of the | ||
<<kibana-feature-privileges,{kib} feature privileges>>. | ||
|
||
[[settings-api-update-path-params]] | ||
==== Path parameters | ||
|
||
`space_id`:: | ||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. | ||
|
||
[[api-update-request-body]] | ||
==== Request body | ||
|
||
A partial update is supported, provided settings keys will be merged with existing settings. | ||
|
||
`heartbeatIndices`:: | ||
(Optional, string) index pattern string to be used within uptime app/alerts to query heartbeat data. Defaults to `heartbeat-*`. | ||
|
||
|
||
`certExpirationThreshold`:: | ||
(Optional, number) Number of days before a certificate expires to trigger an alert. Defaults to `30`. | ||
|
||
`certAgeThreshold`:: | ||
(Optional, number) Number of days after a certificate is created to trigger an alert. Defaults to `730`. | ||
|
||
`defaultConnectors`:: | ||
(Optional, array) List of connector IDs to be used as default connectors for new alerts. Defaults to `[]`. | ||
|
||
`defaultEmail`:: | ||
(Optional, object) Default email configuration for new alerts. Defaults to `{"to": [], "cc": [], "bcc": []}`. | ||
|
||
[[settings-api-update-example]] | ||
==== Example | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
PUT api/uptime/settings | ||
{ | ||
"heartbeatIndices": "heartbeat-8*", | ||
"certExpirationThreshold": 30, | ||
"certAgeThreshold": 730, | ||
"defaultConnectors": [ | ||
"08990f40-09c5-11ee-97ae-912b222b13d4", | ||
"db25f830-2318-11ee-9391-6b0c030836d6" | ||
], | ||
"defaultEmail": { | ||
"to": [], | ||
"cc": [], | ||
"bcc": [] | ||
} | ||
} | ||
-------------------------------------------------- | ||
|
||
The API returns the following: | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"heartbeatIndices": "heartbeat-8*", | ||
"certExpirationThreshold": 30, | ||
"certAgeThreshold": 730, | ||
"defaultConnectors": [ | ||
"08990f40-09c5-11ee-97ae-912b222b13d4", | ||
"db25f830-2318-11ee-9391-6b0c030836d6" | ||
], | ||
"defaultEmail": { | ||
"to": [], | ||
"cc": [], | ||
"bcc": [] | ||
} | ||
} | ||
-------------------------------------------------- | ||
[[settings-api-partial-update-example]] | ||
==== Partial update example | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
PUT api/uptime/settings | ||
{ | ||
"heartbeatIndices": "heartbeat-8*", | ||
} | ||
-------------------------------------------------- | ||
|
||
The API returns the following: | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"heartbeatIndices": "heartbeat-8*", | ||
"certExpirationThreshold": 30, | ||
"certAgeThreshold": 730, | ||
"defaultConnectors": [ | ||
"08990f40-09c5-11ee-97ae-912b222b13d4", | ||
"db25f830-2318-11ee-9391-6b0c030836d6" | ||
], | ||
"defaultEmail": { | ||
"to": [], | ||
"cc": [], | ||
"bcc": [] | ||
} | ||
} | ||
-------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.