NetworkMachineRole network.machine-role@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/machine-role.v1.json

network.machine-role@1: one role a machine can have (plan L34, step M4). A role is what the machine does for the network: a name for the owner, what it installs on the machine and what the hub shows. The catalogue is network.machine-roles@1; a role outside it is refused.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyesThe role's id: the product that owns it, then what it is (codes.worker, desks.host, ai.host, bot.robot).
  • pattern ^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$
namestringyesThe role's name, in the owner's words.
  • maxLength 60
installsstringyesWhat the role puts on the machine (the job runner, the desk sandbox, the local model server).
  • maxLength 200
showsstringyesWhat the hub shows for a machine with this role.
  • maxLength 200

Examples

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

Valid: codes-worker
{
  "id": "codes.worker",
  "name": "Codes worker",
  "installs": "the Codes job runner",
  "shows": "Runs your coding jobs"
}
Rejected: missing-shows
{
  "id": "codes.worker",
  "name": "Codes worker",
  "installs": "the Codes job runner"
}
Rejected: no-dot
{
  "id": "worker",
  "name": "Codes worker",
  "installs": "x",
  "shows": "y"
}

Validate

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