API endpoint that allows jobs to be viewed or edited.

Pass the start_now url parameter to the POST method to enqueue the job immediately.

Use the delay field to create a test job with fake duration of work (in seconds).

Actions

/jobs/{id}/run/ (POST)

Run a job (add it to the queue).

/jobs/{id}/cancel/ (POST)

Cancel a job (terminate the background task)

GET /api/v2/jobs/1145/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1145,
    "details": "https://api.beluga.insectai.org/api/v2/jobs/1145/?format=api",
    "name": "Populate captures for collection 18",
    "delay": 0,
    "limit": null,
    "shuffle": true,
    "project": {
        "id": 20,
        "name": "Barro Colorado Island Research Station",
        "details": "https://api.beluga.insectai.org/api/v2/projects/20/?format=api",
        "user_permissions": []
    },
    "deployment": null,
    "source_image_collection": {
        "id": 18,
        "name": "Panama - Hourly",
        "details": "https://api.beluga.insectai.org/api/v2/captures/collections/18/?format=api",
        "method": "interval",
        "user_permissions": []
    },
    "source_image_single": null,
    "pipeline": null,
    "status": "SUCCESS",
    "created_at": "2025-01-21T22:08:09.690210",
    "updated_at": "2025-01-21T22:08:20.226282",
    "started_at": "2025-01-21T22:08:09.869364",
    "finished_at": "2025-01-21T22:08:20.170171",
    "duration": "10.300807",
    "progress": {
        "summary": {
            "status": "SUCCESS",
            "progress": 1.0
        },
        "stages": [
            {
                "status": "SUCCESS",
                "progress": 1.0,
                "key": "populate_captures_collection",
                "name": "Populate captures collection",
                "params": [
                    {
                        "name": "Captures added",
                        "key": "captures_added",
                        "category": "default",
                        "value": 135
                    }
                ]
            }
        ],
        "errors": [],
        "logs": [
            "[2025-01-21 22:08:20] INFO Finished job #1145 \"Populate captures for collection 18\" (SUCCESS)",
            "[2025-01-21 22:08:20] INFO Changing status of job 1145 to SUCCESS",
            "[2025-01-21 22:08:20] INFO Added 135 captures to source image collection #18 Panama - Hourly",
            "[2025-01-21 22:08:20] INFO Finished populating source image collection #18 Panama - Hourly",
            "[2025-01-21 22:08:20] INFO Done sampling and saving captures to #18 Panama - Hourly",
            "[2025-01-21 22:08:09] INFO Sampling and saving captures to #18 Panama - Hourly",
            "[2025-01-21 22:08:09] INFO Sampling using method 'sample_interval' with params: {'minute_interval': 50}",
            "[2025-01-21 22:08:09] INFO Populating source image collection #18 Panama - Hourly",
            "[2025-01-21 22:08:09] INFO Changing status of job 1145 to STARTED",
            "[2025-01-21 22:08:09] INFO Running job #1145 \"Populate captures for collection 18\" (PENDING)"
        ]
    },
    "logs": {
        "stdout": [
            "[2025-01-21 22:08:20] INFO Finished job #1145 \"Populate captures for collection 18\" (SUCCESS)",
            "[2025-01-21 22:08:20] INFO Changing status of job 1145 to SUCCESS",
            "[2025-01-21 22:08:20] INFO Added 135 captures to source image collection #18 Panama - Hourly",
            "[2025-01-21 22:08:20] INFO Finished populating source image collection #18 Panama - Hourly",
            "[2025-01-21 22:08:20] INFO Done sampling and saving captures to #18 Panama - Hourly",
            "[2025-01-21 22:08:09] INFO Sampling and saving captures to #18 Panama - Hourly",
            "[2025-01-21 22:08:09] INFO Sampling using method 'sample_interval' with params: {'minute_interval': 50}",
            "[2025-01-21 22:08:09] INFO Populating source image collection #18 Panama - Hourly",
            "[2025-01-21 22:08:09] INFO Changing status of job 1145 to STARTED",
            "[2025-01-21 22:08:09] INFO Running job #1145 \"Populate captures for collection 18\" (PENDING)"
        ],
        "stderr": []
    },
    "job_type": {
        "name": "Populate captures collection",
        "key": "populate_captures_collection"
    },
    "data_export": null,
    "dispatch_mode": "internal",
    "result": null,
    "user_permissions": []
}