List Data Generation Jobs#
Prerequisites#
Before you can list data generation jobs, make sure that you have:
Obtained the base URL of your NeMo Data Designer service
Set the
DATA_DESIGNER_BASE_URL
environment variable to your NeMo Data Designer service endpoint
export DATA_DESIGNER_BASE_URL="https://your-data-designer-service-url"
To List Data Generation Jobs#
Choose one of the following options to list data generation jobs.
import os
from nemo_microservices import NeMoMicroservices
# Initialize the client
client = NeMoMicroservices(
base_url=os.environ['DATA_DESIGNER_BASE_URL']
)
# List data generation jobs
jobs = client.beta.data_designer.jobs.list()
print(f"Found {len(jobs)} jobs")
for job in jobs:
print(f"Job {job.id}: {job.status}")
print(f" Created: {job.created_at}")
print(f" Updated: {job.updated_at}")
curl -X GET \
"${DATA_DESIGNER_BASE_URL}/v1beta1/data-designer/jobs" \
-H 'Accept: application/json' \
| jq
Example Response
[
{
"id": "job-abc123def456",
"status": "running",
"status_details": null,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:35:00.000Z",
"namespace": "default",
"schema_version": "1.0"
},
{
"id": "job-def456ghi789",
"status": "completed",
"status_details": null,
"created_at": "2024-01-15T09:00:00.000Z",
"updated_at": "2024-01-15T09:15:00.000Z",
"namespace": "default",
"schema_version": "1.0"
}
]
Job Status Values#
Jobs can have the following status values:
created: Job has been created and is waiting to start
running: Job is actively generating data
completed: Job has finished successfully
failed: Job encountered an error and stopped
cancelled: Job has been cancelled by the user
unknown: Job status is unknown