My Jobs

My Jobs is a feature in OSC that lets you create and schedule background Python jobs that run on a cron schedule. Instead of managing your own infrastructure, OSC provisions an ephemeral job runner for each execution and cleans it up automatically when the job completes.

What You Can Do

  • Create scheduled background jobs from a Git repository (including private OSC Gitea repos)
  • Set any cron expression as the schedule
  • Trigger a job immediately with a single API call
  • Suspend a job without deleting it, and resume it later
  • Pass environment variables to jobs at creation time

Prerequisites

  • An OSC account on a paid plan (Personal, Professional, or Business)
  • A Personal Access Token (PAT) for authentication — create one at app.osaas.io/dashboard/tokens
  • A Python job in a Git repository (public or OSC Gitea)

How It Works

When a scheduled job is due, deploy-manager spins up an ephemeral eyevinn-python-job-runner instance, passes your source URL and worker command, and tears it down after execution. Credentials for private OSC Gitea repositories are resolved at trigger time — they are never stored in the job definition.

API Reference

All endpoints require a PAT passed as Authorization: Bearer <pat> in the x-pat-jwt header.

Base URL: https://deploy.svc.prod.osaas.io

List jobs

curl -s -H "x-pat-jwt: Bearer $PAT" \
  https://deploy.svc.prod.osaas.io/myjobs

Create a job

curl -s -X POST \
  -H "x-pat-jwt: Bearer $PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "dailysync",
    "cronSchedule": "0 9 * * 1-5",
    "sourceUrl": "https://github.com/myorg/myrepo",
    "workerCmd": "python jobs/sync.py",
    "envVars": {
      "API_URL": "https://api.example.com"
    }
  }' \
  https://deploy.svc.prod.osaas.io/myjobs
Field Required Description
name Yes Alphanumeric identifier (no hyphens or underscores)
cronSchedule Yes Standard 5-field cron expression (e.g. 0 9 * * 1-5)
sourceUrl Yes URL of the Git repository containing your Python script
workerCmd No Command to run (defaults to the runner's built-in entrypoint)
envVars No Key-value pairs injected as environment variables at runtime

Get a job

curl -s -H "x-pat-jwt: Bearer $PAT" \
  https://deploy.svc.prod.osaas.io/myjobs/dailysync

Trigger an immediate run

curl -s -X POST \
  -H "x-pat-jwt: Bearer $PAT" \
  https://deploy.svc.prod.osaas.io/myjobs/dailysync/run

Suspend a job (disable without deleting)

curl -s -X POST \
  -H "x-pat-jwt: Bearer $PAT" \
  https://deploy.svc.prod.osaas.io/myjobs/dailysync/suspend

Resume a suspended job

curl -s -X POST \
  -H "x-pat-jwt: Bearer $PAT" \
  https://deploy.svc.prod.osaas.io/myjobs/dailysync/resume

Delete a job

curl -s -X DELETE \
  -H "x-pat-jwt: Bearer $PAT" \
  https://deploy.svc.prod.osaas.io/myjobs/dailysync

Job Response Fields

Field Type Description
name string Job name
tenantId string Your workspace ID
runtime string Always python-job
cronSchedule string The cron expression
sourceUrl string Git repository URL
workerCmd string Worker command (if set)
envVars object Environment variables (if set)
enabled boolean Whether the job is active
lastRunAt number Unix timestamp of the last run (or null)
lastRunStatus string Status of the last run (or null)
createdAt string ISO 8601 creation timestamp
updatedAt string ISO 8601 last-update timestamp

Resources