Registry jobs

class datarobot.models.registry.job.Job

A DataRobot job.

Added in version v3.4.

Variables:
  • id (str) – The ID of the job.

  • name (str) – The name of the job.

  • created_at (str) – ISO-8601 formatted timestamp of when the version was created

  • items (List[JobFileItem]) – A list of file items attached to the job.

  • description (Optional[str]) – A job description.

  • environment_id (Optional[str]) – The ID of the environment to use with the job.

  • environment_version_id (Optional[str]) – The ID of the environment version to use with the job.

classmethod create(name, environment_id=None, environment_version_id=None, folder_path=None, files=None, file_data=None, runtime_parameter_values=None)

Create a job.

Added in version v3.4.

Parameters:
  • name (str) – The name of the job.

  • environment_id (Optional[str]) – The environment ID to use for job runs. The ID must be specified in order to run the job.

  • environment_version_id (Optional[str]) – The environment version ID to use for job runs. If not specified, the latest version of the execution environment will be used.

  • folder_path (Optional[str]) – The path to a folder containing files to be uploaded. Each file in the folder is uploaded under path relative to a folder path.

  • files (Optional[Union[List[Tuple[str, str]], List[str]]]) – The files to be uploaded to the job. The files can be defined in 2 ways: 1. List of tuples where 1st element is the local path of the file to be uploaded and the 2nd element is the file path in the job file system. 2. List of local paths of the files to be uploaded. In this case files are added to the root of the model file system.

  • file_data (Optional[Dict[str, str]]) – The files content to be uploaded to the job. Defined as a dictionary where keys are the file paths in the job file system. and values are the files content.

  • runtime_parameter_values (Optional[List[RuntimeParameterValue]]) – Additional parameters to be injected into a model at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the model-metadata.yaml file.

Returns:

created job

Return type:

Job

Raises:
classmethod list()

List jobs.

Added in version v3.4.

Returns:

a list of jobs

Return type:

List[Job]

Raises:
classmethod get(job_id)

Get job by id.

Added in version v3.4.

Parameters:

job_id (str) – The ID of the job.

Returns:

retrieved job

Return type:

Job

Raises:
update(name=None, entry_point=None, environment_id=None, environment_version_id=None, description=None, folder_path=None, files=None, file_data=None, runtime_parameter_values=None)

Update job properties.

Added in version v3.4.

Parameters:
  • name (str) – The job name.

  • entry_point (Optional[str]) – The job file item ID to use as an entry point of the job.

  • environment_id (Optional[str]) – The environment ID to use for job runs. Must be specified in order to run the job.

  • environment_version_id (Optional[str]) – The environment version ID to use for job runs. If not specified, the latest version of the execution environment will be used.

  • description (str) – The job description.

  • folder_path (Optional[str]) – The path to a folder containing files to be uploaded. Each file in the folder is uploaded under path relative to a folder path.

  • files (Optional[Union[List[Tuple[str, str]], List[str]]]) – The files to be uploaded to the job. The files can be defined in 2 ways: 1. List of tuples where 1st element is the local path of the file to be uploaded and the 2nd element is the file path in the job file system. 2. List of local paths of the files to be uploaded. In this case files are added to the root of the job file system.

  • file_data (Optional[Dict[str, str]]) – The files content to be uploaded to the job. Defined as a dictionary where keys are the file paths in the job file system. and values are the files content.

  • runtime_parameter_values (Optional[List[RuntimeParameterValue]]) – Additional parameters to be injected into a model at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the model-metadata.yaml file.

Raises:
Return type:

None

delete()

Delete job. :rtype: None

Added in version v3.4.

Raises:
refresh()

Update job with the latest data from server. :rtype: None

Added in version v3.4.

Raises:

Create a job from a custom metric gallery template.

Parameters:
  • template_id (str) – ID of the template.

  • name (str) – Name of the job.

  • description (Optional[str]) – Description of the job.

  • sidecar_deployment_id (Optional[str]) – ID of the sidecar deployment. Only relevant for templates that use sidecar deployments.

Returns:

retrieved job

Return type:

Job

