获取监测器 API
编辑获取监测器 API编辑
使用 config_id 获取监测器。如果未找到监测器,则此 API 将返回 404 错误。
请求编辑
GET <kibana 主机>:<端口>/api/synthetics/monitors/<config_id>
GET <kibana 主机>:<端口>/s/<空间 ID>/api/synthetics/monitors/<config_id>
先决条件编辑
您必须在 Kibana 功能权限的“可观测性”部分中,对“Synthetics”功能具有 读取
权限。
路径参数编辑
-
config_id
- (必填,字符串)要更新的监测器的 ID。
-
space_id
- (可选,字符串)空间的标识符。如果未在 URL 中提供
space_id
,则使用默认空间。
示例编辑
以下是如何使用此 API 的示例
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" }