MediaProviderCapacityWarningPayload media.provider.capacity_warning@1

Generated at from openvibe-contracts v0.97.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
media
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/media.provider.capacity_warning.v1.json

media.provider.capacity_warning v1 (OpenVibe.Media server/placement/providers.js setCapabilities(), the announceProviderEvent when a completed probe leaves the provider in fewer classes; PR #18). A provider that was passing lost one or more classes: the probe now fails a capability the class needs (for example R2 no longer serving a 206 range, so it stops being online-hot), and the router removes it from those classes until a later probe passes again. Emitted once per class loss, not once per probe. The event lives in the media namespace because OpenVibe.Events gates a service's event_type to a prefix that starts with its source name; the original provider.* type could never be published by source media (403 events.type_not_allowed). Envelope: subject { type: provider, id: <provider> }, visibility internal, priority low, actor service:media, source media.

Fields

FieldTypeRequiredDescriptionConstraints
app_idstring | nullyesAlways null: a provider serves every tenant, so the signal belongs to no one app.
providerenumyesThe provider that lost classes.
  • one of "local", "b2", "r2"
classesarray of enumyesThe classes the provider still serves after the probe; a strict subset of previous_classes.
  • unique items
  • items: one of "online-canonical", "online-hot", "regional-cache"
previous_classesarray of enumyesThe classes the provider served before the probe.
  • unique items
  • items: one of "online-canonical", "online-hot", "regional-cache"

Examples

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

Valid: r2-loses-hot
{
  "app_id": null,
  "provider": "r2",
  "classes": [],
  "previous_classes": [
    "online-hot"
  ]
}
Rejected: leaks-reason
{
  "app_id": null,
  "provider": "r2",
  "classes": [],
  "previous_classes": [
    "online-hot"
  ],
  "reason": "probe lost range_206"
}
Rejected: unknown-class
{
  "app_id": null,
  "provider": "r2",
  "classes": [],
  "previous_classes": [
    "online-warm"
  ]
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('media.provider.capacity_warning@1', value);   // { valid, errors: [{ path, message }] }