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/1104/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1104,
    "details": "https://api.beluga.insectai.org/api/v2/jobs/1104/?format=api",
    "name": "Sync captures for deployment 252",
    "delay": 0,
    "limit": null,
    "shuffle": true,
    "project": {
        "id": 88,
        "name": "Costa Rica- Labelling",
        "details": "https://api.beluga.insectai.org/api/v2/projects/88/?format=api",
        "user_permissions": []
    },
    "deployment": {
        "id": 252,
        "name": "Costa Rica - Wetland",
        "details": "https://api.beluga.insectai.org/api/v2/deployments/252/?format=api",
        "user_permissions": []
    },
    "source_image_collection": null,
    "source_image_single": null,
    "pipeline": null,
    "status": "SUCCESS",
    "created_at": "2025-01-13T10:31:40.146564",
    "updated_at": "2025-01-14T21:48:37.451075",
    "started_at": "2025-01-14T21:48:26.109089",
    "finished_at": "2025-01-14T21:48:37.233665",
    "duration": "11.124576",
    "progress": {
        "summary": {
            "status": "SUCCESS",
            "progress": 1.0
        },
        "stages": [
            {
                "status": "SUCCESS",
                "progress": 1.0,
                "key": "data_storage_sync",
                "name": "Data storage sync",
                "params": [
                    {
                        "name": "Total files",
                        "key": "total_files",
                        "category": "default",
                        "value": 4327
                    }
                ]
            },
            {
                "status": "SUCCESS",
                "progress": 1.0,
                "key": "update_deployment_cache",
                "name": "Update deployment cache",
                "params": []
            }
        ],
        "errors": [],
        "logs": [
            "[2025-01-14 21:48:37] INFO Finished job #1104 \"Sync captures for deployment 252\" (SUCCESS)",
            "[2025-01-14 21:48:37] INFO Changing status of job 1104 to SUCCESS",
            "[2025-01-14 21:48:37] INFO Finished syncing captures for deployment #252 Costa Rica - Wetland",
            "[2025-01-14 21:48:36] INFO Saving and recalculating sessions for deployment",
            "[2025-01-14 21:48:36] INFO Processed 4327 files",
            "[2025-01-14 21:48:35] INFO Processed 4000 files",
            "[2025-01-14 21:48:33] INFO Processed 3000 files",
            "[2025-01-14 21:48:31] INFO Processed 2000 files",
            "[2025-01-14 21:48:29] INFO Processed 1000 files",
            "[2025-01-14 21:48:26] INFO Syncing captures for deployment #252 Costa Rica - Wetland",
            "[2025-01-14 21:48:26] INFO Changing status of job 1104 to STARTED",
            "[2025-01-14 21:48:26] INFO Running job #1104 \"Sync captures for deployment 252\" (PENDING)"
        ]
    },
    "logs": {
        "stdout": [
            "[2025-01-14 21:48:37] INFO Finished job #1104 \"Sync captures for deployment 252\" (SUCCESS)",
            "[2025-01-14 21:48:37] INFO Changing status of job 1104 to SUCCESS",
            "[2025-01-14 21:48:37] INFO Finished syncing captures for deployment #252 Costa Rica - Wetland",
            "[2025-01-14 21:48:36] INFO Saving and recalculating sessions for deployment",
            "[2025-01-14 21:48:36] INFO Processed 4327 files",
            "[2025-01-14 21:48:35] INFO Processed 4000 files",
            "[2025-01-14 21:48:33] INFO Processed 3000 files",
            "[2025-01-14 21:48:31] INFO Processed 2000 files",
            "[2025-01-14 21:48:29] INFO Processed 1000 files",
            "[2025-01-14 21:48:26] INFO Syncing captures for deployment #252 Costa Rica - Wetland",
            "[2025-01-14 21:48:26] INFO Changing status of job 1104 to STARTED",
            "[2025-01-14 21:48:26] INFO Running job #1104 \"Sync captures for deployment 252\" (PENDING)"
        ],
        "stderr": []
    },
    "job_type": {
        "name": "Data storage sync",
        "key": "data_storage_sync"
    },
    "data_export": null,
    "dispatch_mode": "internal",
    "result": null,
    "user_permissions": []
}