MediaReplicaEvictedPayload media.replica.evicted@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.replica.evicted.v1.json

media.replica.evicted v1 (OpenVibe.Media server/objects/tiering.js demote(), the recordPlacement in the transaction that deletes the media_locations row; PR #18). The replica is gone: the bytes were deleted from the provider and the location row removed, so nothing routes reads there any more. Paired with the media.replica.draining that preceded it; draining without evicted is a delete that failed. Envelope: subject { type: object, id: <object_id> }, visibility internal, priority low, actor service:media, source media. Sandbox tenants produce none.

Fields

FieldTypeRequiredDescriptionConstraints
object_idstringyes
  • pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$
app_idstring | nullyesThe tenant that owns the object: an app (live, tools…) or a developer project's production tenant (prj_…); null when the object has no tenant.
  • minLength 1
  • maxLength 200
classenumyesThe placement class the move was budgeted against (media.storage_policy classes; tiering.classOf).
  • one of "video", "image", "download", "game-asset", "attachment", "backup"
actionconstyesEviction is always the end of a demotion.
  • = "demote"
providerenumyesThe provider the replica was removed from.
  • one of "local", "b2", "r2"
keystringyesThe object key that no longer exists in the provider's bucket.
  • minLength 1
  • maxLength 1024

Examples

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

Valid: evict-r2
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "demote",
  "provider": "r2",
  "key": "vods/med_01JAB2C3D4E5F6G7H8J9K0MNPQ.mp4"
}
Rejected: missing-provider
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "demote",
  "key": "vods/med_01JAB2C3D4E5F6G7H8J9K0MNPQ.mp4"
}
Rejected: promote-action
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "promote",
  "provider": "r2",
  "key": "vods/med_01JAB2C3D4E5F6G7H8J9K0MNPQ.mp4"
}

Validate

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