رفتن به محتوا
cloudhostمستندات
مرجع API

هشدارها

قاعدهٔ هشدار روی شاخص‌های برنامه و فانکشن.

توضیح هر مسیر به انگلیسی است، همان متنی که مرجع از کد ساخته می‌شود. مسیرها، نام فیلدها و کدها همان‌اند که در درخواست می‌نویسید.
GET/v1/alerts

Rules and recent events#

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پاسخ

200object

  • rulesAlertRule[]الزامی
    • idstring (uuid)الزامی
    • projectstringالزامی
    • kindstring
    • metricstringالزامی
    • opstringالزامی
    • thresholdnumberالزامی
    • window_mininteger
    • channelsAlertChannels
    • statestringالزامی

      one of ok, firing

    • last_valuenumber | null
    • changed_atstring (date-time) | null
  • eventsAlertEvent[]الزامی
    • rule_idstring (uuid)
    • statestring
    • valuenumber
    • sentobject
    • atstring (date-time)
    • namestring
    • metricstring

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/alerts" \
  -H "Authorization: Bearer $KEY"
POST/v1/alerts

Create a rule#

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

بدنهٔ درخواستapplication/json

  • projectstringالزامی
  • kindstring

    one of function, app · default "function"

  • metricstringالزامی

    one of error_rate, p95_ms, p99_ms, requests

  • opstringالزامی

    one of >, <

  • thresholdnumber | stringالزامی
  • window_mininteger

    1–60 · default 5

  • channelsAlertChannelsالزامی

پاسخ

201object

  • idstring (uuid)الزامی

خطاها

وضعیتتوضیح
400Bad request: bad_metric, bad_op, bad_threshold, bad_window, bad_webhook, no_channel, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: 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

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: 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}/test

Send a test notification#

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • idstring (uuid)مسیرالزامی

    rule id

پاسخ

200object

  • sentobjectالزامی

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/alerts/88e2fe1d-6d75-4de5-8c8f-27380ec66903/test" \
  -H "Authorization: Bearer $KEY"