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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes | The role's id: the product that owns it, then what it is (codes.worker, desks.host, ai.host, bot.robot). |
|
name | string | yes | The role's name, in the owner's words. |
|
installs | string | yes | What the role puts on the machine (the job runner, the desk sandbox, the local model server). |
|
shows | string | yes | What the hub shows for a machine with this role. |
|
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 }] }