BotMachineManageRequest bot.machine-manage-request@1

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

Version
1.0.0
Owner
bot
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/bot/machine-manage-request.v1.json

bot.machine-manage-request@1: what a caller changes on a machine (plan L34, step M2). A rename gives a name; a roles change gives the whole set of roles (network.machine-roles-put@1's shape). The same body is what the network's hub sends to Bot, so both sides speak one shape.

Fields

FieldTypeRequiredDescriptionConstraints
namestringThe name the owner gives the machine. Absent when the call changes something else.
  • minLength 1
  • maxLength 80
rolesarray of stringThe machine's roles after the change. Absent when the call changes something else.
  • maxItems 8
  • unique items
  • items: pattern ^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$

Examples

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

Valid: rename
{
  "name": "Kitchen server"
}
Valid: roles
{
  "roles": [
    "codes.worker",
    "ai.host"
  ]
}
Rejected: bad-role
{
  "roles": [
    "codesworker"
  ]
}
Rejected: empty
{}
Rejected: unknown-field
{
  "nickname": "x"
}

Validate

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