MCPcopy
hub / github.com/simstudioai/sim / get_job_status

Method get_job_status

packages/python-sdk/simstudio/__init__.py:379–413  ·  view source on GitHub ↗

Get the status of an async job. Args: job_id: The job ID returned from async execution Returns: Dictionary containing the job status Raises: SimStudioError: If getting the status fails

(self, job_id: str)

Source from the content-addressed store, hash-verified

377 self._session.close()
378
379 def get_job_status(self, job_id: str) -> Dict[str, Any]:
380 """
381 Get the status of an async job.
382
383 Args:
384 job_id: The job ID returned from async execution
385
386 Returns:
387 Dictionary containing the job status
388
389 Raises:
390 SimStudioError: If getting the status fails
391 """
392 url = f"{self.base_url}/api/jobs/{job_id}"
393
394 try:
395 response = self._session.get(url)
396
397 self._update_rate_limit_info(response)
398
399 if not response.ok:
400 try:
401 error_data = response.json()
402 error_message = error_data.get('error', f'HTTP {response.status_code}: {response.reason}')
403 error_code = error_data.get('code')
404 except (ValueError, KeyError):
405 error_message = f'HTTP {response.status_code}: {response.reason}'
406 error_code = None
407
408 raise SimStudioError(error_message, error_code, response.status_code)
409
410 return response.json()
411
412 except requests.RequestException as e:
413 raise SimStudioError(f'Failed to get job status: {str(e)}', 'STATUS_ERROR')
414
415 def execute_with_retry(
416 self,

Callers 2

Calls 4

strFunction · 0.85
SimStudioErrorClass · 0.70
getMethod · 0.65

Tested by 2