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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
state | enum |
| ||
project_id | string | Admin only (run.job.admin): list this project's jobs; with run.job.list it is refused 403. |
| |
limit | one of | Items per page, 1 to 200 (default 50). A query string carries it as a string, which must name the same range. | ||
cursor | string | next_cursor of the previous page. |
|
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 }] }