iRetail PRO hub 1.0.0-m5: alerts
4 операции
← Вся документация · Источник: контракты, openapi/hub-v1.yaml на коммите 8000474.
Справочники на английском — на языке контрактов, из которых они созданы.
Операции
GET
/v1/alerts
The chain's alerts, newest first (spec/HEALTH.md).
operationId
listAlerts · Право alert.read
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
state
|
query | "open" | "all" |
|
store_id
|
query | string (uuid) |
|
limit
|
query | integer |
|
after
|
query | string |
The cursor of the previous page. |
Ответы
POST
/v1/alerts/{id}/acknowledge
Acknowledge an open alert; it stays open and sends no further notice. 409 alert_resolved for one already resolved.
operationId
acknowledgeAlert · Право alert.manage
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязательный
|
path | string (uuid) |
|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
Ответы
GET
/v1/alerts/settings
The alert thresholds and the webhook's name.
operationId
getAlertSettings · Право alert.read
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
Ответы
-
200OKAlertSettings -
401Error (spec/API.md).Error -
403Error (spec/API.md).Error
PUT
/v1/alerts/settings
Set the alert thresholds and the webhook's name (its URL is read from IRETAIL_ALERT_WEBHOOK_<NAME>).
operationId
putAlertSettings · Право alert.manage
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
If-Match
|
header | string |
The version the change is based on. |
Тело запроса обязательный
application/jsonAlertSettingsPut
Ответы
-
200OKAlertSettings -
400Error (spec/API.md).Error -
401Error (spec/API.md).Error -
403Error (spec/API.md).Error -
412Error (spec/API.md).Error
Схемы
AlertKind "node_silent" | "node_behind" | "shift_open_long" | "certificate_expiring" | "redis_down" | "backup_overdue"
node_silent · node_behind · shift_open_long · certificate_expiring · redis_down · backup_overdue
Alert object
id обязательный
|
string (uuid) |
|
kind обязательный
|
AlertKind |
|
store_id обязательный
|
string (uuid) |
|
node_id обязательный
|
string (uuid) |
|
state обязательный
|
"open" | "resolved" |
|
opened_at обязательный
|
string (date-time) |
|
resolved_at обязательный
|
string (date-time) | null |
|
acknowledged_by обязательный
|
string (uuid) | null |
|
acknowledged_at обязательный
|
string (date-time) | null |
|
details обязательный
|
object |
By kind (spec/HEALTH.md, "Alerts"); times as RFC 3339, counts as integers. |
notice обязательный
|
"sent" | "pending" | "failed" | null |
The webhook notice's state, or null without a webhook. |
AlertSettingsPut object
silent_minutes обязательный
|
integer |
|
behind_entries обязательный
|
integer |
|
behind_minutes обязательный
|
integer |
|
shift_hours обязательный
|
integer |
|
certificate_days обязательный
|
integer |
|
backup_hours обязательный
|
integer |
|
webhook обязательный
|
string | null |
The webhook's name; the hub reads its URL from IRETAIL_ALERT_WEBHOOK_<NAME> (or …_FILE). Null for none. |
AlertSettings object
silent_minutes обязательный
|
integer |
|
behind_entries обязательный
|
integer |
|
behind_minutes обязательный
|
integer |
|
shift_hours обязательный
|
integer |
|
certificate_days обязательный
|
integer |
|
backup_hours обязательный
|
integer |
|
webhook обязательный
|
string | null |
|
webhook_configured обязательный
|
boolean |
The hub found the named webhook's URL in its environment; the URL itself is never shown. |
version обязательный
|
integer (int64) |