---
title: "media.provider.capacity_warning@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/media.provider.capacity_warning"
updated: null
---

# media.provider.capacity\_warning@1 · OpenVibe.Services

HTML: [media.provider.capacity\_warning@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/media.provider.capacity_warning)

# MediaProviderCapacityWarningPayload `media.provider.capacity_warning@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.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`](/docs/contracts/media.provider.capacity_warning.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

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `app_id` | string \| null | yes | Always null: a provider serves every tenant, so the signal belongs to no one app. |  |
| `provider` | enum | yes | The provider that lost classes. | - `one of "local", "b2", "r2"` |
| `classes` | array of enum | yes | The classes the provider still serves after the probe; a strict subset of previous\_classes. | - `unique items`<br>- `items: one of "online-canonical", "online-hot", "regional-cache"` |
| `previous_classes` | array of enum | yes | The classes the provider served before the probe. | - `unique items`<br>- `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 }] }
~~~~