Raises:
list_schedules()

List schedules for the job.

Returns:

a list of schedules for the job.

Return type:

List[JobSchedule]

class datarobot.models.registry.job.JobFileItem

A file item attached to a DataRobot job.

Added in version v3.4.

Variables:
  • id (str) – The ID of the file item.

  • file_name (str) – The name of the file item.

  • file_path (str) – The path of the file item.

  • file_source (str) – The source of the file item.

  • created_at (str) – ISO-8601 formatted timestamp of when the version was created.

class datarobot.models.registry.job_run.JobRun

A DataRobot job run.

Added in version v3.4.

Variables:
  • id (str) – The ID of the job run.

  • custom_job_id (str) – The ID of the parent job.

  • description (str) – A description of the job run.

  • created_at (str) – ISO-8601 formatted timestamp of when the version was created

  • items (List[JobFileItem]) – A list of file items attached to the job.

  • status (JobRunStatus) – The status of the job run.

  • duration (float) – The duration of the job run.

classmethod create(job_id, max_wait=600, runtime_parameter_values=None)

Create a job run.

Added in version v3.4.

Parameters:
  • job_id (str) – The ID of the job.

  • max_wait (Optional[int]) – max time to wait for a terminal status (“succeeded”, “failed”, “interrupted”, “canceled”). If set to None - method will return without waiting.

  • runtime_parameter_values (Optional[List[RuntimeParameterValue]]) – Additional parameters to be injected into a model at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the model-metadata.yaml file.

Returns:

created job

Return type:

Job

Raises:
classmethod list(job_id)

List job runs.

Added in version v3.4.

Parameters:

job_id (str) – The ID of the job.

Returns:

A list of job runs.

Return type:

List[Job]

Raises:
classmethod get(job_id, job_run_id)

Get job run by id.

Added in version v3.4.

Parameters:
  • job_id (str) – The ID of the job.

  • job_run_id (str) – The ID of the job run.

Returns:

The retrieved job run.

Return type:

Job

Raises:
update(description=None)

Update job run properties.

Added in version v3.4.

Parameters:

description (str) – new job run description

Raises:
Return type:

None

cancel()

Cancel job run. :rtype: None

Added in version v3.4.

Raises:
refresh()

Update job run with the latest data from server. :rtype: None

Added in version v3.4.

Raises:
get_logs()

Get log of the job run. :rtype: Optional[str]

Added in version v3.4.

Raises:
delete_logs()

Get log of the job run. :rtype: None

Added in version v3.4.

Raises:
class datarobot.models.registry.job_run.JobRunStatus

Enum of the job run statuses

class datarobot.models.registry.job.JobSchedule

A job schedule.

Added in version v3.5.

Variables:
  • id (str) – The ID of the job schedule.

  • custom_job_id (str) – The ID of the custom job.

  • updated_at (str) – ISO-8601 formatted timestamp of when the schedule was updated.

  • updated_by (Dict[str, Any]) – The user who updated the schedule.

  • created_at (str) – ISO-8601 formatted timestamp of when the schedule was created.

  • created_by (Dict[str, Any]) – The user who created the schedule.

  • scheduled_job_id (str) – The ID of the scheduled job.

  • deployment (Dict[str, Any]) – The deployment of the scheduled job.

  • schedule (Schedule) – The schedule of the job.

  • parameter_overrides (List[RuntimeParameterValue]) – The parameter overrides for this schedule.

update(schedule=None, parameter_overrides=None)

Update the job schedule.

Parameters:
  • schedule (Optional[Schedule]) – The schedule of the job.

  • parameter_overrides (Optional[List[RuntimeParameterValue]]) – The parameter overrides for this schedule.

Return type:

JobSchedule

delete()

Delete the job schedule. :rtype: None

classmethod create(custom_job_id, schedule, parameter_overrides=None)

Create a job schedule.

Parameters:
  • custom_job_id (str) – The ID of the custom job.

  • schedule (Schedule) – The schedule of the job.

  • parameter_overrides (Optional[List[RuntimeParameterValue]]) – The parameter overrides for this schedule.

Return type:

JobSchedule