DeliveryOffer platform.delivery-offer@1

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

Version
1.0.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-034
Schema
https://openvibe.network/contracts/platform/delivery-offer.v1.json

Transport and edge delivery capacity with cache policy and pricing (T1 Universal Fabric; ADR-034 proposed).

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
transportsarray of enumyes
  • minItems 1
  • unique items
  • items: one of "http", "hls", "rtmp", "srt", "ws"
regionsarray of stringyes
  • minItems 1
edgebooleanyes
nodestring
price_per_gb_usdnumberyesEstimated USD
  • minimum 0
price_per_request_usdnumberyesEstimated USD
  • minimum 0
cache_rulesobjectyes
  • no other fields
cache_rules.enabledbooleanyes
cache_rules.ttl_secondsinteger
  • minimum 0
cache_rules.max_object_mbnumber
  • minimum 0

Examples

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

Valid: example
{
  "id": "delivery-1",
  "transports": [
    "http",
    "hls"
  ],
  "regions": [
    "us-west"
  ],
  "edge": true,
  "node": "node-1",
  "price_per_gb_usd": 0.02,
  "price_per_request_usd": 0.00001,
  "cache_rules": {
    "enabled": true,
    "ttl_seconds": 300,
    "max_object_mb": 100
  }
}
Rejected: missing-id
{
  "transports": [
    "http",
    "hls"
  ],
  "regions": [
    "us-west"
  ],
  "edge": true,
  "node": "node-1",
  "price_per_gb_usd": 0.02,
  "price_per_request_usd": 0.00001,
  "cache_rules": {
    "enabled": true,
    "ttl_seconds": 300,
    "max_object_mb": 100
  }
}

Validate

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