NetworkOperatorAlertsResult network.operator-alerts-result@1

Generated at from openvibe-contracts v0.76.0 and openvibe-sdk v0.20.1.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/operator-alerts-result.v1.json

network.operator-alerts-result@1: the answer of POST /internal/operator/alerts. firing: alerts firing after this report; opened: newly firing (paged); reminded: still firing and paged again (once a day); resolved: no longer firing (a resolved notice sent); notified: notifications created across all recipients (0 when no operator account is found or they switched admin notices off). Errors are { error } bodies (400 for a body that breaks the request contract).

Fields

FieldTypeRequiredDescriptionConstraints
okconstyes
  • = true
firingintegeryes
  • minimum 0
openedintegeryes
  • minimum 0
remindedintegeryes
  • minimum 0
resolvedintegeryes
  • minimum 0
notifiedintegeryes
  • minimum 0

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: opened-and-resolved
{
  "ok": true,
  "firing": 2,
  "opened": 1,
  "reminded": 0,
  "resolved": 1,
  "notified": 2
}
Valid: quiet
{
  "ok": true,
  "firing": 0,
  "opened": 0,
  "reminded": 0,
  "resolved": 0,
  "notified": 0
}
Rejected: negative
{
  "ok": true,
  "firing": -1,
  "opened": 0,
  "reminded": 0,
  "resolved": 0,
  "notified": 0
}
Rejected: no-notified
{
  "ok": true,
  "firing": 1,
  "opened": 1,
  "reminded": 0,
  "resolved": 0
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('network.operator-alerts-result@1', value);   // { valid, errors: [{ path, message }] }