RunJobListQuery run.job-list-query@1

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

Version
1.0.0
Owner
run
Visibility
public
Status
planned
Compatibility
backward
Decision
ADR-034
Schema
https://openvibe.network/contracts/run/job-list-query.v1.json

run.job-list-query@1 (PLANNED; plan T14 R1): the query string of GET /api/v1/jobs on OpenVibe.Run (capability run.job.list) and of GET /api/v1/admin/jobs (run.job.admin, which alone may pass project_id). Without project_id it lists the caller's token project.

Fields

FieldTypeRequiredDescriptionConstraints
stateenum
  • one of "queued", "placed", "running", "succeeded", "failed", "cancelled", "expired"
project_idstringAdmin only (run.job.admin): list this project's jobs; with run.job.list it is refused 403.
  • pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$
limitone ofItems per page, 1 to 200 (default 50). A query string carries it as a string, which must name the same range.
cursorstringnext_cursor of the previous page.
  • maxLength 512

Examples

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

Valid: admin-project
{
  "project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "limit": 200
}
Valid: running-page
{
  "state": "running",
  "limit": "50",
  "cursor": "eyJpZCI6ImpvYl8wMSJ9"
}
Rejected: limit-too-high
{
  "limit": "201"
}
Rejected: unknown-state
{
  "state": "done"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('run.job-list-query@1', value);   // { valid, errors: [{ path, message }] }