Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

6.4 KB
Raw Blame

JobsApi

All URIs are relative to http://localhost:3000

Method HTTP request Description
getJob GET /jobs/{jobId} Get job details
listJobs GET /jobs List jobs for the runner
pollJobs GET /jobs/poll Long poll for jobs
updateJobStatus POST /jobs/{jobId}/status Update job status

getJob

Job getJob()

Example

import {
    JobsApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let jobId: string; //ID of the job

const { status, data } = await apiInstance.getJob(
    jobId
);

Parameters

Name Type Description Notes
jobId [string] ID of the job

Return type

Job

Authorization

bearer, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Job details -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listJobs

PaginatedJobs listJobs()

Returns a paginated list of jobs for the runner, optionally filtered by status.

Example

import {
    JobsApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let page: number; //Page number of the results (optional) (default to 1)
let limit: number; //Maximum number of jobs to return (default: 100, max: 500) (optional) (default to 100)
let status: JobStatus; //Filter jobs by status (optional) (default to undefined)
let offset: number; //Number of jobs to skip for pagination (default: 0) (optional) (default to undefined)
let afterId: string; //List jobs in ascending ID order after this UUID. Start with the nil UUID. (optional) (default to undefined)

const { status, data } = await apiInstance.listJobs(
    page,
    limit,
    status,
    offset,
    afterId
);

Parameters

Name Type Description Notes
page [number] Page number of the results (optional) defaults to 1
limit [number] Maximum number of jobs to return (default: 100, max: 500) (optional) defaults to 100
status JobStatus Filter jobs by status (optional) defaults to undefined
offset [number] Number of jobs to skip for pagination (default: 0) (optional) defaults to undefined
afterId [string] List jobs in ascending ID order after this UUID. Start with the nil UUID. (optional) defaults to undefined

Return type

PaginatedJobs

Authorization

bearer, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of jobs for the runner -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pollJobs

PollJobsResponse pollJobs()

Long poll endpoint for runners to fetch pending jobs. Returns immediately if jobs are available, otherwise waits up to timeout seconds.

Example

import {
    JobsApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let timeout: number; //Timeout in seconds for long polling (default: 30, max: 60) (optional) (default to undefined)
let limit: number; //Maximum number of jobs to return (default: 10, max: 100) (optional) (default to undefined)

const { status, data } = await apiInstance.pollJobs(
    timeout,
    limit
);

Parameters

Name Type Description Notes
timeout [number] Timeout in seconds for long polling (default: 30, max: 60) (optional) defaults to undefined
limit [number] Maximum number of jobs to return (default: 10, max: 100) (optional) defaults to undefined

Return type

PollJobsResponse

Authorization

bearer, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returned jobs have been claimed as IN_PROGRESS. A replacement runner can find them at startup with GET /jobs?status=IN_PROGRESS. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateJobStatus

Job updateJobStatus(updateJobStatus)

Example

import {
    JobsApi,
    Configuration,
    UpdateJobStatus
} from './api';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let jobId: string; //ID of the job
let updateJobStatus: UpdateJobStatus; //

const { status, data } = await apiInstance.updateJobStatus(
    jobId,
    updateJobStatus
);

Parameters

Name Type Description Notes
updateJobStatus UpdateJobStatus
jobId [string] ID of the job

Return type

Job

Authorization

bearer, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Job status updated successfully -

[Back to top] [Back to API list] [Back to Model list] [Back to README]