GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

client.jobs.block_until_complete

Waits until the job moves to a final state

client.jobs.block_until_complete(job, timeout=60, poll_interval=5)

This method blocks the execution until the job changes its status (to COMPLETED, TIMEDOUT, or CANCELED) or reaches the timeout seconds (if it is different than None). It refreshes the job information for each poll_interval seconds.

Parameters

ParameterTypeDescriptionExample
jobstr
Job
The Job identifier as a string or a preloaded Job object'14856eb1-0ad8-49e7-9da3-887acb80fea5'
timeoutintSeconds amount to wait until timeout. None indicates waiting forever. Defaults to 60.100
poll_intervalintTime interval in seconds between polls. Defaults to 5.10

Returns

A Job object with the latest status from Modzy.

{
  "job_identifier": "string",
  "status",
  "account_identifier": "string",        
  "explain": "boolean",        
  "created_at": "date-time",
  "updated_at": "date-time",
  "submitted_at": "date-time",
  "submitted_by": "string",        
  "pending": "integer",
  "completed": "integer",    
  "failed": "integer",
  "total": "integer",    
  "model": {
    "identifier": "string",
    "version": "string",
    "name": "string"
  },
  "job_inputs": ["string"],
  "user": {
    "identifier": "string",
    "external_identifier": "string",
    "email": "string",
    "firstName": "string",      
    "lastName": "string",
    "status": "string",
    "title": "string"
    "access_keys": [
    	{
    		"prefix": "string",
        "is_default": "boolean"
  		}
    ]                        
  }
}

Examples

>>>job = client.jobs.block_until_complete('14856eb1-0ad8-49e7-9da3-887acb80fea5')
>>>job.status
'SUBMITTED'