Get Job Status#

Prerequisites#

Before you can get the status of a data generation job, 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 Get the Status of a Data Generation Job#

Choose one of the following options to get the status of a data generation job.

import os
from nemo_microservices import NeMoMicroservices

# Initialize the client
client = NeMoMicroservices(
    base_url=os.environ['DATA_DESIGNER_BASE_URL']
)

# Get job status
job_id = "job-abc123def456"
job = client.beta.data_designer.jobs.retrieve(job_id)

print(f"Job ID: {job.id}")
print(f"Status: {job.status}")
print(f"Created: {job.created_at}")
print(f"Updated: {job.updated_at}")

# Check if job is completed
if job.status == "completed":
    print("Job completed successfully!")
elif job.status == "failed":
    print("Job failed")
JOB_ID="job-abc123def456"

curl -X GET \
  "${DATA_DESIGNER_BASE_URL}/v1beta1/data-designer/jobs/${JOB_ID}" \
  -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:40:00.000Z",
  "namespace": "default",
  "schema_version": "1.0"
}

Job 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

Error Handling#

If a job fails, check the status_details field in the response for error information.