hosting
GET /v1/sites/{siteId}/metrics
Get a site's current usage metrics.
توثيقِ شناخت
ایک API کلید بطور بیر ٹوکن (bearer token) ارسال کریں۔ یہ اینڈ پوائنٹ اسپیسیفیکیشن میں کسی مخصوص اجازت کا ذکر نہیں کرتا، اس لیے فرض کرنے کے بجائے اپنی کلید کو کم از کم درکار اجازت دیں اور رسپانس چیک کریں۔
یہ اینڈ پوائنٹ کوئی آرگنائزیشن آئی ڈی نہیں لیتا۔ آپ کی کلید پہلے ہی اس آرگنائزیشن کی شناخت کرتی ہے جس سے یہ تعلق رکھتی ہے، اور اس کا جواب اسی کے مطابق محدود ہوتا ہے۔
آزمائیں
کوئی بھی چیز جو زاویہ دار قوسین میں ہو اسے اپنی اقدار سے بدلیں، اور کلیدی پلیس ہولڈر کو اپنے ڈیش بورڈ کی کسی کلید سے بدلیں۔
curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/metrics \
-H "Authorization: Bearer zdk_live_…"لاگ ان ہیں؟ آپ کے ڈیش بورڈ میں موجود API کنسول آپ کی حقیقی تنظیم کی آئی ڈی اور آپ کی اپنی کلید خود بخود پُر کر دیتا ہے، اور لائیو API پر درخواست چلاتا ہے تاکہ آپ اصل ردعمل دیکھ سکیں۔ اس اینڈ پوائنٹ کو API کنسول میں کھولیں
تفصیلات
Point-in-time usage for the Overview panel — disk, bandwidth, visits, the PHP version, the TLS state, and a short daily bandwidth series for the usage chart. RLS-scoped to a site the caller can view (sites.view); an out-of-scope or unknown id is a 404, exactly like getSite. Collection is asynchronous. Metrics are gathered off the request path (a scheduled pull from the site's fleet worker into a cached store — never a live per-request driver call, CLAUDE.md §2.16) and read back here. Until a sample has been collected — a freshly-provisioned or suspended site, or a site on a worker not yet reporting — available is false, collected_at is null and the usage counters are null; the shape is stable so the client renders "usage not yet available" without a contract change once the collector populates it.
پیرامیٹرز
| نام | قسم | لازمی | یہ کیا ہے |
|---|---|---|---|
siteId (path) | Uuid | ہاں | Site ID (UUIDv7). |
جواب
| نام | قسم | لازمی | یہ کیا ہے |
|---|---|---|---|
available | boolean | ہاں | Whether a metrics sample has been collected for this site yet. |
disk_used_mb | object | ہاں | Disk the site is using, in MB, from the newest stored hourly reading. null when nothing has measured it yet or when the newest reading is too old to present as current — the… |
disk_limit_mb | object | ہاں | The disk ceiling ENFORCED on the box, in MB, as last stored. null when no ceiling is recorded. ⛔ Not the plan allowance — see getSiteQuota, which returns both separately… |
bandwidth_mb | object | ہاں | Bandwidth used in the current period. |
visits | object | ہاں | — |
php_version | string | نہیں | The PHP version the site runs; empty when not applicable/unknown. |
serving_ok | object | نہیں | Whether the site actually answered over HTTPS from outside the box at serving_checked_at, established by the recurring serving sweep rather than on this request. null… |
serving_checked_at | object | نہیں | When a DEFINITE serving verdict was last obtained; null until one has been. Deliberately separate from the sweep's rotation cursor, which advances for every site the sweep… |
serving_detail | string | نہیں | The short status line behind serving_ok — "HTTP 522", "ConnectTimeout". Never a raw vendor response body. |
ssl_status | string<active, pending, none, unknown> | نہیں | The site's TLS certificate state. |
ssl_expires_at | object | نہیں | — |
bandwidth_series | integer[] | ہاں | Recent daily bandwidth samples (MB), oldest first — for the usage chart. Empty when unavailable. |
collected_at | object | ہاں | When this sample was collected; null when unavailable. |
error_rate | SiteErrorRate | ہاں | HTTP and PHP errors for one site over the newest closed collection window (#626). What features/uptime-monitoring sells:… |
وہ خرابیان جو یہ اینڈ پوائنٹ واپس کر سکتا ہے
401 · 403 · 404 · 429