kibana/docs/api/synthetics/monitors/get-monitor-api.asciidoc
Shahzad 29e8394c3d
[Synthetics] Monitor CRUD's public api's (#169928)
## Summary

Part of https://github.com/elastic/kibana/issues/169547

View docs at [Changed
pages](https://kibana_169928.docs-preview.app.elstc.co/diff)

Add monitor api public api 

### Testing

Make sure you have some monitors populated before testing this PR and
before switching to the branch

- [ ] Try editing already added monitors via API
- [ ] Test adding monitors via API, and then edit those via and
subsqeuently try editing via API the same monitor
- [ ] Test editing monitors via API
- [ ] Test deleting monitors via API
- [ ] Test getting monitors via API
- [ ] Testing private as well public locations

Basic workflow that i am interesting in testing is to make sure, you can
add/edit via both API and UI without any issues


Test each of HTTP/TCP/ICMP browser examples

<img width="1728" alt="image"
src="3575d93a-5f04-4c80-ac62-038643f466f8">

---------

Co-authored-by: Justin Kambic <jk@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2024-04-12 15:10:11 -04:00

93 lines
2.3 KiB
Text

[[get-monitor-api]]
== Get Monitor API
++++
<titleabbrev>Get monitor</titleabbrev>
++++
Get a monitor with the config_id. If the monitor is not found, then this API returns a 404 error.
[[get-monitor-api-req]]
=== {api-request-title}
`GET <kibana host>:<port>/api/synthetics/monitors/<config_id>`
`GET <kibana host>:<port>/s/<space_id>/api/synthetics/monitors/<config_id>`
=== {api-prereq-title}
You must have `read` privileges for the *Synthetics* feature in the *{observability}* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.
[[get-monitor-api-path-params]]
=== {api-path-parms-title}
`config_id`::
(Required, string) The ID of the monitor that you want to update.
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in
the URL, the default space is used.
==== Examples
Here is an example of how to use this API:
[source,sh]
--------------------------------------------------
GET /api/synthetics/monitors/<config_id>
{
"type": "http",
"enabled": true,
"alert": {
"status": {
"enabled": true
},
"tls": {
"enabled": true
}
},
"schedule": {
"number": "3",
"unit": "m"
},
"config_id": "a8188705-d01e-4bb6-87a1-64fa5e4b07ec",
"timeout": "16",
"name": "am i something",
"locations": [
{
"id": "us_central",
"label": "North America - US Central",
"geo": {
"lat": 41.25,
"lon": -95.86
},
"isServiceManaged": true
}
],
"namespace": "default",
"origin": "ui",
"id": "a8188705-d01e-4bb6-87a1-64fa5e4b07ec",
"max_attempts": 2,
"__ui": {
"is_tls_enabled": false
},
"max_redirects": "0",
"response.include_body": "on_error",
"response.include_headers": true,
"check.request.method": "GET",
"mode": "any",
"response.include_body_max_bytes": "1024",
"ipv4": true,
"ipv6": true,
"ssl.verification_mode": "full",
"ssl.supported_protocols": [
"TLSv1.1",
"TLSv1.2",
"TLSv1.3"
],
"revision": 13,
"created_at": "2023-11-08T08:45:29.334Z",
"updated_at": "2023-12-18T20:31:44.770Z",
"url": "https://fast.com"
}
--------------------------------------------------