Registry Jobs

class datarobot.models.registry.job.Job(id, name, created_at, items, description=None, environment_id=None, environment_version_id=None, entry_point=None, runtime_parameters=None)

A DataRobot job.

Added in version v3.4.

Attributes:
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: str, optional

A job description.

environment_id: str, optional

The ID of the environment to use with the job.

environment_version_id: str, optional

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. :rtype: 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:
Job

created job

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

classmethod list()

List jobs. :rtype: List[Job]

Added in version v3.4.

Returns:
List[Job]

a list of jobs

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

classmethod get(job_id)

Get job by id. :rtype: Job

Added in version v3.4.

Parameters:
job_id: str

The ID of the job.

Returns:
Job

retrieved job

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status.

datarobot.errors.ServerError

if the server responded with 5xx status.

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. :rtype: None

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:
datarobot.errors.ClientError

if the server responded with 4xx status.

datarobot.errors.ServerError

if the server responded with 5xx status.

delete()

Delete job. :rtype: None

Added in version v3.4.

Raises:
datarobot.errors.ClientError

If the server responded with 4xx status.

datarobot.errors.ServerError

If the server responded with 5xx status.

refresh()

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

Added in version v3.4.

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

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:
Job

retrieved job

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status.

datarobot.errors.ServerError

if the server responded with 5xx status.

Return type:

Job

list_schedules()

List schedules for the job.

Returns:
List[JobSchedule]

a list of schedules for the job.

Return type:

List[JobSchedule]

class datarobot.models.registry.job.JobFileItem(id, file_name, file_path, file_source, created_at)

A file item attached to a DataRobot job.

Added in version v3.4.

Attributes:
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(id, custom_job_id, created_at, items, status, duration, description=None, runtime_parameters=None)

A DataRobot job run.

Added in version v3.4.

Attributes:
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. :rtype: JobRun

Added in version v3.4.

Parameters:
job_id: str

The ID of the job.

max_wait: int, optional

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:
Job

created job

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

ValueError

if execution environment or entry point is not specified for the job

classmethod list(job_id)

List job runs. :rtype: List[JobRun]

Added in version v3.4.

Parameters:
job_id: str

The ID of the job.

Returns:
List[Job]

A list of job runs.

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

classmethod get(job_id, job_run_id)

Get job run by id. :rtype: JobRun

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:
Job

The retrieved job run.

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status.

datarobot.errors.ServerError

if the server responded with 5xx status.

update(description=None)

Update job run properties. :rtype: None

Added in version v3.4.

Parameters:
description: str

new job run description

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status.

datarobot.errors.ServerError

if the server responded with 5xx status.

cancel()

Cancel job run. :rtype: None

Added in version v3.4.

Raises:
datarobot.errors.ClientError

If the server responded with 4xx status.

datarobot.errors.ServerError

If the server responded with 5xx status.

refresh()

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

Added in version v3.4.

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

get_logs()

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

Added in version v3.4.

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

delete_logs()

Get log of the job run. :rtype: None

Added in version v3.4.

Raises:
datarobot.errors.ClientError

if the server responded with 4xx status

datarobot.errors.ServerError

if the server responded with 5xx status

class datarobot.models.registry.job_run.JobRunStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Enum of the job run statuses

class datarobot.models.registry.job.JobSchedule(id, custom_job_id, updated_at, updated_by, created_at, created_by, scheduled_job_id, schedule=None, deployment=None, parameter_overrides=None)

A job schedule.

Added in version v3.5.

Attributes:
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. Returns ——- None

Return type:

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