مرجع API
هشدارها
قاعدهٔ هشدار روی شاخصهای برنامه و فانکشن.
توضیح هر مسیر به انگلیسی است، همان متنی که مرجع از کد ساخته میشود. مسیرها، نام فیلدها و کدها هماناند که در درخواست مینویسید.
GET
/v1/alertsRules and recent events#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پاسخ
200object
rulesAlertRule[]الزامیidstring (uuid)الزامیprojectstringالزامیkindstringmetricstringالزامیopstringالزامیthresholdnumberالزامیwindow_minintegerchannelsAlertChannelsemailbooleansmsbooleanwebhookstringbaleobjecttokenstringchatstring
eitaaobjecttokenstringchatstring
statestringالزامیone of
ok,firinglast_valuenumber | nullchanged_atstring (date-time) | null
eventsAlertEvent[]الزامیrule_idstring (uuid)statestringvaluenumbersentobjectatstring (date-time)namestringmetricstring
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/alerts" \
-H "Authorization: Bearer $KEY"POST
/v1/alertsCreate a rule#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
بدنهٔ درخواستapplication/json
projectstringالزامیkindstringone of
function,app· default"function"metricstringالزامیone of
error_rate,p95_ms,p99_ms,requestsopstringالزامیone of
>,<thresholdnumber | stringالزامیwindow_mininteger1–60 · default
5channelsAlertChannelsالزامیemailbooleansmsbooleanwebhookstringbaleobjecttokenstringchatstring
eitaaobjecttokenstringchatstring
پاسخ
201object
idstring (uuid)الزامی
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_metric, bad_op, bad_threshold, bad_window, bad_webhook, no_channel, bad_json |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/alerts" \
-H "Authorization: Bearer $KEY" \
-d '{"project":"my-api","metric":"error_rate","op":">","threshold":1,"channels":{"email":true,"sms":true,"webhook":"https://example.com","bale":{"token":"…","chat":"…"},"eitaa":{"token":"…","chat":"…"}}}'DELETE
/v1/alerts/{id}Delete a rule#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
idstring (uuid)مسیرالزامیrule id
پاسخ
200object
deletedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X DELETE "https://api.ibel.ai/v1/alerts/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
-H "Authorization: Bearer $KEY"POST
/v1/alerts/{id}/testSend a test notification#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
idstring (uuid)مسیرالزامیrule id
پاسخ
200object
sentobjectالزامی
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/alerts/88e2fe1d-6d75-4de5-8c8f-27380ec66903/test" \
-H "Authorization: Bearer $KEY"